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>
This commit is contained in:
Eike Ziller
2019-04-16 16:46:36 +02:00
parent 0c5837a111
commit e0d38ae414
57 changed files with 891 additions and 646 deletions

View File

@@ -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);