where to set the font of a qdialog in QT?

Viewed 307

am creating a tool with QT creator, that should run on linux only

now i am setting the font for my whole app, this is how:

QApplication myApplication(argc, argv);

auto id{QFontDatabase::addApplicationFont(":/someFont.ttf")};
QString family{QFontDatabase::applicationFontFamilies(id).at(0)};
QFont myFont(family);
myApplication.setFont(myFont);

however, am not able until now to set the font taking effect on the window title, message boxes or custom dialogs...

is this not supported at all because of the windows manager??

enter image description here

enter image description here

enter image description here

1 Answers

If your question concerns the font associated to the title, i do not think there is a way to change it because it is managed by the Window Manager according to this and this and also here

May be a resource to try to draw the window title bar in QT can be found here, which I tried but it is a little of a hack where you hide the real title bar and redraw a text over it and then you format the text using a css. Other resources but using Python (How to customize title bar and window of desktop application)

Related