Results 1 to 3 of 3

Thread: How do I make a menubar stick to the window in MacOSX?

  1. #1
    Join Date
    May 2006
    Location
    Stockholm, Sweden
    Posts
    81
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default How do I make a menubar stick to the window in MacOSX?

    Hi!

    I have developed a program for Linux. I want it to look as much the same as possible when run on MacOSX. The problem is that I have a widget inside the QMainWindow that should have an own menubar. Mac places this menubar on the top of the desktop window as it does with all other mac programs. This could be ok if not the other menubar was placed on top of this bar, hiding it from the user.

    So I wonder how I can make the widget menubar to stick to the widget so MacOS doesn't place the menubar on top of the desktopwindow?

    pir

  2. #2
    Join Date
    Jan 2006
    Location
    New Malden (near London)
    Posts
    32
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: How do I make a menubar stick to the window in MacOSX?

    It would be useful if you posted a screenshot of what your application looks like on Linux and what it looks like when you run it on Mac OSX. However, the Qt documentation for QMenuBar says the following:

    QMenuBar on Qt/Mac

    QMenuBar on Qt/Mac is a wrapper for using the system-wide menubar. If you have multiple menubars in one dialog the outermost menubar (normally inside a widget with widget flag Qt::Window) will be used for the system-wide menubar.
    So, if you find that your child widget menu-bars do not display in the child widgets, it may be that this feature simply does not exist in the Mac version of Qt. You may be able to reproduce it using a horizontal layout of QLabels or QToolButtons, with context menus attached to each of the widgets. If you do this on the Mac, it might be easier to do the same on Linux.

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

    pir (12th November 2006)

  4. #3
    Join Date
    May 2006
    Location
    Stockholm, Sweden
    Posts
    81
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: How do I make a menubar stick to the window in MacOSX?

    Thanks! I need to test some different solutions, but it seems like your ideas works well. There seems like QToolButtons with menus will work just fine.

Similar Threads

  1. cannot make a main window modal
    By Dark_Tower in forum Qt Programming
    Replies: 12
    Last Post: 23rd March 2006, 10:21

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.