diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2012-10-31 18:47:07 -0500 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2012-10-31 18:47:07 -0500 |
commit | 0a232e5b3c2875e68d97be690beec7da1ccc65ba (patch) | |
tree | ec5222b67db7ba6aad8fa337d0e25153d8fe5062 /src/kernel | |
parent | 95354d1b5116fa9e96534bef9a2f65c1976d4c12 (diff) | |
parent | 289363b959ac4720ee604f1dfba54c624f0098c0 (diff) | |
download | qt3-0a232e5b3c2875e68d97be690beec7da1ccc65ba.tar.gz qt3-0a232e5b3c2875e68d97be690beec7da1ccc65ba.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/qt3
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/qapplication.cpp | 31 | ||||
-rw-r--r-- | src/kernel/qapplication.h | 1 | ||||
-rw-r--r-- | src/kernel/qstyle.h | 15 |
3 files changed, 47 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 diff --git a/src/kernel/qapplication.h b/src/kernel/qapplication.h index 39f7858..c34ff45 100644 --- a/src/kernel/qapplication.h +++ b/src/kernel/qapplication.h @@ -113,6 +113,7 @@ public: static void setGlobalMouseTracking( bool enable ); #ifndef QT_NO_PALETTE static QPalette palette( const QWidget* = 0 ); + static QPalette palette( QStringList ); static void setPalette( const QPalette &, bool informWidgets=FALSE, const char* className = 0 ); #endif diff --git a/src/kernel/qstyle.h b/src/kernel/qstyle.h index 27dbb07..341473e 100644 --- a/src/kernel/qstyle.h +++ b/src/kernel/qstyle.h @@ -458,6 +458,11 @@ public: PE_HeaderSectionMenu, + PE_PanelScrollBar, + PE_MenuItemIndicatorFrame, + PE_MenuItemIndicatorIconFrame, + PE_MenuItemIndicatorCheck, + // do not add any values below/greater this PE_CustomBase = 0xf000000 }; @@ -830,6 +835,13 @@ public: PM_MenuBarItemSpacing, PM_ToolBarItemSpacing, + PM_MenuIndicatorFrameHBorder, + PM_MenuIndicatorFrameVBorder, + PM_MenuIconIndicatorFrameHBorder, + PM_MenuIconIndicatorFrameVBorder, + + PM_ArrowSize, + // do not add any values below/greater than this PM_CustomBase = 0xf0000000 }; @@ -1029,6 +1041,9 @@ public: // bool - hide underlined accelerators uless Alt key is currently down SH_HideUnderlineAcceleratorWhenAltUp, + // int - width of menu check column + SH_MenuIndicatorColumnWidth, + // do not add any values below/greater than this SH_CustomBase = 0xf0000000 }; |