![]() |
2010-09-21
, 17:10
|
|
Posts: 2,853 |
Thanked: 968 times |
Joined on Nov 2005
|
#2
|
![]() |
2010-09-21
, 17:40
|
Posts: 47 |
Thanked: 41 times |
Joined on Jan 2010
@ Finland
|
#3
|
![]() |
2010-09-21
, 17:48
|
|
Posts: 2,853 |
Thanked: 968 times |
Joined on Nov 2005
|
#4
|
![]() |
2010-09-23
, 19:08
|
Posts: 47 |
Thanked: 41 times |
Joined on Jan 2010
@ Finland
|
#5
|
Well, individual tabs are just QWidgets, and any QWidget has a setVisible() method, so I'd have thought you could hide/show them independently. But admittedly I haven't tried :-)
class MainWindow(QtGui.QMainWindow): def __init__(self): # ... # Creating tabs and using tab widget as a Central widget self.tabs = QtGui.QTabWidget() self.tabs.TabShape(QtGui.QTabWidget.Rounded) self.tabs.addTab(self.basicMode(), "Basic") # index = 0 self.tabs.addTab(self.bulbMode(), "Bulb") # index = 1 self.tabs.addTab(self.timedMode(), "Timed") # index = 2 self.tabs.addTab(self.viewerMode(), "Viewer") # index = 3 self.tabs.addTab(self.systemMode(), "System") # index = 4 self.setCentralWidget(self.tabs) #... self.tabVisibility() #... def tabVisibility(self): count = self.tabs.count() # Number of tabs, used for failsafe! if USEFULLSCREEN != True and count == 5: # Removing systemMode if not fullscreen self.tabs.removeTab(count-1) if CURRENT_REMOTETYPE == "Olympus_RM-1" and USEFULLSCREEN == True and count < 5: # Includes Viewer tab, only if it is not there! self.tabs.removeTab((count-1)) self.tabs.addTab(self.viewerMode(), "Viewer") self.tabs.addTab(self.systemMode(), "System") elif CURRENT_REMOTETYPE == "Olympus_RM-1" and USEFULLSCREEN != True and count == 3: # Includes Viewer tab, only if it is not there! self.tabs.addTab(self.viewerMode(), "Viewer") elif CURRENT_REMOTETYPE != "Olympus_RM-1" and count == 5: self.tabs.removeTab(3) def settingsDialog(self): #... def setSettings(self): #... self.tabVisibility() # Handling visibility of tabs settings.sync() self.dialog.accept()
The Following User Says Thank You to Yabba For This Useful Post: | ||
My code looks like this:
I know the solution is probably something very basic I just can't get it by myself.