5 |
5 |
6 """ |
6 """ |
7 Module implementing a sidebar class. |
7 Module implementing a sidebar class. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtCore import SIGNAL, SLOT, QEvent, QSize, Qt, QByteArray, \ |
10 from PyQt4.QtCore import QEvent, QSize, Qt, QByteArray, QDataStream, QIODevice |
11 QDataStream, QIODevice |
|
12 from PyQt4.QtGui import QTabBar, QWidget, QStackedWidget, QBoxLayout, QToolButton |
11 from PyQt4.QtGui import QTabBar, QWidget, QStackedWidget, QBoxLayout, QToolButton |
13 |
12 |
14 from E5Gui.E5Application import e5App |
13 from E5Gui.E5Application import e5App |
15 |
14 |
16 import UI.PixmapCache |
15 import UI.PixmapCache |
74 self.__orientation = E5SideBar.North |
73 self.__orientation = E5SideBar.North |
75 if orientation is None: |
74 if orientation is None: |
76 orientation = E5SideBar.North |
75 orientation = E5SideBar.North |
77 self.setOrientation(orientation) |
76 self.setOrientation(orientation) |
78 |
77 |
79 self.connect(self.__tabBar, SIGNAL("currentChanged(int)"), |
78 self.__tabBar.currentChanged[int].connect(self.__stackedWidget.setCurrentIndex) |
80 self.__stackedWidget, SLOT("setCurrentIndex(int)")) |
79 e5App().focusChanged[QWidget, QWidget].connect(self.__appFocusChanged) |
81 self.connect(e5App(), SIGNAL("focusChanged(QWidget*, QWidget*)"), |
80 self.__autoHideButton.toggled[bool].connect(self.__autoHideToggled) |
82 self.__appFocusChanged) |
|
83 self.connect(self.__autoHideButton, SIGNAL("toggled(bool)"), |
|
84 self.__autoHideToggled) |
|
85 |
81 |
86 def setSplitter(self, splitter): |
82 def setSplitter(self, splitter): |
87 """ |
83 """ |
88 Public method to set the splitter managing the sidebar. |
84 Public method to set the splitter managing the sidebar. |
89 |
85 |