summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-04-14 03:05:41 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-04-14 03:05:41 (GMT)
commitf19b9cbdf824b8943acc785c50d13fade415bd33 (patch)
tree1d5fe72fe4a50068287c3c1d29a1a17db6af88b7
parentb24a4c0b75f5d393ca673942b68a12f02ed476e8 (diff)
parent2fe3de8526336cf59c23574fc48c61cd9ce2d9f6 (diff)
downloadQt-f19b9cbdf824b8943acc785c50d13fade415bd33.zip
Qt-f19b9cbdf824b8943acc785c50d13fade415bd33.tar.gz
Qt-f19b9cbdf824b8943acc785c50d13fade415bd33.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
-rw-r--r--src/declarative/qml/qdeclarativeboundsignal.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp27
2 files changed, 28 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp
index 762c6428..8c7a977 100644
--- a/src/declarative/qml/qdeclarativeboundsignal.cpp
+++ b/src/declarative/qml/qdeclarativeboundsignal.cpp
@@ -176,7 +176,7 @@ int QDeclarativeBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a)
}
if (m_params) m_params->setValues(a);
- if (m_expression) {
+ if (m_expression && m_expression->engine()) {
QDeclarativeExpressionPrivate::get(m_expression)->value(m_params);
if (m_expression && m_expression->hasError())
qWarning().nospace() << qPrintable(m_expression->error().toString());
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index c9fb116..c648de4 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -141,6 +141,7 @@ private slots:
void deletedEngine();
void libraryScriptAssert();
void variantsAssignedUndefined();
+ void qtbug_9792();
void callQtInvokables();
private:
@@ -2211,6 +2212,32 @@ void tst_qdeclarativeecmascript::variantsAssignedUndefined()
delete object;
}
+void tst_qdeclarativeecmascript::qtbug_9792()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_9792.qml"));
+
+ QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext());
+
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create(context));
+ QVERIFY(object != 0);
+
+ QTest::ignoreMessage(QtDebugMsg, "Hello world!");
+ object->basicSignal();
+
+ delete context;
+
+ transientErrorsMsgCount = 0;
+ QtMsgHandler old = qInstallMsgHandler(transientErrorsMsgHandler);
+
+ object->basicSignal();
+
+ qInstallMsgHandler(old);
+
+ QCOMPARE(transientErrorsMsgCount, 0);
+
+ delete object;
+}
+
QTEST_MAIN(tst_qdeclarativeecmascript)
#include "tst_qdeclarativeecmascript.moc"