aboutsummaryrefslogtreecommitdiffstats
path: root/src/controls
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-11-30 07:28:44 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-11-30 13:46:56 +0000
commit111f54b5d8d6e43af1ee8ca8305c888d76d2f420 (patch)
treef224e9f3c8fd185ea57bfd5cfcef4627c59f8aac /src/controls
parent967efc19c0662b871a14273c4063aa35a7956935 (diff)
QQuickStyleSelector: move the style detection to constructor
Command line argument has more priority than environment variable. Change-Id: Id76f703d1d4395b6bae1a2e6be162a9250fb8dfa Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/controls')
-rw-r--r--src/controls/qquickstyleselector.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/controls/qquickstyleselector.cpp b/src/controls/qquickstyleselector.cpp
index 49cb0150..e847c1b1 100644
--- a/src/controls/qquickstyleselector.cpp
+++ b/src/controls/qquickstyleselector.cpp
@@ -44,6 +44,8 @@
#include <QtCore/QLocale>
#include <QtCore/QDebug>
+#include <QtGui/private/qguiapplication_p.h>
+
QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QQuickStyleSelectorSharedData, sharedData);
@@ -57,6 +59,11 @@ QQuickStyleSelectorPrivate::QQuickStyleSelectorPrivate()
QQuickStyleSelector::QQuickStyleSelector(QObject *parent)
: QObject(*(new QQuickStyleSelectorPrivate()), parent)
{
+ Q_D(QQuickStyleSelector);
+
+ d->style = QGuiApplicationPrivate::styleOverride;
+ if (d->style.isEmpty())
+ d->style = QString::fromLatin1(qgetenv("QT_LABS_CONTROLS_STYLE"));
}
QQuickStyleSelector::~QQuickStyleSelector()
@@ -174,12 +181,6 @@ void QQuickStyleSelectorPrivate::updateSelectors()
if (!sharedData->staticSelectors.isEmpty())
return; //Already loaded
- QLatin1Char pathSep(',');
- QStringList envSelectors = QString::fromLatin1(qgetenv("QT_LABS_CONTROLS_STYLE"))
- .split(pathSep, QString::SkipEmptyParts);
- if (envSelectors.count())
- sharedData->staticSelectors << envSelectors;
-
sharedData->staticSelectors << sharedData->preloadedStatics; //Potential for static selectors from other modules
// TODO: Update on locale changed?