Results 1 to 2 of 2

Thread: Menu bar on Windows

  1. #1
    Join Date
    Oct 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Menu bar on Windows

    Using a QMenuBar on a QMainWindow, the menu bar always shows up white, but in all other Windows applications it shows up as the normal window background color. I know I can achieve the effect by using a stylesheet (background-color: transparent), but is this the only way? It seems strange considering that this is normally default for a windows app.

  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: Menu bar on Windows

    try to use something like this:
    Qt Code:
    1. ...
    2. QApplication::setPalette(QApplication::style()->standardPalette());
    3. ...
    To copy to clipboard, switch view to plain text mode 
    but there is note in Qt Assistant
    Note: Some styles do not use the palette for all drawing, for instance, if they make use of native theme engines. This is the case for the Windows XP, Windows Vista, and Mac OS X styles.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Replies: 0
    Last Post: 29th July 2009, 19:27
  2. Qt Jambi, deploying app on Mac & Windows fails
    By ChrisColon in forum Installation and Deployment
    Replies: 2
    Last Post: 16th February 2009, 22:05
  3. Replies: 5
    Last Post: 15th January 2009, 09:03
  4. Replies: 2
    Last Post: 2nd April 2008, 17:28
  5. problem with menu entries for mdi windows
    By y.shan in forum Qt Programming
    Replies: 3
    Last Post: 18th September 2007, 07:48

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.