--- a/E5Gui/E5TabWidget.py Tue Oct 15 22:03:54 2013 +0200 +++ b/E5Gui/E5TabWidget.py Fri Oct 18 23:00:41 2013 +0200 @@ -10,12 +10,14 @@ from __future__ import unicode_literals # __IGNORE_WARNING__ from PyQt4.QtCore import Qt, QPoint, QMimeData, QByteArray, pyqtSignal -from PyQt4.QtGui import QTabWidget, QTabBar, QApplication, QDrag, QStyle, QLabel, QMovie +from PyQt4.QtGui import QTabWidget, QTabBar, QApplication, QDrag, QStyle, \ + QLabel, QMovie class E5WheelTabBar(QTabBar): """ - Class implementing a tab bar class substituting QTabBar to support wheel events. + Class implementing a tab bar class substituting QTabBar to support wheel + events. """ def __init__(self, parent=None): """ @@ -30,7 +32,7 @@ """ Protected slot to support wheel events. - @param reference to the wheel event (QWheelEvent) + @param event reference to the wheel event (QWheelEvent) """ try: if event.delta() > 0: @@ -47,8 +49,8 @@ """ Class implementing a tab bar class substituting QTabBar. - @signal tabMoveRequested(int, int) emitted to signal a tab move request giving - the old and new index position + @signal tabMoveRequested(int, int) emitted to signal a tab move request + giving the old and new index position """ tabMoveRequested = pyqtSignal(int, int) @@ -128,8 +130,8 @@ It provides slots to show the previous and next tab and give them the input focus and it allows to have a context menu for the tabs. - @signal customTabContextMenuRequested(const QPoint & point, int index) emitted when - a context menu for a tab is requested + @signal customTabContextMenuRequested(const QPoint & point, int index) + emitted when a context menu for a tab is requested """ customTabContextMenuRequested = pyqtSignal(QPoint, int) @@ -188,7 +190,8 @@ def switchTab(self): """ - Public slot used to switch between the current and the previous current tab. + Public slot used to switch between the current and the previous + current tab. """ if self.__lastCurrentIndex == -1 or self.__currentIndex == -1: return @@ -242,7 +245,8 @@ for index in range(_tabbar.count()): rect = _tabbar.tabRect(index) if rect.contains(point): - self.customTabContextMenuRequested.emit(_tabbar.mapToParent(point), index) + self.customTabContextMenuRequested.emit( + _tabbar.mapToParent(point), index) return self.customTabContextMenuRequested.emit(_tabbar.mapToParent(point), -1) @@ -294,7 +298,8 @@ @return free side (QTabBar.ButtonPosition) """ - side = self.__tabBar.style().styleHint(QStyle.SH_TabBar_CloseButtonPosition, + side = self.__tabBar.style().styleHint( + QStyle.SH_TabBar_CloseButtonPosition, None, None, None) if side == QTabBar.LeftSide: side = QTabBar.RightSide @@ -336,7 +341,7 @@ @param index tab index (integer) """ if index == -1: - return None + return if hasattr(self.__tabBar, 'tabButton'): side = self.__freeSide()