Important: Please read the Qt Code of Conduct -

QMainWindow Titile Background Color or Opacity

  • ![alt text](image url)0_1529933437745_screen.png

    How do I make the title bar to transparent or change it to any color? It look awkward with a white background.

  • Moderators

    @Ongsk Title bar decorations are managed by your window manager. You can change them (at a user level only) by changing your theme. This applies to osx, linux, and windows.

    If you want to force a specific color then you could make a window with a custom title bar and draw it however you want. Things like Chrome do this. Then they have an option to "use system title bar and borders".

    IMO, unless you are making a fully custom window like a video game launcher, or splash screen, or something like that you should let the window manager decorate the window. People customize their WMs to look how they like and standard looks are a foundation of GUI development.

    Here's a post from @mrjj that shows you how to do it in windows with native calls (Qt doesn't have a call for it) in case you insist on forcing a color on your users.
    Keep in mind that will be for windows only so if you compile for linux or osx it will not work.

Log in to reply