summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@nokia.com>2010-07-22 12:42:23 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2010-11-02 13:40:57 (GMT)
commitf7048f6dc67d81ea557c43b61192aef0eafd9d98 (patch)
tree9e7efd507f496a365b55abebf90067273f9e165a /src/gui/kernel
parent7e8495a3d14bb5770fd2bdb81616d19e2e1d94af (diff)
downloadQt-f7048f6dc67d81ea557c43b61192aef0eafd9d98.zip
Qt-f7048f6dc67d81ea557c43b61192aef0eafd9d98.tar.gz
Qt-f7048f6dc67d81ea557c43b61192aef0eafd9d98.tar.bz2
Added environment variable for style overriding.
This is needed to run all autotests in a specified style by default. Reviewed By: Harald Fernengel
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 6c4004e..a4ae46b 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -1430,10 +1430,18 @@ QStyle *QApplication::style()
// Compile-time search for default style
//
QString style;
- if (!QApplicationPrivate::styleOverride.isEmpty())
+#ifdef QT_BUILD_INTERNAL
+ QString envStyle = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE"));
+#else
+ QString envStyle;
+#endif
+ if (!QApplicationPrivate::styleOverride.isEmpty()) {
style = QApplicationPrivate::styleOverride;
- else
+ } else if (!envStyle.isEmpty()) {
+ style = envStyle;
+ } else {
style = QApplicationPrivate::desktopStyleKey();
+ }
QStyle *&app_style = QApplicationPrivate::app_style;
app_style = QStyleFactory::create(style);