+ Reply to Thread
Results 1 to 2 of 2

Thread: How to get list of DockWidgets in QMainWindow?

  1. #1
    Join Date
    Jul 2007
    Posts
    121
    Thanks
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default How to get list of DockWidgets in QMainWindow?

    There is a list of tabbified widgets that I can get from mainwindow, but how can I get a list of all dockwidgets in the mainwindow?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get list of DockWidgets in QMainWindow?

    try to use QObject::findChildren, i.e. in your case a code in a main window should look like:
    Qt Code:
    1. ...
    2. QList<QDockWidget *> dockWidgets = findChildren<QDockWidget *>();
    3. ...
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. The following 2 users say thank you to spirit for this useful post:

    AlekseyK (16th May 2016), QPlace (27th July 2009)

+ Reply to Thread

Similar Threads

  1. Replies: 2
    Last Post: 23rd March 2009, 17:26
  2. QFtp hidden files/folder's list
    By jay in forum Qt Programming
    Replies: 1
    Last Post: 26th December 2008, 12:12
  3. Get List of Toolbars in QMainWindow
    By mbrusati in forum Qt Programming
    Replies: 2
    Last Post: 10th October 2008, 18:19
  4. QMainWindow child of a QDialog
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2008, 07:16
  5. Replies: 1
    Last Post: 22nd October 2007, 02:04

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