PDA

View Full Version : Selecting tabbed QDockwidgets



trskel
25th September 2007, 16:18
Hi,
I have several QDockWidgets tabbified in a QDockArea. I want to select one of them as the visible tab, but I don't find a way to do it programatically. Is there any way to do it? (its probably right under my nose but I cannot see it :confused:).
It would be easy to do with QTabBar::setCurrentIndex(). Is there a way to obtain the QTabBar of a QDockArea?

Thanks

wysota
25th September 2007, 16:40
Did you try QMainWindow::tabifyDockWidget?

marcel
25th September 2007, 16:49
From what he says the docks are already tabbed. He just wants to select one of them programatically.

Since you cannot access the docks tab widget, I suggest using QDockWindow::activateWindow(). Not sure if it works.

wysota
25th September 2007, 17:22
From what he says the docks are already tabbed. He just wants to select one of them programatically.
Yes, I know. But nobody said this method won't work for tabbed dock widgets.


Since you cannot access the docks tab widget, I suggest using QDockWindow::activateWindow(). Not sure if it works.

Or QWidget::raise().

A stupid but working solution is to detabify the docs and tabify it back again.