How do I change the overall font size of QtCreator?
-
I installed the latest Qt from http://qt-project.org/downloads on my Linux Mint 15 machine. Qt Creator is 2.8.1, Qt itself is 5.1.1. I know I can increase the font size of the editor window from Tools->Options->Editor. I want to increase the font size of the menus, dialog boxes, and everything else in QtCreator. Googling suggests I should be able to use qtconfig to change Qt's system-wide settings, but the installation contains no such tool (does Qt5 even have it? all online references I found refer to qt4 or qt3's qtconfig). Please help, right now the IDE is completely unusable right now because of my limited vision.
-
Creator should pick up the system settings for font sizes. So if the other applications have a font big enough for your eye sight, then so should creator.
Please file a bug report at https://bugreports.qt-project.org/ if this does not work for you.
-
bq. Creator should pick up the system settings for font sizes. So if the other applications have a font big enough for your eye sight, then so should creator.
Qt applications (QtCreator and all the other) fail miserably to do this on Windows 7. Why old Tahoma with very small size is used?
There is a bug report already: https://bugreports.qt-project.org/browse/QTBUG-19309 But still not fixed!
Eclipse and MSVC don't have this problem: exactly the same font and size is used there. How can I change QtCreator application font?
-
A style sheet can be used to change the fonts in most places.
Here is an example:
@
QMainWindow
{
background: #656565;
}QWidget
{
font: 11pt "Times New Roman";
}QPlainTextEdit
{
font: 11pt "Consolas";
}
@The QMainWindow section has nothing to do with fonts, it restores the background color to a few areas which are otherwise lost. Delete this part to see what I mean. The color #656565 is a fair match for the default set in 'Options -> Environment'. If another color is being used change the style sheet to suit.
QWidget sets the font throughout Creator, with some exceptions. If you want bold it can be done like this:
@
QWidget
{
font: bold 11pt "Times New Roman";
}
@QPlainTextEdit is for the code editor, assuming a different font is used there. If not, this part can be deleted. Effects such as bold are not recognized by the QPlainTextEdit widget.
Copy the example above into a text editor and change the font sizes and families to the ones you wish to use. Of course, the chosen families must be on your system. Save the file as fonts.css or use another name if you prefer, but the extension must be css.
From this point on I’m talking Windows 8, so appropriate adjustments need to be made to suit other operating systems. The ‘fonts.css’ file can be placed in any suitable location, perhaps with qtcreator.exe, but my suggestion would be to put it somewhere in Documents so it will not get lost when upgrading Qt.
Then modify your desktop shortcut to Qt Creator to point to the place chosen for the file, by adding to the end of the ‘Target’:
-stylesheet your\path\to\fonts.css
Here’s how mine looks (all on one line):
C:\Qt64\qt-creator-3.0.0-x64\bin\qtcreator.exe -stylesheet D:\Documents\Qt\Customise\fonts.css
A few additional points:
The Mode Selector font size is not changed although the family is.
The Help font is not changed, but it can of course be zoomed using 'Ctrl' and the mouse wheel, at least on my system.
You need to set your code editor colors before using the style sheet. If you want to make changes later run Creator without the -stylesheet parameter.
This isn't the perfect solution as it involves some compromises but I hope it helps.
-
I should have mentioned the font size can be changed using the system font, like this:
@
QWidget
{
font: 11pt;
}
@Bold would be:
@
QWidget
{
font: bold 11pt;
}
@No need to include the font family unless you want to change it, at least on my Windows system.
-
Thanks for the tip. Can someone here help me use a stylesheet this way to only change the Creator console output and application output panes, without changing anything else?
I know you can use stylesheets to target a widget with a certain name. For example:
QCheckBox
{
spacing: 4px; //affects all checkboxes
}QCheckBox#checkBox_4
{
spacing: 14px; //only changes one with that objectName
}I've tried looking at Creator's source, but I'm not skilled enough to navigate a project of that size and complexity.