diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 7397312820..2edee51989 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -686,9 +686,11 @@ static CTFontUIFontType fontTypeFromTheme(QPlatformTheme::Font f) return kCTFontUIFontWindowTitle; case QPlatformTheme::MdiSubWindowTitleFont: - case QPlatformTheme::DockWidgetTitleFont: return kCTFontUIFontSystem; + case QPlatformTheme::DockWidgetTitleFont: + return kCTFontUIFontSmallSystem; + case QPlatformTheme::PushButtonFont: return kCTFontUIFontPushButton; diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index ac76217ece..e17c2c1f4c 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -653,6 +653,8 @@ void QDockWidgetPrivate::init() QObject::connect(button, SIGNAL(clicked()), q, SLOT(close())); layout->setWidgetForRole(QDockWidgetLayout::CloseButton, button); + font = QApplication::font("QDockWidgetTitle"); + #ifndef QT_NO_ACTION toggleViewAction = new QAction(q); toggleViewAction->setCheckable(true); @@ -685,6 +687,7 @@ void QDockWidget::initStyleOption(QStyleOptionDockWidget *option) const // If we are in a floating tab, init from the parent because the attributes and the geometry // of the title bar should be taken from the floating window. option->initFrom(floatingTab && !isFloating() ? parentWidget() : this); + option->fontMetrics = QFontMetrics(d->font); option->rect = dwlayout->titleArea(); option->title = d->fixedWindowTitle; option->closable = hasFeature(this, QDockWidget::DockWidgetClosable); @@ -1481,6 +1484,7 @@ void QDockWidget::paintEvent(QPaintEvent *event) // the title may wish to extend out to all sides (eg. Vista style) QStyleOptionDockWidget titleOpt; initStyleOption(&titleOpt); + p.setFont(d_func()->font); p.drawControl(QStyle::CE_DockWidgetTitle, titleOpt); } } diff --git a/src/widgets/widgets/qdockwidget_p.h b/src/widgets/widgets/qdockwidget_p.h index e35fd17fc2..766e4ed161 100644 --- a/src/widgets/widgets/qdockwidget_p.h +++ b/src/widgets/widgets/qdockwidget_p.h @@ -99,6 +99,8 @@ public: QDockWidget::DockWidgetFeatures features; Qt::DockWidgetAreas allowedAreas; + QFont font; + #ifndef QT_NO_ACTION QAction *toggleViewAction; #endif