H there.
Can someone please tell me how to set a tabbified QDockWidget to pop to the front (be the active dock)?
In the picture below, the "full" tab is selected and it's contents are visible but I want to set the "mouth" tab to the selected tab and have its contents visible.
Code:
self.dockList = []
approvedAdded = False
# add new dock widgets
for dockName in previewDict.keys():
previewList = previewDict[ dockName ]
# setup dock
dock = QDockWidget( dockName )
dock.setWidget( PreviewWidget( previewList ) )
dock.setAllowedAreas( Qt.TopDockWidgetArea )
dock.setFeatures( QDockWidget.DockWidgetMovable | QDockWidget.DockWidgetFloatable )
# add to ui
self.addDockWidget( Qt.TopDockWidgetArea , dock )
# add to list
insertIndex = len( self.dockList ) - 1
if dockName == "approved":
insertIndex = 0
approvedAdded = True
elif dockName == tfPaths.user():
if not approvedAdded:
insertIndex = 0
else:
insertIndex = 1
self.dockList.insert( insertIndex , dock )
# tabify dock widgets
if len( self.dockList ) > 1:
for index in range( 0 , len(self.dockList) - 1 ):
self.tabifyDockWidget( self.dockList[index] , self.dockList[index + 1] )
# set tab at pos [0] in list to active
if self.dockList:
print self.dockList[0].windowTitle()
self.dockList[0].raise_()
A tabified dockwidget can be set as the selected tab like this:
EDIT
Here's a runnable example based on the code in the question: