diff -r e28b89693f37 -r 299802979277 src/eric7/EricWidgets/EricTabWidget.py --- a/src/eric7/EricWidgets/EricTabWidget.py Tue Dec 19 11:04:03 2023 +0100 +++ b/src/eric7/EricWidgets/EricTabWidget.py Tue Dec 19 19:57:08 2023 +0100 @@ -26,7 +26,8 @@ """ Constructor - @param parent reference to the parent widget (QWidget) + @param parent reference to the parent widget + @type QWidget """ super().__init__(parent) self._tabWidget = parent @@ -35,7 +36,8 @@ """ Protected slot to support wheel events. - @param event reference to the wheel event (QWheelEvent) + @param event reference to the wheel event + @type QWheelEvent """ with contextlib.suppress(AttributeError): delta = event.angleDelta().y() @@ -61,7 +63,8 @@ """ Constructor - @param parent reference to the parent widget (QWidget) + @param parent reference to the parent widget + @type QWidget """ EricWheelTabBar.__init__(self, parent) self.setAcceptDrops(True) @@ -72,7 +75,8 @@ """ Protected method to handle mouse press events. - @param event reference to the mouse press event (QMouseEvent) + @param event reference to the mouse press event + @type QMouseEvent """ if event.button() == Qt.MouseButton.LeftButton: self.__dragStartPos = QPoint(event.position().toPoint()) @@ -82,7 +86,8 @@ """ Protected method to handle mouse move events. - @param event reference to the mouse move event (QMouseEvent) + @param event reference to the mouse move event + @type QMouseEvent """ if ( event.buttons() == Qt.MouseButton.LeftButton @@ -103,7 +108,8 @@ """ Protected method to handle drag enter events. - @param event reference to the drag enter event (QDragEnterEvent) + @param event reference to the drag enter event + @type QDragEnterEvent """ mimeData = event.mimeData() formats = mimeData.formats() @@ -120,7 +126,8 @@ """ Protected method to handle drop events. - @param event reference to the drop event (QDropEvent) + @param event reference to the drop event + @type QDropEvent """ fromIndex = self.tabAt(self.__dragStartPos) toIndex = self.tabAt(event.position().toPoint()) @@ -147,8 +154,10 @@ """ Constructor - @param parent reference to the parent widget (QWidget) - @param dnd flag indicating the support for Drag & Drop (boolean) + @param parent reference to the parent widget + @type QWidget + @param dnd flag indicating the support for Drag & Drop + @type bool """ super().__init__(parent) @@ -173,8 +182,10 @@ """ Public method to set a custom tab bar. - @param dnd flag indicating the support for Drag & Drop (boolean) - @param tabBar reference to the tab bar to set (QTabBar) + @param dnd flag indicating the support for Drag & Drop + @type bool + @param tabBar reference to the tab bar to set + @type QTabBar """ self.__tabBar = tabBar self.setTabBar(self.__tabBar) @@ -189,6 +200,7 @@ Private slot to handle the currentChanged signal. @param index index of the current tab + @type int """ if index == -1: self.__lastCurrentIndex = -1 @@ -233,7 +245,8 @@ """ Public method to set the context menu policy of the tab. - @param policy context menu policy to set (Qt.ContextMenuPolicy) + @param policy context menu policy to set + @type Qt.ContextMenuPolicy """ self.tabBar().setContextMenuPolicy(policy) if policy == Qt.ContextMenuPolicy.CustomContextMenu: @@ -249,7 +262,8 @@ """ Private slot to handle the context menu request for the tabbar. - @param point point the context menu was requested (QPoint) + @param point point the context menu was requested + @type QPoint """ _tabbar = self.tabBar() for index in range(_tabbar.count()): @@ -266,8 +280,10 @@ """ Public method to get the index of a tab given a position. - @param pos position determining the tab index (QPoint) - @return index of the tab (integer) + @param pos position determining the tab index + @type QPoint + @return index of the tab + @rtype int """ _tabbar = self.tabBar() for index in range(_tabbar.count()): @@ -281,8 +297,10 @@ """ Public method to move a tab to a new index. - @param curIndex index of tab to be moved (integer) - @param newIndex index the tab should be moved to (integer) + @param curIndex index of tab to be moved + @type int + @param newIndex index the tab should be moved to + @type int """ # step 1: save the tab data of tab to be moved toolTip = self.tabToolTip(curIndex) @@ -307,7 +325,8 @@ """ Private method to determine the free side of a tab. - @return free side (QTabBar.ButtonPosition) + @return free side + @rtype QTabBar.ButtonPosition """ side = self.__tabBar.style().styleHint( QStyle.StyleHint.SH_TabBar_CloseButtonPosition, None, None, None @@ -351,7 +370,8 @@ """ Public slot to reset an animated icon. - @param index tab index (integer) + @param index tab index + @type int """ if index == -1: return