From bb16ae7323c21a31a0f21546ed35d5ea9278d59a Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Tue, 19 Sep 2017 11:59:56 +0200 Subject: [PATCH] Wizards: let the page use wizard values For example it will be used to get the wizard directory to show icons in fields later. Change-Id: I6a243a67a89e4a0133550a61b870d771147667f1 Reviewed-by: Tobias Hunger --- .../projectexplorer/jsonwizard/jsonfieldpage.cpp | 10 ++++++++++ src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp index 1ed9122f33e..a207e1863ca 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp @@ -267,6 +267,16 @@ bool JsonFieldPage::Field::hasSpan() return d->m_hasSpan; } +QVariant JsonFieldPage::value(const QString &key) +{ + QVariant v = property(key.toUtf8()); + if (v.isValid()) + return v; + auto w = qobject_cast(wizard()); + QTC_ASSERT(w, return QVariant()); + return w->value(key); +} + QWidget *JsonFieldPage::Field::widget() const { return d->m_widget; diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h index 62c3556996e..b9eb6692a14 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.h @@ -125,6 +125,8 @@ public: Utils::MacroExpander *expander(); + QVariant value(const QString &key); + private: static QHash m_factories;