summaryrefslogtreecommitdiffstats
path: root/src/kernel/qapplication.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-10-30 22:41:50 -0500
committerTimothy Pearson <[email protected]>2012-10-30 22:41:50 -0500
commit69429dcfc35d449c78b346bdce536f17d926c755 (patch)
tree6c1d1015837f0e77a8e950e38a3a24ee616e598c /src/kernel/qapplication.cpp
parent22d1ab9eccc005b0497cff131593e6b9ff96e7c2 (diff)
downloadqt3-69429dcfc35d449c78b346bdce536f17d926c755.tar.gz
qt3-69429dcfc35d449c78b346bdce536f17d926c755.zip
Add new style primatives for enhanced third party style compatibility
Diffstat (limited to 'src/kernel/qapplication.cpp')
-rw-r--r--src/kernel/qapplication.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/kernel/qapplication.cpp b/src/kernel/qapplication.cpp
index 0478cf1..51aa247 100644
--- a/src/kernel/qapplication.cpp
+++ b/src/kernel/qapplication.cpp
@@ -1847,6 +1847,37 @@ QPalette QApplication::palette(const QWidget* w)
return *app_pal;
}
+QPalette QApplication::palette(QStringList objectTypeList)
+{
+#if defined(QT_CHECK_STATE)
+ if ( !qApp )
+ qWarning( "QApplication::palette: This function can only be "
+ "called after the QApplication object has been created" );
+#endif
+ if ( !app_pal ) {
+ if ( !qt_std_pal )
+ qt_create_std_palette();
+ app_pal = new QPalette( *qt_std_pal );
+ qt_fix_tooltips();
+ }
+
+ if ( (objectTypeList.count() > 0) && app_palettes ) {
+ QPalette* wp = app_palettes->find( objectTypeList[objectTypeList.count()-1] );
+ if ( wp ) {
+ return *wp;
+ }
+ QAsciiDictIterator<QPalette> it( *app_palettes );
+ const char* name;
+ while ( (name=it.currentKey()) != 0 ) {
+ if ( objectTypeList.contains(name) ) {
+ return *it.current();
+ }
+ ++it;
+ }
+ }
+ return *app_pal;
+}
+
/*!
Changes the default application palette to \a palette. If \a
informWidgets is TRUE, then existing widgets are informed about the