diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-04-03 17:50:42 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-09 12:48:55 +0200 |
commit | 9ee07d5544f0194cb7dd58e4383d25a08226acde (patch) | |
tree | 50b8f0472b108ec5bc1530cd416c910d760d1aae | |
parent | 624df9cf7fcf844ae1af0e7c8e465adb164bedd0 (diff) |
QComboBox: Set the proper font after a MacSizeChange event
Change-Id: I5c90817e52a3e87d9b06b2bb670d69a6953efd47
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 1ba08bd25f..06258cb4a6 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -2834,6 +2834,18 @@ void QComboBox::changeEvent(QEvent *e) d->updateLineEditGeometry(); d->setLayoutItemMargins(QStyle::SE_ComboBoxLayoutItem); + if (e->type() == QEvent::MacSizeChange){ + QPlatformTheme::Font f = QPlatformTheme::SystemFont; + if (testAttribute(Qt::WA_MacSmallSize)) + f = QPlatformTheme::SmallFont; + else if (testAttribute(Qt::WA_MacMiniSize)) + f = QPlatformTheme::MiniFont; + if (const QFont *platformFont = QApplicationPrivate::platformTheme()->font(f)) { + QFont f = font(); + f.setPointSizeF(platformFont->pointSizeF()); + setFont(f); + } + } // ### need to update scrollers etc. as well here break; case QEvent::EnabledChange: |