From e671110a107358451bc84564cb80d27af8dfd8b2 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 19 Nov 2012 14:57:11 +0100 Subject: [PATCH] Handle Qt::WA_MacSmallSize in QApplication::font(const QWidget *). Task-number: QTBUG-27669 Task-number: QTBUG-27665 Change-Id: Id7eb8092076a57a755a53d1eb5c46d706756ca81 Reviewed-by: hjk Reviewed-by: Gabriel de Dietrich --- src/widgets/kernel/qapplication.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index d62b8ef..ae426fd 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1512,6 +1512,14 @@ QFont QApplication::font(const QWidget *widget) FontHash *hash = app_fonts(); if (widget && hash && hash->size()) { +#ifdef Q_OS_MAC + // short circuit for small and mini controls + if (widget->testAttribute(Qt::WA_MacSmallSize)) { + return hash->value(QByteArrayLiteral("QSmallFont")); + } else if (widget->testAttribute(Qt::WA_MacMiniSize)) { + return hash->value(QByteArrayLiteral("QMiniFont")); + } +#endif QHash::ConstIterator it = hash->constFind(widget->metaObject()->className()); if (it != hash->constEnd()) -- 2.7.4