Hi.
Obviously, a dock widget can have different states when it is visible:
- floating
- docked
- tabified
Unfortunately I see no possibility to check the visibility if the dock widget is tabified. Any ideas?
Bye
Printable View
Hi.
Obviously, a dock widget can have different states when it is visible:
- floating
- docked
- tabified
Unfortunately I see no possibility to check the visibility if the dock widget is tabified. Any ideas?
Bye
Hi, see QMainWindow::tabifiedDockWidgets().
You can use something like this
The trick with "visibilityChanged" does not work, because it will be emitted if you just browse the tabs. I mean, all tabified docks are visible to me.
"tabifiedDockWidgets" seems not helpful to me because it needs a parameter from which I want to know if it is tabified or not. Well I could iterate over all dock widgets and so on...
Bye
Then I don't get you. What exactly do you want achieve?Code:
if (tabifiedDockWidgets(myDock).isEmpty()) // myDock is not tabbed else // myDock is tabbed
Hi.
Ups. :) I could make two operations: check visibility and check if it is tabified with other widgets. I will try this.
I restore the main window state from the registry and want to check some toolbuttons according to the dock widgets' visibility.
Bye
Edit: Thanks! It worked. =) Here the pattern I used now:
Code:
... restoreState(settings.value("windowState").toByteArray()); toolBtn1->setChecked(dock1->isVisible() || !tabifiedDockWidgets(dock1).isEmpty()); toolBtn2->setChecked(dock2->isVisible() || !tabifiedDockWidgets(dock2).isEmpty()); toolBtn3->setChecked(dock3->isVisible() || !tabifiedDockWidgets(dock3).isEmpty()); ...
Wow! The solution is quite simple. I have no idea why I didn't get that by myself. :D