diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | src/script/api/qscriptengine.h | 2 | ||||
-rw-r--r-- | src/script/api/qscriptextensionplugin.h | 2 | ||||
-rw-r--r-- | src/script/api/qscriptstring.h | 2 | ||||
-rw-r--r-- | src/scripttools/debugging/qscriptenginedebugger.h | 6 | ||||
-rw-r--r-- | tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp | 18 |
6 files changed, 17 insertions, 15 deletions
diff --git a/.qmake.conf b/.qmake.conf index 87e921f..675669a 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -3,4 +3,4 @@ android|boot2qt: CONFIG -= headersclean DEFINES += QT_NO_FOREACH -MODULE_VERSION = 5.10.0 +MODULE_VERSION = 5.11.0 diff --git a/src/script/api/qscriptengine.h b/src/script/api/qscriptengine.h index 80a2869..c7bda46 100644 --- a/src/script/api/qscriptengine.h +++ b/src/script/api/qscriptengine.h @@ -264,7 +264,7 @@ protected: QScriptEngine(QScriptEnginePrivate &dd); #else - explicit QScriptEngine(QScriptEnginePrivate &dd, QObject *parent = Q_NULLPTR); + explicit QScriptEngine(QScriptEnginePrivate &dd, QObject *parent = nullptr); #endif private: diff --git a/src/script/api/qscriptextensionplugin.h b/src/script/api/qscriptextensionplugin.h index 8fd1618..f2e4bb8 100644 --- a/src/script/api/qscriptextensionplugin.h +++ b/src/script/api/qscriptextensionplugin.h @@ -39,7 +39,7 @@ class Q_SCRIPT_EXPORT QScriptExtensionPlugin : public QObject, Q_OBJECT Q_INTERFACES(QScriptExtensionInterface:QFactoryInterface) public: - explicit QScriptExtensionPlugin(QObject *parent = Q_NULLPTR); + explicit QScriptExtensionPlugin(QObject *parent = nullptr); ~QScriptExtensionPlugin(); virtual QStringList keys() const = 0; diff --git a/src/script/api/qscriptstring.h b/src/script/api/qscriptstring.h index eed4a1e..c538581 100644 --- a/src/script/api/qscriptstring.h +++ b/src/script/api/qscriptstring.h @@ -47,7 +47,7 @@ public: bool operator==(const QScriptString &other) const; bool operator!=(const QScriptString &other) const; - quint32 toArrayIndex(bool *ok = Q_NULLPTR) const; + quint32 toArrayIndex(bool *ok = nullptr) const; QString toString() const; operator QString() const; diff --git a/src/scripttools/debugging/qscriptenginedebugger.h b/src/scripttools/debugging/qscriptenginedebugger.h index a56a833..a20aba9 100644 --- a/src/scripttools/debugging/qscriptenginedebugger.h +++ b/src/scripttools/debugging/qscriptenginedebugger.h @@ -89,7 +89,7 @@ public: SuspendedState }; - explicit QScriptEngineDebugger(QObject *parent = Q_NULLPTR); + explicit QScriptEngineDebugger(QObject *parent = nullptr); ~QScriptEngineDebugger(); void attachTo(QScriptEngine *engine); @@ -101,8 +101,8 @@ public: #ifndef QT_NO_MAINWINDOW QMainWindow *standardWindow() const; #endif - QToolBar *createStandardToolBar(QWidget *parent = Q_NULLPTR); - QMenu *createStandardMenu(QWidget *parent = Q_NULLPTR); + QToolBar *createStandardToolBar(QWidget *parent = nullptr); + QMenu *createStandardMenu(QWidget *parent = nullptr); QWidget *widget(DebuggerWidget widget) const; QAction *action(DebuggerAction action) const; diff --git a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp index 6aef3b4..edc6ad1 100644 --- a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp +++ b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp @@ -269,9 +269,9 @@ public: { m_qtFunctionInvoked = 37; return BazPolicy; } Q_INVOKABLE MyQObject::Strategy myInvokableReturningQualifiedEnum() { m_qtFunctionInvoked = 38; return BazStrategy; } - Q_INVOKABLE QVector<int> myInvokableReturningVectorOfInt() - { m_qtFunctionInvoked = 11; return QVector<int>(); } - Q_INVOKABLE void myInvokableWithVectorOfIntArg(const QVector<int> &) + Q_INVOKABLE QVector<CustomType> myInvokableReturningVectorOfCustomType() + { m_qtFunctionInvoked = 11; return QVector<CustomType>(); } + Q_INVOKABLE void myInvokableWithVectorOfCustomTypeArg(const QVector<CustomType> &) { m_qtFunctionInvoked = 12; } Q_INVOKABLE QObject *myInvokableReturningQObjectStar() { m_qtFunctionInvoked = 13; return this; } @@ -1359,16 +1359,17 @@ void tst_QScriptExtQObject::callQtInvokable2() // first time we expect failure because the metatype is not registered m_myObject->resetQtFunctionInvoked(); - QCOMPARE(m_engine->evaluate("myObject.myInvokableReturningVectorOfInt()").isError(), true); + QCOMPARE(QMetaType::type("QVector<CustomType>"), QMetaType::UnknownType); // this type should not be registered yet + QCOMPARE(m_engine->evaluate("myObject.myInvokableReturningVectorOfCustomType()").isError(), true); QCOMPARE(m_myObject->qtFunctionInvoked(), -1); - QCOMPARE(m_engine->evaluate("myObject.myInvokableWithVectorOfIntArg(0)").isError(), true); + QCOMPARE(m_engine->evaluate("myObject.myInvokableWithVectorOfCustomTypeArg(CustomType())").isError(), true); QCOMPARE(m_myObject->qtFunctionInvoked(), -1); // now we register it, and it should work - qScriptRegisterSequenceMetaType<QVector<int> >(m_engine); + qScriptRegisterSequenceMetaType<QVector<CustomType> >(m_engine); { - QScriptValue ret = m_engine->evaluate("myObject.myInvokableReturningVectorOfInt()"); + QScriptValue ret = m_engine->evaluate("myObject.myInvokableReturningVectorOfCustomType()"); QCOMPARE(ret.isArray(), true); QCOMPARE(m_myObject->qtFunctionInvoked(), 11); } @@ -1377,7 +1378,8 @@ void tst_QScriptExtQObject::callQtInvokable2() void tst_QScriptExtQObject::callQtInvokable3() { { - QScriptValue ret = m_engine->evaluate("myObject.myInvokableWithVectorOfIntArg(myObject.myInvokableReturningVectorOfInt())"); + qScriptRegisterSequenceMetaType<QVector<CustomType> >(m_engine); + QScriptValue ret = m_engine->evaluate("myObject.myInvokableWithVectorOfCustomTypeArg(myObject.myInvokableReturningVectorOfCustomType())"); QCOMPARE(ret.isUndefined(), true); QCOMPARE(m_myObject->qtFunctionInvoked(), 12); } |