QMainWindow Titile Background Color or Opacity
-
@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. https://forum.qt.io/topic/85837/change-window-title-bar-color-in-windows
Keep in mind that will be for windows only so if you compile for linux or osx it will not work.