From 674f4e6cfbd119093f5023234372d4c92159ade3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 21 Jun 2019 13:28:03 +0200 Subject: 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 --- src/widgets/kernel/qapplication.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/widgets') 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)) -- cgit v1.2.3