E5Gui/E5SideBar.py

branch
5_1_x
changeset 1452
c45568ff630d
parent 1448
b9c04bc0a692
child 1510
e75ecf2bd9dd
diff -r b9c04bc0a692 -r c45568ff630d E5Gui/E5SideBar.py
--- a/E5Gui/E5SideBar.py	Tue Nov 15 19:31:10 2011 +0100
+++ b/E5Gui/E5SideBar.py	Sat Nov 19 15:39:25 2011 +0100
@@ -8,7 +8,8 @@
 """
 
 from PyQt4.QtCore import QEvent, QSize, Qt, QByteArray, QDataStream, QIODevice
-from PyQt4.QtGui import QTabBar, QWidget, QStackedWidget, QBoxLayout, QToolButton, QSizePolicy
+from PyQt4.QtGui import QTabBar, QWidget, QStackedWidget, QBoxLayout, QToolButton, \
+    QSizePolicy
 
 from E5Gui.E5Application import e5App
 
@@ -196,15 +197,17 @@
         Public method to add a tab to the sidebar.
         
         @param widget reference to the widget to add (QWidget)
-        @param iconOrLabel reference to the icon or the labeltext of the tab
+        @param iconOrLabel reference to the icon or the label text of the tab
             (QIcon, string)
         @param label the labeltext of the tab (string) (only to be
             used, if the second parameter is a QIcon)
         """
         if label:
-            self.__tabBar.addTab(iconOrLabel, label)
+            index = self.__tabBar.addTab(iconOrLabel, label)
+            self.__tabBar.setTabToolTip(index, label)
         else:
-            self.__tabBar.addTab(iconOrLabel)
+            index = self.__tabBar.addTab(iconOrLabel)
+            self.__tabBar.setTabToolTip(index, iconOrLabel)
         self.__stackedWidget.addWidget(widget)
         if self.__orientation in [E5SideBar.North, E5SideBar.South]:
             self.__minSize = self.minimumSizeHint().height()
@@ -223,9 +226,11 @@
             used, if the second parameter is a QIcon)
         """
         if label:
-            self.__tabBar.insertTab(index, iconOrLabel, label)
+            index = self.__tabBar.insertTab(index, iconOrLabel, label)
+            self.__tabBar.setTabToolTip(index, label)
         else:
-            self.__tabBar.insertTab(index, iconOrLabel)
+            index = self.__tabBar.insertTab(index, iconOrLabel)
+            self.__tabBar.setTabToolTip(index, iconOrLabel)
         self.__stackedWidget.insertWidget(index, widget)
         if self.__orientation in [E5SideBar.North, E5SideBar.South]:
             self.__minSize = self.minimumSizeHint().height()

eric ide

mercurial