Results 1 to 5 of 5

Thread: Moving menu to the right menubar corner

  1. #1
    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 Moving menu to the right menubar corner

    Hi guys,

    I have some menus inserted in the menubar of my mainwindow. One menu contains totally different set of actions and I want that menu to be placed in the right corner of that menubar. How can I align a menu to be placed on the right handside of a menubar?

    Beforehand thanks!

    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

  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: Moving menu to the right menubar corner

    Have you tried adding a separator to QMenuBar instance?

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

    maverick_pol (20th March 2008)

  4. #3
    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: Moving menu to the right menubar corner

    haven't tried it yet, as I wrongly assumed that separator is used between actions. If it can be used between menus I will try it.

    Thanks.

    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

  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: Moving menu to the right menubar corner

    QMenuBar has an insertSeparator() method so I assume it can.

  6. #5
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Moving menu to the right menubar corner

    Hmmm.. insertSeparator() doesn't seem to do anything. No matter how many separators I insert before an action, my menu still looks the same. And QActions with icons won't render their icons when added to the menu bar.. Too bad, looks like I'll have to subclass.
    Last edited by pherthyl; 21st March 2008 at 05:34.

Similar Threads

  1. Move the menuBar() to the system menu
    By jlbrd in forum Qt Programming
    Replies: 3
    Last Post: 6th March 2009, 10:38

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.