QDockWidget :: title (font and size need to be changed)

I have the following stylesheet for QDockWidgets in a QT application. All things mentioned in the style work except for the font. Why is the "font" not detected and how can I change the font and size of the QDockWidget header?

QDockWidget::title { font: 18pt "Roboto Lt"; background: lightgray; padding-left: 10px; padding-top: 4px; } 
+4
source share
2 answers

The font should apply to the QDockWidget itself, and not to sub-control :: title

 QDockWidget { font-family: "Roboto Lt"; font-size: 18pt; } 
+4
source

Check out the font part in the Qt Reference: http://doc.qt.digia.com/qt/stylesheet-reference.html

Maybe you should try:

 QDockWidget::title { font-family: "Roboto Lt"; font-size: 18pt; background: lightgray; padding-left: 10px; padding-top: 4px; } 
0
source

Source: https://habr.com/ru/post/1441290/


All Articles