summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-06-18 14:44:40 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-06-23 14:12:00 (GMT)
commit9205078f3b2d842735599fd74d6324a4d84bc275 (patch)
tree463912fffbb3848fbb0abf3b08f69f3be53799e5 /src/gui/kernel
parent1b059b51b6d236ace4ec8c5203873caae250cf78 (diff)
downloadQt-9205078f3b2d842735599fd74d6324a4d84bc275.zip
Qt-9205078f3b2d842735599fd74d6324a4d84bc275.tar.gz
Qt-9205078f3b2d842735599fd74d6324a4d84bc275.tar.bz2
Clean up the font hash and palette hash stuff.
These are used enough (at least on the mac) to justify them being accessible in a private header. As a bonus it "hides" the actual container being used, so we could potentially sway it out with something different. Reviewed by: Jens Bache-Wiig
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication.cpp3
-rw-r--r--src/gui/kernel/qapplication_mac.mm10
-rw-r--r--src/gui/kernel/qapplication_p.h6
3 files changed, 10 insertions, 9 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 7219fed..463d6ef 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -463,15 +463,12 @@ static inline bool isAlien(QWidget *widget)
// ######## move to QApplicationPrivate
// Default application palettes and fonts (per widget type)
-
-typedef QHash<QByteArray, QPalette> PaletteHash;
Q_GLOBAL_STATIC(PaletteHash, app_palettes)
PaletteHash *qt_app_palettes_hash()
{
return app_palettes();
}
-typedef QHash<QByteArray, QFont> FontHash;
Q_GLOBAL_STATIC(FontHash, app_fonts)
FontHash *qt_app_fonts_hash()
{
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm
index ace5d1d..ca826b0 100644
--- a/src/gui/kernel/qapplication_mac.mm
+++ b/src/gui/kernel/qapplication_mac.mm
@@ -164,7 +164,6 @@ QT_BEGIN_NAMESPACE
//for qt_mac.h
QPaintDevice *qt_mac_safe_pdev = 0;
QList<QMacWindowChangeEvent*> *QMacWindowChangeEvent::change_events = 0;
-extern QHash<QByteArray, QFont> *qt_app_fonts_hash(); // qapplication.cpp
/*****************************************************************************
Internal variables and functions
@@ -527,9 +526,9 @@ void qt_mac_update_os_settings()
for(int i = 0; mac_widget_fonts[i].qt_class; i++) {
QFont fnt = qfontForThemeFont(mac_widget_fonts[i].font_key);
bool set_font = true;
- QHash<QByteArray, QFont> *hash = qt_app_fonts_hash();
+ FontHash *hash = qt_app_fonts_hash();
if (!hash->isEmpty()) {
- QHash<QByteArray, QFont>::const_iterator it
+ FontHash::const_iterator it
= hash->constFind(mac_widget_fonts[i].qt_class);
if (it != hash->constEnd())
set_font = (fnt != *it);
@@ -628,10 +627,9 @@ void QApplicationPrivate::initializeWidgetPaletteHash()
}
bool set_palette = true;
- extern QHash<QByteArray, QPalette> *qt_app_palettes_hash(); //qapplication.cpp
- QHash<QByteArray, QPalette> *phash = qt_app_palettes_hash();
+ PaletteHash *phash = qt_app_palettes_hash();
if (!phash->isEmpty()) {
- QHash<QByteArray, QPalette>::const_iterator it
+ PaletteHash::const_iterator it
= phash->constFind(mac_widget_colors[i].qt_class);
if (it != phash->constEnd())
set_palette = (pal != *it);
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index a9e5d60..95b4fe5 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -200,6 +200,12 @@ public:
{ --threadData->loopLevel; }
};
+typedef QHash<QByteArray, QFont> FontHash;
+FontHash *qt_app_fonts_hash();
+
+typedef QHash<QByteArray, QPalette> PaletteHash;
+PaletteHash *qt_app_palettes_hash();
+
class Q_GUI_EXPORT QApplicationPrivate : public QCoreApplicationPrivate
{
Q_DECLARE_PUBLIC(QApplication)