diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-03-07 08:56:41 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-07 12:43:32 +0100 |
commit | 83cabda862dced9477d155c84df9440047c856cf (patch) | |
tree | 9f39de378bfeed923d2a35e433481e4da1dc0f32 /src/gui/kernel/qguiapplication.cpp | |
parent | 7439fb47cd7c5731dd1aadeaf10c46b58aa59798 (diff) |
Add fonts to QPlatformTheme.
- Remove QPlatformFontDatabase::defaultFonts() returning
a hash containing widget name ->font and the Windows
implementation.
- Add enumeration and font accessor to QPlatformTheme. The value
returned for the enumeration value overwrites the default font
of the font database.
- Implement for Windows, Mac and KDE.
- Add more Windows palettes.
Task-number: QTBUG-23686
Change-Id: I8a2abdfd216df23daa7c9630c54264cdf61295db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 095336a948..f5aea654fc 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -172,6 +172,11 @@ static inline void clearPalette() static void initFontUnlocked() { + if (!QGuiApplicationPrivate::app_font) { + if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) + if (const QFont *font = theme->font(QPlatformTheme::SystemFont)) + QGuiApplicationPrivate::app_font = new QFont(*font); + } if (!QGuiApplicationPrivate::app_font) QGuiApplicationPrivate::app_font = new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont()); |