summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cpptoolsplugin.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-04-16 16:46:36 +0200
committerEike Ziller <eike.ziller@qt.io>2019-05-09 11:19:43 +0000
commite0d38ae4140d6101b483fde25158fc94b34a3a64 (patch)
tree9137897e6cc85c195ff76ebedc9de0d9a447a168 /src/plugins/cpptools/cpptoolsplugin.cpp
parent0c5837a1114ef526727748a0db956f0758597350 (diff)
downloadqt-creator-e0d38ae4140d6101b483fde25158fc94b34a3a64.tar.gz
Export Wizard values to JavaScript macro
Registers a new function "value('name')", available to the wizard json files, which returns the value of the variable "name" as a JavaScript object. So, variables with a string value are actual JavaScript strings, booleans are booleans, lists are lists, and dictionaries are dictionaries. The patch also makes it actually possible to assign JSON lists and dictionaries to values. This removes some hacks involving creating complex JavaScript objects through string substitution. Change-Id: I4ac6da22bc5bccc9fadee97694c2fa14d44c9307 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cpptoolsplugin.cpp')
-rw-r--r--src/plugins/cpptools/cpptoolsplugin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp
index d2ca6d5d0b..4d7599b24b 100644
--- a/src/plugins/cpptools/cpptoolsplugin.cpp
+++ b/src/plugins/cpptools/cpptoolsplugin.cpp
@@ -172,7 +172,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
d = new CppToolsPluginPrivate;
- JsExpander::registerQObjectForJs(QLatin1String("Cpp"), new CppToolsJsExtension);
+ JsExpander::registerGlobalObject<CppToolsJsExtension>("Cpp");
// Menus
ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS);