LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Can you replace font used by Qt app (the one that ships with its own libraries) (https://www.linuxquestions.org/questions/linux-desktop-74/can-you-replace-font-used-by-qt-app-the-one-that-ships-with-its-own-libraries-4175595746/)

Przemas 12-19-2016 02:34 PM

Can you replace font used by Qt app (the one that ships with its own libraries)
 
1 Attachment(s)
I've been wondering whether there's a way to set up Linux so it would swap font in a Qt4 app for other, specified one? Especially considering the app ships with its own libraries (I see quite a bit libQt*.so files in the app folder).
I'm looking for a way to do it as the app I use for work has a font that is not very cool to work with on higher resolution screen, and tweaking dpi is not ideal too - a slightly "fatter" font would be better).

problemguy 12-20-2016 07:46 AM

I'm not sure what you mean, but you can set the default font of an application with QApplication::setFont() in Qt 4.8 and QGuiApplication::setFont() in Qt 5.7. Before you can do that, you need to have an instance of either QApplication or QGuiApplication, depending on your Qt version.

More information about the QFont class:
http://doc.qt.io/qt-4.8/qfont.html
http://doc.qt.io/qt-5/qfont.html


All times are GMT -5. The time now is 09:06 PM.