Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QDockWidget::title (Need to change the font & size)

I have following style sheet set for QDockWidgets in my QT app. All the things mentioned in the style are working except for the font. Why is "font" is not detected & how could I change the font & size of QDockWidget title ?

QDockWidget::title
{
    font: 18pt "Roboto Lt";
    background: lightgray;
    padding-left: 10px; 
    padding-top: 4px;
}
like image 863
warunanc Avatar asked Oct 22 '12 13:10

warunanc


2 Answers

Font should be applied to the QDockWidget itself, not to the sub-control ::title

QDockWidget { font-family: "Roboto Lt"; font-size: 18pt; }
like image 56
warunanc Avatar answered Nov 05 '22 10:11

warunanc


Watch 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;
}
like image 24
totymedli Avatar answered Nov 05 '22 09:11

totymedli