diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2012-11-19 14:57:11 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-20 14:13:07 +0100 |
commit | e671110a107358451bc84564cb80d27af8dfd8b2 (patch) | |
tree | e60eec24297dc3c2dffca7d9191daca2cd1ca1cf | |
parent | 9a6367a72aec4089cf00d62a4c93bc31b68af459 (diff) |
Handle Qt::WA_MacSmallSize in QApplication::font(const QWidget *).
Task-number: QTBUG-27669
Task-number: QTBUG-27665
Change-Id: Id7eb8092076a57a755a53d1eb5c46d706756ca81
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index d62b8ef146..ae426fd6f6 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<QByteArray, QFont>::ConstIterator it = hash->constFind(widget->metaObject()->className()); if (it != hash->constEnd()) |