Qt Creator editor font size error when using custom QSS
-
Hello,
(All words are from Google Translate, I apologize for this)
I found that the scrollbar's background and handle of Qt Creator with a black theme are also black (close to black). So I searched and found this on Google:I set up the QSS file for Qt Creator as described in the link using starting parameter -stylesheet XXX.css. Here's my QSS file:
QScrollBar { background: rgb(102, 101, 101); margin: 0px 0px 0px 0px; } QScrollBar:hover { background-color:rgb(86, 86, 86); } QScrollBar::handle { background-color: rgb(174, 255, 244); } QScrollBar::handle:hover { background-color:rgb(207, 233, 229); } QScrollBar::add-line:vertical { height: 0px; background-color: rgb(65, 155, 207); subcontrol-position: bottom; subcontrol-origin: margin; } QScrollBar::sub-line:vertical { height: 0px; background-color: rgb(65, 155, 207); subcontrol-position: top; subcontrol-origin: margin; } QScrollBar::add-line:horizontal { width: 0px; background-color: rgb(65, 155, 207); subcontrol-position: right; subcontrol-origin: margin; } QScrollBar::sub-line:horizontal { width: 0px; background-color: rgb(65, 155, 207); subcontrol-position: left; subcontrol-origin: margin; }
This is indeed useful, as my scrollbar has become the following:
However, after clicking the Debug button on the left sidebar to enter the debug interface, and then clicking the "Edit" button or pressing ESC to return to the editing interface, my font scaling became very strange (and vice versa). And at this point, I used CTRL+mouse wheel to adjust the zoom, and it returned to normal.
If I don't use the parameter -stylesheet XXX.css, everything is OK (Same theme and same text editor style).
In fact, it doesn't matter whether the font scaling bug is resolved or not, I just want a prominently colored scrollbar slider. Also, I don't want to use a bright white theme as it hurts my eyes too much. Thanks.Qt Creator Version: 12.0.0, 12.0.1, 12.0.2