Change title font of Qt Main Window
I am trying to change the title font of the Qt Main window with "Segoe UI".
I tried changing style sheet and Font etc, but I couldn't make it.
Actually, I could do for labels, but not for the title.
Any comments would be really appreciated.
Maybe what you need is "setWindowTitle();"
The title bar is handled by the window manager not by Qt so it's not something you can modify within the app by default.
Thanks a lot for your comment. :)
Then, there is nothing I can do in Qt for changing the title bar font? Only way is to use the windows manager somehow?
Hi @sehnkim ,
AFAIK, Some one can't force the title bar font from the Qt as Mr. @SGaist said . It's completely from the desktop settings. You can change this from the Desktop settings . if your are really worried about the font size. But the problem is. the desktop setting will be applicable to all windows on Windows.
This post is deleted!
About drawing Title bar or borders:
This is called decorations and is beyond Qts control. As already stated it's
not really possible in any platform neutral way.
So the only solutions is to
1: make a fake windows widget and draw caption and implement dragging etc.
This is a road of pain as if to be used as a Mainwindow it will show some of its fake nature in
various aspects of the OS.
2: use native SDK
This covers it ok and also discuss Win native api calls to use to make possible.
Note that this will ofc not work on linux etc.
May I ask you one follow-up question?
As shown in the attached picture, I need to change the color of the title bar (refer to the green arrow) and the color of the border line (refer to the red arrow) of the main window.
I am not sure if I can change them or not. Any comments would be really appreciated.
Thanks a lot.
You might be able to do that with some native API on Windows but I haven't tested them. This article might help you get further