Change title font of Qt Main Window
-
Hello experts.
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.
Thanks. -
Hi,
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.
-
Hi,
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.
-
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.
-
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.
-
-
@sehnkim
Hi
sadly dragging images to forum post is bugged. we cant see the image.
Please use external site such as postimage.org (or what u prefer)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.
https://forum.qt.io/topic/3258/how-to-draw-to-the-windows-title-bar-with-qt-is-this-possible
Note that this will ofc not work on linux etc. -
Thank you so much @Ni.Sumi and @SGaist
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
-
Hi,
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.
@SGaist so we can't customize the title bar of the application window of QML?
-
@SGaist so we can't customize the title bar of the application window of QML?
@Vijaykarthikeyan Qt does not manage window decoration. That's the OS that does it.
-
@SGaist so we can't customize the title bar of the application window of QML?
@Vijaykarthikeyan Perhaps this could be useful:
-
@Vijaykarthikeyan Perhaps this could be useful:
@Abderrahmene_Rayene thank you