Results 1 to 4 of 4

Thread: Selecting tabbed QDockwidgets

  1. #1
    Join Date
    Mar 2007
    Posts
    14
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Selecting tabbed QDockwidgets

    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 ).
    It would be easy to do with QTabBar::setCurrentIndex(). Is there a way to obtain the QTabBar of a QDockArea?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Selecting tabbed QDockwidgets


  3. #3
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Selecting tabbed QDockwidgets

    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.

  4. The following user says thank you to marcel for this useful post:

    trskel (25th September 2007)

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Selecting tabbed QDockwidgets

    Quote Originally Posted by marcel View Post
    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.

  6. The following user says thank you to wysota for this useful post:

    trskel (25th September 2007)

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.