diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-30 07:45:48 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-11-30 13:46:58 +0000 |
commit | 3b9dc5c6e728872af4328e156a68b51931c1055f (patch) | |
tree | 6716e48fd315a1aff8dce328f4e712b897c39f93 /src/controls | |
parent | 111f54b5d8d6e43af1ee8ca8305c888d76d2f420 (diff) |
QQuickStyleSelector: add instance() static method
Change-Id: Id2a412175f9907651d8e4e0fdacb624ac2444552
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/controls')
-rw-r--r-- | src/controls/qquickstyleselector.cpp | 8 | ||||
-rw-r--r-- | src/controls/qquickstyleselector_p.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/controls/qquickstyleselector.cpp b/src/controls/qquickstyleselector.cpp index e847c1b1..d72de632 100644 --- a/src/controls/qquickstyleselector.cpp +++ b/src/controls/qquickstyleselector.cpp @@ -176,6 +176,14 @@ QUrl QQuickStyleSelector::baseUrl() const return d->baseUrl; } +QQuickStyleSelector *QQuickStyleSelector::instance(QObject *parent) +{ + QPointer<QQuickStyleSelector> self; + if (!self) + self = new QQuickStyleSelector(parent); + return self; +} + void QQuickStyleSelectorPrivate::updateSelectors() { if (!sharedData->staticSelectors.isEmpty()) diff --git a/src/controls/qquickstyleselector_p.h b/src/controls/qquickstyleselector_p.h index 89cfed71..567f592a 100644 --- a/src/controls/qquickstyleselector_p.h +++ b/src/controls/qquickstyleselector_p.h @@ -69,6 +69,8 @@ public: void setBaseUrl(const QUrl &base); QUrl baseUrl() const; + static QQuickStyleSelector *instance(QObject *parent = Q_NULLPTR); + private: QUrl select(const QUrl &filePath) const; |