summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-06-21 13:28:03 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-06-21 14:22:00 +0200
commit674f4e6cfbd119093f5023234372d4c92159ade3 (patch)
tree7263bb02798a660379dad4b913fb11d358294b5f /src/widgets
parented00e3093be53923ffaacdec05f3e730d62a8064 (diff)
QApplication: clarify and unify global static usage
Explain why there are two accessor functions for the global statics, and use the global statics directly inside qapplication.cpp for consistency. Change-Id: Ibf3952052c1d0e780a8aab220a72f05af0c070a5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qapplication.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index b640808b2f..8e01cb17c5 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -426,16 +426,10 @@ bool Q_WIDGETS_EXPORT qt_tab_all_widgets()
// ######## move to QApplicationPrivate
// Default application palettes and fonts (per widget type)
Q_GLOBAL_STATIC(PaletteHash, app_palettes)
-PaletteHash *qt_app_palettes_hash()
-{
- return app_palettes();
-}
-
Q_GLOBAL_STATIC(FontHash, app_fonts)
-FontHash *qt_app_fonts_hash()
-{
- return app_fonts();
-}
+// Exported accessors for use outside of this file
+PaletteHash *qt_app_palettes_hash() { return app_palettes(); }
+FontHash *qt_app_fonts_hash() { return app_fonts(); }
QWidgetList *QApplicationPrivate::popupWidgets = 0; // has keyboard input focus
@@ -652,7 +646,7 @@ void QApplicationPrivate::initializeWidgetPaletteHash()
QPlatformTheme *platformTheme = QGuiApplicationPrivate::platformTheme();
if (!platformTheme)
return;
- qt_app_palettes_hash()->clear();
+ app_palettes()->clear();
setPossiblePalette(platformTheme->palette(QPlatformTheme::ToolButtonPalette), "QToolButton");
setPossiblePalette(platformTheme->palette(QPlatformTheme::ButtonPalette), "QAbstractButton");
@@ -676,7 +670,7 @@ void QApplicationPrivate::initializeWidgetFontHash()
const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme();
if (!theme)
return;
- FontHash *fontHash = qt_app_fonts_hash();
+ FontHash *fontHash = app_fonts();
fontHash->clear();
if (const QFont *font = theme->font(QPlatformTheme::MenuFont))