Results 1 to 6 of 6

Thread: QDockWidget: Check tabified visibility?

  1. #1
    Join Date
    Apr 2008
    Posts
    39
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QDockWidget: Check tabified visibility?

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QDockWidget: Check tabified visibility?


  3. #3
    Join Date
    Apr 2008
    Location
    Russia, Moscow
    Posts
    86
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4

    Default Re: QDockWidget: Check tabified visibility?

    You can use something like this

  4. #4
    Join Date
    Apr 2008
    Posts
    39
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDockWidget: Check tabified visibility?

    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

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QDockWidget: Check tabified visibility?

    Quote Originally Posted by youkai View Post
    "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...
    Then I don't get you. What exactly do you want achieve?
    Qt Code:
    1. QDockWidget *myDock = //...
    2. if (tabifiedDockWidgets(myDock).isEmpty())
    3. // myDock is not tabbed
    4. else
    5. // myDock is tabbed
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Apr 2008
    Posts
    39
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDockWidget: Check tabified visibility?

    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:

    Qt Code:
    1. ...
    2. restoreState(settings.value("windowState").toByteArray());
    3.  
    4. toolBtn1->setChecked(dock1->isVisible() || !tabifiedDockWidgets(dock1).isEmpty());
    5. toolBtn2->setChecked(dock2->isVisible() || !tabifiedDockWidgets(dock2).isEmpty());
    6. toolBtn3->setChecked(dock3->isVisible() || !tabifiedDockWidgets(dock3).isEmpty());
    7. ...
    To copy to clipboard, switch view to plain text mode 

    Wow! The solution is quite simple. I have no idea why I didn't get that by myself.
    Last edited by youkai; 19th July 2009 at 09:50.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.