Results 1 to 3 of 3

Thread: Get List of Toolbars in QMainWindow

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Location
    St. Louis, MO
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Get List of Toolbars in QMainWindow

    Is there an equivalent function to QToolBar::actions() that would return a list of the toolbars in a QMainWindow? I don't see one in the 4.3 docs.

  2. #2
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Get List of Toolbars in QMainWindow

    Hi,

    Just an idea:
    Qt Code:
    1. QList<QToolBar *> toolbars = mainWindow.findChildren<QToolBar *>("");
    To copy to clipboard, switch view to plain text mode 

    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

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

    dimixan (16th March 2010), mbrusati (10th October 2008), Mesozoic (4th April 2014)

  4. #3
    Join Date
    Sep 2008
    Location
    St. Louis, MO
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Get List of Toolbars in QMainWindow

    Yes, that should work, though I don't think the quotes are necessary. Thank you very much.

Similar Threads

  1. Replies: 6
    Last Post: 20th August 2008, 20:21
  2. QMainWindow setCentralWidget from ui widget, Qt4
    By alan in forum Qt Programming
    Replies: 5
    Last Post: 13th May 2008, 13:00
  3. Single slot for multiple list boxes
    By Sheetal in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2008, 06:53
  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
  •  
Qt is a trademark of The Qt Company.