summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qs60style.h
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-04-30 09:26:14 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-04-30 09:26:14 (GMT)
commit4b1137345a0bbfedc348b020ad0ad6e5720eb6d1 (patch)
tree5b3d5981f01dd14ce414a286d0e3beb2edfd70aa /src/gui/styles/qs60style.h
parent9b091d474a0584ea5aa271d466833cfb24e9a5da (diff)
downloadQt-4b1137345a0bbfedc348b020ad0ad6e5720eb6d1.zip
Qt-4b1137345a0bbfedc348b020ad0ad6e5720eb6d1.tar.gz
Qt-4b1137345a0bbfedc348b020ad0ad6e5720eb6d1.tar.bz2
Avoid overwriting a user set palette.
The polish(QWidget*) function is called the first time a widget is shown and therefore setting the widget's palette in this function will overwrite the user set palette if one is specified before show() is called. The solution is to break this into two parts, the first part sets the global palette in polish(QApplication*) and this is the part of the palette that is independent of widget. The second part involves adding the widget specific palettes using the QApplication:: setPalette() function that takes a classname and this is done in the polish(QWidget*) function.
Diffstat (limited to 'src/gui/styles/qs60style.h')
-rw-r--r--src/gui/styles/qs60style.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h
index 253eb61..945e182 100644
--- a/src/gui/styles/qs60style.h
+++ b/src/gui/styles/qs60style.h
@@ -45,6 +45,8 @@ public:
QRect subElementRect(SubElement element, const QStyleOption *opt, const QWidget *widget = 0) const;
void polish(QWidget *widget);
void unpolish(QWidget *widget);
+ void polish(QApplication *application);
+ void unpolish(QApplication *application);
void setStyleProperty(const char *name, const QVariant &value);
QVariant styleProperty(const char *name) const;
@@ -69,6 +71,7 @@ protected slots:
private:
Q_DISABLE_COPY(QS60Style)
friend class QStyleFactory;
+ QPalette originalPalette;
};
#endif // QT_NO_STYLE_S60