5 |
5 |
6 """ |
6 """ |
7 Module implementing a TabWidget class substituting QTabWidget. |
7 Module implementing a TabWidget class substituting QTabWidget. |
8 """ |
8 """ |
9 |
9 |
|
10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
|
11 |
10 from PyQt4.QtCore import Qt, QPoint, QMimeData, QByteArray, pyqtSignal |
12 from PyQt4.QtCore import Qt, QPoint, QMimeData, QByteArray, pyqtSignal |
11 from PyQt4.QtGui import QTabWidget, QTabBar, QApplication, QDrag, QStyle, QLabel, QMovie |
13 from PyQt4.QtGui import QTabWidget, QTabBar, QApplication, QDrag, QStyle, QLabel, QMovie |
12 |
14 |
13 |
15 |
14 class E5WheelTabBar(QTabBar): |
16 class E5WheelTabBar(QTabBar): |
19 """ |
21 """ |
20 Constructor |
22 Constructor |
21 |
23 |
22 @param parent reference to the parent widget (QWidget) |
24 @param parent reference to the parent widget (QWidget) |
23 """ |
25 """ |
24 super().__init__(parent) |
26 super(E5WheelTabBar, self).__init__(parent) |
25 self._tabWidget = parent |
27 self._tabWidget = parent |
26 |
28 |
27 def wheelEvent(self, event): |
29 def wheelEvent(self, event): |
28 """ |
30 """ |
29 Protected slot to support wheel events. |
31 Protected slot to support wheel events. |
136 Constructor |
138 Constructor |
137 |
139 |
138 @param parent reference to the parent widget (QWidget) |
140 @param parent reference to the parent widget (QWidget) |
139 @keyparam dnd flag indicating the support for Drag & Drop (boolean) |
141 @keyparam dnd flag indicating the support for Drag & Drop (boolean) |
140 """ |
142 """ |
141 super().__init__(parent) |
143 super(E5TabWidget, self).__init__(parent) |
142 |
144 |
143 if dnd: |
145 if dnd: |
144 if not hasattr(self, 'setMovable'): |
146 if not hasattr(self, 'setMovable'): |
145 self.__tabBar = E5DnDTabBar(self) |
147 self.__tabBar = E5DnDTabBar(self) |
146 self.__tabBar.tabMoveRequested.connect(self.moveTab) |
148 self.__tabBar.tabMoveRequested.connect(self.moveTab) |