D
D
drew_dru2015-01-07 20:25:39
Qt
drew_dru, 2015-01-07 20:25:39

How to replace QtScript in Qt5?

The program used the user function values ​​at some point for further calculations. QScript was used for this:

double function(double x, QString str)
{
    QScriptEngine engine;
    engine.globalObject().setProperty("x", x);
    return engine.evaluate(str).toNumber();
}

Using Qt Creator version 3.3.0 with Qt 5.4.0, when trying to include a script in a *.pro file
QT += script
, an error occurs:
Project ERROR: Unknown module(s) in QT: script

I searched on the Internet what the problem was and found out that Qscript is no longer supported.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel, 2015-03-28
@drew_dru

QJSEngine from Qt QML module.

H
Harrix, 2015-12-01
@Harrix

QtScript is supported and Qt won't let go of such a powerful tool.
blog.harrix.org/?p=1787

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question