QComboBox: Set the proper font after a MacSizeChange event

Change-Id: I5c90817e52a3e87d9b06b2bb670d69a6953efd47
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
This commit is contained in:
Gabriel de Dietrich 2014-04-03 17:50:42 +02:00 committed by The Qt Project
parent 624df9cf7f
commit 9ee07d5544

View File

@ -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: