给定这段代码,我得到:“对'QScriptEngine::QScriptEngine()的 undefined reference ”

#include <QtScript/QScriptEngine>

...

QScriptEngine e;

/* Commented out to understand the instantiation error first
e.globalObject().setProperty("t", 123);

bool result = e.evaluate("(t>=2 && t<5) || (t<1)").toBool();
*/

最佳答案

您是否在专业人士中声明了脚本?

 QT += script

10-08 18:11