Remove Q_GLOBAL_STATIC_WITH_INITIALIZER from QtWidgets
Change-Id: Iecad85fbbfabe41c3a332be2ee0ce3a643db7731 Reviewed-on: http://codereview.qt-project.org/5025 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
This commit is contained in:
parent
0bc19b4997
commit
ceb3a071d2
@ -499,7 +499,12 @@ PaletteHash *qt_app_palettes_hash()
|
|||||||
return app_palettes();
|
return app_palettes();
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_GLOBAL_STATIC_WITH_INITIALIZER(FontHash, app_fonts, { *x = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFonts(); } )
|
FontHash::FontHash()
|
||||||
|
{
|
||||||
|
QHash<QByteArray, QFont>::operator=(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFonts());
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_GLOBAL_STATIC(FontHash, app_fonts)
|
||||||
FontHash *qt_app_fonts_hash()
|
FontHash *qt_app_fonts_hash()
|
||||||
{
|
{
|
||||||
return app_fonts();
|
return app_fonts();
|
||||||
|
@ -287,7 +287,10 @@ public:
|
|||||||
{ --threadData->loopLevel; }
|
{ --threadData->loopLevel; }
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QHash<QByteArray, QFont> FontHash;
|
struct FontHash : public QHash<QByteArray, QFont>
|
||||||
|
{
|
||||||
|
FontHash();
|
||||||
|
};
|
||||||
FontHash *qt_app_fonts_hash();
|
FontHash *qt_app_fonts_hash();
|
||||||
|
|
||||||
typedef QHash<QByteArray, QPalette> PaletteHash;
|
typedef QHash<QByteArray, QPalette> PaletteHash;
|
||||||
|
@ -107,8 +107,18 @@ QT_BEGIN_NAMESPACE
|
|||||||
static QBasicAtomicInt serialNumCounter = Q_BASIC_ATOMIC_INITIALIZER(1);
|
static QBasicAtomicInt serialNumCounter = Q_BASIC_ATOMIC_INITIALIZER(1);
|
||||||
|
|
||||||
static void qt_cleanup_icon_cache();
|
static void qt_cleanup_icon_cache();
|
||||||
typedef QCache<QString, QIcon> IconCache;
|
namespace {
|
||||||
Q_GLOBAL_STATIC_WITH_INITIALIZER(IconCache, qtIconCache, qAddPostRoutine(qt_cleanup_icon_cache))
|
struct IconCache : public QCache<QString, QIcon>
|
||||||
|
{
|
||||||
|
IconCache()
|
||||||
|
{
|
||||||
|
// ### note: won't readd if QApplication is re-created!
|
||||||
|
qAddPostRoutine(qt_cleanup_icon_cache);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_GLOBAL_STATIC(IconCache, qtIconCache)
|
||||||
|
|
||||||
static void qt_cleanup_icon_cache()
|
static void qt_cleanup_icon_cache()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user