Results 1 to 11 of 11

Thread: Is it possible to move main menubar down?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Is it possible to move main menubar down?

    Did you try simply using QMainWindow::setMenuWidget() and passing a complex widget composed of your custom data and a QMenuBar laid out vertically?

    Qt Code:
    1. +-------------------+
    2. |QWidget w. v-layout|
    3. | +---------------+ |
    4. | | CUSTOM WIDGET | |
    5. | +---------------+ |
    6. | | QMenuBar | |
    7. | +---------------+ |
    8. +-------------------+
    To copy to clipboard, switch view to plain text mode 

    Edit: Note that it's available since Qt4.2. In earlier versions you have to stick with mangling with the layout directly.

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

    gfunk (30th August 2006)

  3. #2
    Join Date
    Apr 2006
    Location
    San Francisco, CA
    Posts
    186
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    55
    Thanked 12 Times in 11 Posts

    Default Re: Is it possible to move main menubar down?

    Oh wow! I was using 4.1 and had no idea they added that to 4.2. Thanks, I will have to check that out.
    Software Engineer



  4. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Is it possible to move main menubar down?

    This should do the trick in Qt 4.1:
    Qt Code:
    1. menuBar()->setParent(statusBar());
    To copy to clipboard, switch view to plain text mode 
    I can't assure it won't break something but it's worth try..
    J-P Nurmi

  5. #4
    Join Date
    Apr 2006
    Location
    San Francisco, CA
    Posts
    186
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    55
    Thanked 12 Times in 11 Posts

    Default Re: Is it possible to move main menubar down?

    Quote Originally Posted by jpn
    This should do the trick in Qt 4.1:
    Qt Code:
    1. menuBar()->setParent(statusBar());
    To copy to clipboard, switch view to plain text mode 
    Interesting. I tried it and noticed that it could make the menubar take up the window space of any widget that I called setParent() on. Unfortunately, the menubar QAction's can't pop up any dialogs, ending up in crash. Ah well, was definitely worth the try.
    Software Engineer



Similar Threads

  1. Replies: 5
    Last Post: 4th August 2006, 23:44
  2. Move child widget along with the parent widget
    By sreedhar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2006, 12:00
  3. Replies: 3
    Last Post: 31st March 2006, 18:38
  4. Main window
    By Michiel in forum Qt Tools
    Replies: 1
    Last Post: 20th March 2006, 23:54
  5. While statement inside the main loop
    By OnionRingOfDoom in forum Qt Programming
    Replies: 4
    Last Post: 8th February 2006, 18:17

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.