70 """ |
70 """ |
71 Protected method to handle mouse press events. |
71 Protected method to handle mouse press events. |
72 |
72 |
73 @param event reference to the mouse press event (QMouseEvent) |
73 @param event reference to the mouse press event (QMouseEvent) |
74 """ |
74 """ |
75 if event.button() == Qt.LeftButton: |
75 if event.button() == Qt.MouseButton.LeftButton: |
76 self.__dragStartPos = QPoint(event.pos()) |
76 self.__dragStartPos = QPoint(event.pos()) |
77 E5WheelTabBar.mousePressEvent(self, event) |
77 E5WheelTabBar.mousePressEvent(self, event) |
78 |
78 |
79 def mouseMoveEvent(self, event): |
79 def mouseMoveEvent(self, event): |
80 """ |
80 """ |
81 Protected method to handle mouse move events. |
81 Protected method to handle mouse move events. |
82 |
82 |
83 @param event reference to the mouse move event (QMouseEvent) |
83 @param event reference to the mouse move event (QMouseEvent) |
84 """ |
84 """ |
85 if ( |
85 if ( |
86 event.buttons() == Qt.MouseButtons(Qt.LeftButton) and |
86 event.buttons() == Qt.MouseButtons(Qt.MouseButton.LeftButton) and |
87 (event.pos() - self.__dragStartPos).manhattanLength() > |
87 (event.pos() - self.__dragStartPos).manhattanLength() > |
88 QApplication.startDragDistance() |
88 QApplication.startDragDistance() |
89 ): |
89 ): |
90 drag = QDrag(self) |
90 drag = QDrag(self) |
91 mimeData = QMimeData() |
91 mimeData = QMimeData() |
231 Public method to set the context menu policy of the tab. |
231 Public method to set the context menu policy of the tab. |
232 |
232 |
233 @param policy context menu policy to set (Qt.ContextMenuPolicy) |
233 @param policy context menu policy to set (Qt.ContextMenuPolicy) |
234 """ |
234 """ |
235 self.tabBar().setContextMenuPolicy(policy) |
235 self.tabBar().setContextMenuPolicy(policy) |
236 if policy == Qt.CustomContextMenu: |
236 if policy == Qt.ContextMenuPolicy.CustomContextMenu: |
237 self.tabBar().customContextMenuRequested.connect( |
237 self.tabBar().customContextMenuRequested.connect( |
238 self.__handleTabCustomContextMenuRequested) |
238 self.__handleTabCustomContextMenuRequested) |
239 else: |
239 else: |
240 self.tabBar().customContextMenuRequested.disconnect( |
240 self.tabBar().customContextMenuRequested.disconnect( |
241 self.__handleTabCustomContextMenuRequested) |
241 self.__handleTabCustomContextMenuRequested) |
302 Private method to determine the free side of a tab. |
302 Private method to determine the free side of a tab. |
303 |
303 |
304 @return free side (QTabBar.ButtonPosition) |
304 @return free side (QTabBar.ButtonPosition) |
305 """ |
305 """ |
306 side = self.__tabBar.style().styleHint( |
306 side = self.__tabBar.style().styleHint( |
307 QStyle.SH_TabBar_CloseButtonPosition, |
307 QStyle.StyleHint.SH_TabBar_CloseButtonPosition, |
308 None, None, None) |
308 None, None, None) |
309 if side == QTabBar.LeftSide: |
309 if side == QTabBar.ButtonPosition.LeftSide: |
310 side = QTabBar.RightSide |
310 side = QTabBar.ButtonPosition.RightSide |
311 else: |
311 else: |
312 side = QTabBar.LeftSide |
312 side = QTabBar.ButtonPosition.LeftSide |
313 return side |
313 return side |
314 |
314 |
315 def animationLabel(self, index, animationFile, interval=100): |
315 def animationLabel(self, index, animationFile, interval=100): |
316 """ |
316 """ |
317 Public slot to set an animated icon. |
317 Public slot to set an animated icon. |