aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-02-18 16:55:43 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-02-18 16:55:43 +0100
commit55525e90764b4d5e8b737f1e6f6da5573928e472 (patch)
tree2ae0256a6cba2504abdaa3bb28fed38b8c3c8add
parent383ab3faad26f5dcaf56388315b2f9783b9f58ec (diff)
parentba05397ad723fa19125eb5ca2f91c7f437b21484 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
-rw-r--r--src/qml/compiler/qqmlirbuilder.cpp20
-rw-r--r--src/qml/compiler/qv4codegen.cpp12
-rw-r--r--src/qml/compiler/qv4codegen_p.h32
-rw-r--r--src/qml/jsapi/qjsvalue.cpp86
-rw-r--r--src/qml/jsruntime/qv4qmlcontext.cpp4
-rw-r--r--src/qml/qml/qqmlcontext.cpp2
-rw-r--r--src/qml/qml/qqmltypeloader.cpp1
-rw-r--r--src/qml/types/qqmlobjectmodel_p.h1
-rw-r--r--src/quick/items/qquickitemview.cpp7
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h9
-rw-r--r--src/quick/scenegraph/scenegraph.pri2
-rw-r--r--tests/auto/qml/qqmlcontext/data/ContextLeak.js1
-rw-r--r--tests/auto/qml/qqmlcontext/data/contextLeak.qml5
-rw-r--r--tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp37
-rw-r--r--tests/auto/qml/qqmlecmascript/data/nonNotifyableConstant.qml5
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp13
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp2
17 files changed, 212 insertions, 27 deletions
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp
index 6de0ed6f7d..6c8ca4bbfc 100644
--- a/src/qml/compiler/qqmlirbuilder.cpp
+++ b/src/qml/compiler/qqmlirbuilder.cpp
@@ -2231,20 +2231,28 @@ QV4::Compiler::Codegen::Reference JSCodeGen::fallbackNameLookup(const QString &n
QQmlPropertyData *data = lookupQmlCompliantProperty(_scopeObject, name);
if (!data)
return Reference::fromName(this, name);
+
Reference base = Reference::fromStackSlot(this, _qmlContextSlot);
- bool captureRequired = !data->isConstant() && !data->isQmlBinding();
- return Reference::fromQmlScopeObject(base, data->coreIndex(), data->notifyIndex(),
- captureRequired);
+ Reference::PropertyCapturePolicy capturePolicy;
+ if (!data->isConstant() && !data->isQmlBinding())
+ capturePolicy = Reference::CaptureAtRuntime;
+ else
+ capturePolicy = data->isConstant() ? Reference::DontCapture : Reference::CaptureAheadOfTime;
+ return Reference::fromQmlScopeObject(base, data->coreIndex(), data->notifyIndex(), capturePolicy);
}
if (_contextObject) {
QQmlPropertyData *data = lookupQmlCompliantProperty(_contextObject, name);
if (!data)
return Reference::fromName(this, name);
+
Reference base = Reference::fromStackSlot(this, _qmlContextSlot);
- bool captureRequired = !data->isConstant() && !data->isQmlBinding();
- return Reference::fromQmlContextObject(base, data->coreIndex(), data->notifyIndex(),
- captureRequired);
+ Reference::PropertyCapturePolicy capturePolicy;
+ if (!data->isConstant() && !data->isQmlBinding())
+ capturePolicy = Reference::CaptureAtRuntime;
+ else
+ capturePolicy = data->isConstant() ? Reference::DontCapture : Reference::CaptureAheadOfTime;
+ return Reference::fromQmlContextObject(base, data->coreIndex(), data->notifyIndex(), capturePolicy);
}
if (m_globalNames.contains(name)) {
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 5f0d7395f7..b2808784a0 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -3087,7 +3087,7 @@ Codegen::Reference &Codegen::Reference::operator =(const Reference &other)
qmlBase = other.qmlBase;
qmlCoreIndex = other.qmlCoreIndex;
qmlNotifyIndex = other.qmlNotifyIndex;
- captureRequired = other.captureRequired;
+ capturePolicy = other.capturePolicy;
break;
}
@@ -3124,7 +3124,7 @@ bool Codegen::Reference::operator==(const Codegen::Reference &other) const
case QmlScopeObject:
case QmlContextObject:
return qmlCoreIndex == other.qmlCoreIndex && qmlNotifyIndex == other.qmlNotifyIndex
- && captureRequired == other.captureRequired;
+ && capturePolicy == other.capturePolicy;
}
return true;
}
@@ -3453,18 +3453,18 @@ QT_WARNING_POP
Instruction::LoadScopeObjectProperty load;
load.base = qmlBase;
load.propertyIndex = qmlCoreIndex;
- load.captureRequired = captureRequired;
+ load.captureRequired = capturePolicy == CaptureAtRuntime;
codegen->bytecodeGenerator->addInstruction(load);
- if (!captureRequired)
+ if (capturePolicy == CaptureAheadOfTime)
codegen->_context->scopeObjectPropertyDependencies.insert(qmlCoreIndex, qmlNotifyIndex);
} return;
case QmlContextObject: {
Instruction::LoadContextObjectProperty load;
load.base = qmlBase;
load.propertyIndex = qmlCoreIndex;
- load.captureRequired = captureRequired;
+ load.captureRequired = capturePolicy == CaptureAtRuntime;
codegen->bytecodeGenerator->addInstruction(load);
- if (!captureRequired)
+ if (capturePolicy == CaptureAheadOfTime)
codegen->_context->contextObjectPropertyDependencies.insert(qmlCoreIndex, qmlNotifyIndex);
} return;
case Invalid:
diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h
index 5c4ce14870..e52f63e1f4 100644
--- a/src/qml/compiler/qv4codegen_p.h
+++ b/src/qml/compiler/qv4codegen_p.h
@@ -219,6 +219,28 @@ public:
return isStackSlot();
}
+ enum PropertyCapturePolicy {
+ /*
+ We're reading a property from the scope or context object, but it's a CONSTANT property,
+ so we don't need to register a dependency at all.
+ */
+ DontCapture,
+ /*
+ We're reading the property of a QObject, and we know that it's the
+ scope object or context object, which we know very well. Instead of registering a
+ property capture every time, we can do that ahead of time and then register all those
+ captures in one shot in registerQmlDependencies().
+ */
+ CaptureAheadOfTime,
+ /*
+ We're reading the property of a QObject, and we're not quite sure where
+ the QObject comes from or what it is. So, when reading that property at run-time,
+ make sure that we capture where we read that property so that if it changes we can
+ re-evaluate the entire expression.
+ */
+ CaptureAtRuntime
+ };
+
static Reference fromAccumulator(Codegen *cg) {
return Reference(cg, Accumulator);
}
@@ -267,20 +289,20 @@ public:
r.isReadonly = true;
return r;
}
- static Reference fromQmlScopeObject(const Reference &base, qint16 coreIndex, qint16 notifyIndex, bool captureRequired) {
+ static Reference fromQmlScopeObject(const Reference &base, qint16 coreIndex, qint16 notifyIndex, PropertyCapturePolicy capturePolicy) {
Reference r(base.codegen, QmlScopeObject);
r.qmlBase = base.storeOnStack().stackSlot();
r.qmlCoreIndex = coreIndex;
r.qmlNotifyIndex = notifyIndex;
- r.captureRequired = captureRequired;
+ r.capturePolicy = capturePolicy;
return r;
}
- static Reference fromQmlContextObject(const Reference &base, qint16 coreIndex, qint16 notifyIndex, bool captureRequired) {
+ static Reference fromQmlContextObject(const Reference &base, qint16 coreIndex, qint16 notifyIndex, PropertyCapturePolicy capturePolicy) {
Reference r(base.codegen, QmlContextObject);
r.qmlBase = base.storeOnStack().stackSlot();
r.qmlCoreIndex = coreIndex;
r.qmlNotifyIndex = notifyIndex;
- r.captureRequired = captureRequired;
+ r.capturePolicy = capturePolicy;
return r;
}
static Reference fromThis(Codegen *cg) {
@@ -336,7 +358,7 @@ public:
Moth::StackSlot qmlBase;
qint16 qmlCoreIndex;
qint16 qmlNotifyIndex;
- bool captureRequired;
+ PropertyCapturePolicy capturePolicy;
};
};
QString name;
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp
index adfa98bd46..c4090ac482 100644
--- a/src/qml/jsapi/qjsvalue.cpp
+++ b/src/qml/jsapi/qjsvalue.cpp
@@ -67,7 +67,7 @@
QJSValue supports the types defined in the \l{ECMA-262}
standard: The primitive types, which are Undefined, Null, Boolean,
- Number, and String; and the Object type. Additionally, built-in
+ Number, and String; and the Object and Array types. Additionally, built-in
support is provided for Qt/C++ types such as QVariant and QObject.
For the object-based types (including Date and RegExp), use the
@@ -108,6 +108,38 @@
script code, or QJSValueIterator in C++.
\sa QJSEngine, QJSValueIterator
+
+ \section1 Working With Arrays
+
+ To create an array using QJSValue, use \l QJSEngine::newArray():
+
+ \code
+ // Assumes that this class was declared in QML.
+ QJSValue jsArray = engine->newArray(3);
+ \endcode
+
+ To set individual elements in the array, use
+ the \l {QJSValue::}{setProperty(quint32 arrayIndex, const QJSValue &value)}
+ overload. For example, to fill the array above with integers:
+
+ \code
+ for (int i = 0; i < 3; ++i) {
+ jsArray.setProperty(i, QRandomGenerator::global().generate());
+ }
+ \endcode
+
+ To determine the length of the array, access the \c "length" property.
+ To access array elements, use the
+ \l {QJSValue::}{property(quint32 arrayIndex)} overload. The following code
+ reads the array we created above back into a list:
+
+ \code
+ QVector<int> integers;
+ const int length = jsArray.property("length").toInt();
+ for (int i = 0; i < length; ++i) {
+ integers.append(jsArray.property(i).toInt());
+ }
+ \endcode
*/
/*!
@@ -1008,6 +1040,10 @@ bool QJSValue::strictlyEquals(const QJSValue& other) const
occurred, property() returns the value that was thrown (typically
an \c{Error} object).
+ To access array elements, use the
+ \l {QJSValue::}{setProperty(quint32 arrayIndex, const QJSValue &value)}
+ overload instead.
+
\sa setProperty(), hasProperty(), QJSValueIterator
*/
QJSValue QJSValue::property(const QString& name) const
@@ -1039,8 +1075,25 @@ QJSValue QJSValue::property(const QString& name) const
Returns the property at the given \a arrayIndex.
- This function is provided for convenience and performance when
- working with array objects.
+ It is possible to access elements in an array in two ways. The first is to
+ use the array index as the property name:
+
+ \code
+ qDebug() << jsValueArray.property(QLatin1String("4")).toString();
+ \endcode
+
+ The second is to use the overload that takes an index:
+
+ \code
+ qDebug() << jsValueArray.property(4).toString();
+ \endcode
+
+ Both of these approaches achieve the same result, except that the latter:
+
+ \list
+ \li Is easier to use (can use an integer directly)
+ \li Is faster (no conversion to integer)
+ \endlist
If this QJSValue is not an Array object, this function behaves
as if property() was called with the string representation of \a
@@ -1072,6 +1125,10 @@ QJSValue QJSValue::property(quint32 arrayIndex) const
If this QJSValue does not already have a property with name \a name,
a new property is created.
+ To modify array elements, use the
+ \l {QJSValue::}{setProperty(quint32 arrayIndex, const QJSValue &value)}
+ overload instead.
+
\sa property(), deleteProperty()
*/
void QJSValue::setProperty(const QString& name, const QJSValue& value)
@@ -1109,12 +1166,31 @@ void QJSValue::setProperty(const QString& name, const QJSValue& value)
Sets the property at the given \a arrayIndex to the given \a value.
- This function is provided for convenience and performance when
- working with array objects.
+ It is possible to modify elements in an array in two ways. The first is to
+ use the array index as the property name:
+
+ \code
+ jsValueArray.setProperty(QLatin1String("4"), value);
+ \endcode
+
+ The second is to use the overload that takes an index:
+
+ \code
+ jsValueArray.setProperty(4, value);
+ \endcode
+
+ Both of these approaches achieve the same result, except that the latter:
+
+ \list
+ \li Is easier to use (can use an integer directly)
+ \li Is faster (no conversion to integer)
+ \endlist
If this QJSValue is not an Array object, this function behaves
as if setProperty() was called with the string representation of \a
arrayIndex.
+
+ \sa {QJSValue::}{property(quint32 arrayIndex)}, {Working With Arrays}
*/
void QJSValue::setProperty(quint32 arrayIndex, const QJSValue& value)
{
diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp
index 9c33966cf7..cf4ef68bc0 100644
--- a/src/qml/jsruntime/qv4qmlcontext.cpp
+++ b/src/qml/jsruntime/qv4qmlcontext.cpp
@@ -138,7 +138,9 @@ ReturnedValue QQmlContextWrapper::get(const Managed *m, String *name, bool *hasP
*hasProperty = true;
if (r.scriptIndex != -1) {
QV4::ScopedObject scripts(scope, context->importedScripts.valueRef());
- return scripts->getIndexed(r.scriptIndex);
+ if (scripts)
+ return scripts->getIndexed(r.scriptIndex);
+ return QV4::Encode::null();
} else if (r.type.isValid()) {
return QQmlTypeWrapper::create(v4, scopeObject, r.type);
} else if (r.importNamespace) {
diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp
index de43108312..0b0132fab7 100644
--- a/src/qml/qml/qqmlcontext.cpp
+++ b/src/qml/qml/qqmlcontext.cpp
@@ -587,6 +587,8 @@ void QQmlContextData::invalidate()
prevChild = 0;
}
+ importedScripts.clear();
+
engine = 0;
parent = 0;
}
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 0be83f6ba6..e5682df761 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -2916,6 +2916,7 @@ QV4::ReturnedValue QQmlScriptData::scriptValueForContext(QQmlContextData *parent
m_program->qmlContext.set(scope.engine, qmlContext);
m_program->run();
+ m_program->qmlContext.clear();
if (scope.engine->hasException) {
QQmlError error = scope.engine->catchExceptionAsQmlError();
if (error.isValid())
diff --git a/src/qml/types/qqmlobjectmodel_p.h b/src/qml/types/qqmlobjectmodel_p.h
index c98fe13a6b..b3cf45ca62 100644
--- a/src/qml/types/qqmlobjectmodel_p.h
+++ b/src/qml/types/qqmlobjectmodel_p.h
@@ -75,7 +75,6 @@ public:
virtual int count() const = 0;
virtual bool isValid() const = 0;
- QObject *object(int index, bool async) { return object(index, async ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested); }
virtual QObject *object(int index, QQmlIncubator::IncubationMode incubationMode = QQmlIncubator::AsynchronousIfNested) = 0;
virtual ReleaseFlags release(QObject *object) = 0;
virtual void cancel(int) {}
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
index 17a1d124ab..21aca04fdc 100644
--- a/src/quick/items/qquickitemview.cpp
+++ b/src/quick/items/qquickitemview.cpp
@@ -1750,6 +1750,7 @@ void QQuickItemViewPrivate::updateCurrent(int modelIndex)
void QQuickItemViewPrivate::clear()
{
+ Q_Q(QQuickItemView);
currentChanges.reset();
bufferedChanges.reset();
timeline.clear();
@@ -1763,8 +1764,11 @@ void QQuickItemViewPrivate::clear()
}
releasePendingTransition.clear();
+ auto oldCurrentItem = currentItem;
releaseItem(currentItem);
currentItem = 0;
+ if (oldCurrentItem)
+ emit q->currentItemChanged();
createHighlight();
trackedItem = 0;
@@ -2120,8 +2124,11 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult
if (currentChanges.currentRemoved && currentItem) {
if (currentItem->item && currentItem->attached)
currentItem->attached->setIsCurrentItem(false);
+ auto oldCurrentItem = currentItem;
releaseItem(currentItem);
currentItem = 0;
+ if (oldCurrentItem)
+ emit q->currentItemChanged();
}
if (!currentIndexCleared)
updateCurrent(currentChanges.newCurrentIndex);
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
index 5c39242029..e99af2f4ef 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
@@ -440,7 +440,9 @@ struct Batch
mutable uint uploadedThisFrame : 1; // solely for debugging purposes
Buffer vbo;
+#ifdef QSG_SEPARATE_INDEX_BUFFER
Buffer ibo;
+#endif
QDataBuffer<DrawSet> drawSets;
};
@@ -743,7 +745,9 @@ private:
ClipType m_currentClipType;
QDataBuffer<char> m_vertexUploadPool;
+#ifdef QSG_SEPARATE_INDEX_BUFFER
QDataBuffer<char> m_indexUploadPool;
+#endif
// For minimal OpenGL core profile support
QOpenGLVertexArrayObject *m_vao;
@@ -763,7 +767,10 @@ Batch *Renderer::newBatch()
m_batchPool.resize(size - 1);
} else {
b = new Batch();
- memset(&b->vbo, 0, sizeof(Buffer) * 2); // Clear VBO & IBO
+ memset(&b->vbo, 0, sizeof(Buffer));
+#ifdef QSG_SEPARATE_INDEX_BUFFER
+ memset(&b->ibo, 0, sizeof(Buffer));
+#endif
}
b->init();
return b;
diff --git a/src/quick/scenegraph/scenegraph.pri b/src/quick/scenegraph/scenegraph.pri
index 34396dcf43..4fa3e7b6bf 100644
--- a/src/quick/scenegraph/scenegraph.pri
+++ b/src/quick/scenegraph/scenegraph.pri
@@ -1,4 +1,4 @@
-DEFINES += QSG_SEPARATE_INDEX_BUFFER
+# DEFINES += QSG_SEPARATE_INDEX_BUFFER
# DEFINES += QSG_DISTANCEFIELD_CACHE_DEBUG
# Core API
diff --git a/tests/auto/qml/qqmlcontext/data/ContextLeak.js b/tests/auto/qml/qqmlcontext/data/ContextLeak.js
new file mode 100644
index 0000000000..e43b1bb230
--- /dev/null
+++ b/tests/auto/qml/qqmlcontext/data/ContextLeak.js
@@ -0,0 +1 @@
+var value = 42
diff --git a/tests/auto/qml/qqmlcontext/data/contextLeak.qml b/tests/auto/qml/qqmlcontext/data/contextLeak.qml
new file mode 100644
index 0000000000..515b3a1aa2
--- /dev/null
+++ b/tests/auto/qml/qqmlcontext/data/contextLeak.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+import "ContextLeak.js" as ContextLeak
+QtObject {
+ property int value: ContextLeak.value
+}
diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
index 5dfbd2e522..783b5cb786 100644
--- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
+++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
@@ -33,6 +33,8 @@
#include <QQmlComponent>
#include <QQmlExpression>
#include <private/qqmlcontext_p.h>
+#include <private/qv4qmlcontext_p.h>
+#include <private/qv4object_p.h>
#include "../../shared/util.h"
class tst_qqmlcontext : public QQmlDataTest
@@ -64,6 +66,7 @@ private slots:
void qobjectDerived();
void qtbug_49232();
void contextViaClosureAfterDestruction();
+ void contextLeak();
private:
QQmlEngine engine;
@@ -778,6 +781,40 @@ void tst_qqmlcontext::contextViaClosureAfterDestruction()
QCOMPARE(subObject.toString(), QLatin1String("Error: Qt.createQmlObject(): Cannot create a component in an invalid context"));
}
+void tst_qqmlcontext::contextLeak()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("contextLeak.qml"));
+
+ QQmlGuardedContextData scriptContext;
+
+ {
+ QScopedPointer<QObject> obj(component.create());
+ QVERIFY(!obj.isNull());
+ QCOMPARE(obj->property("value").toInt(), 42);
+
+ QQmlData *ddata = QQmlData::get(obj.data());
+ QVERIFY(ddata);
+ QQmlContextData *context = ddata->context;
+ QVERIFY(context);
+ QVERIFY(!context->importedScripts.isNullOrUndefined());
+ QCOMPARE(int(context->importedScripts.valueRef()->as<QV4::Object>()->getLength()), 1);
+
+ {
+ QV4::Scope scope(ddata->jsWrapper.engine());
+ QV4::ScopedValue scriptContextWrapper(scope);
+ scriptContextWrapper = context->importedScripts.valueRef()->as<QV4::Object>()->getIndexed(0);
+ scriptContext = scriptContextWrapper->as<QV4::QQmlContextWrapper>()->getContext();
+ }
+ }
+
+ engine.collectGarbage();
+
+ // Each time a JS file (non-pragma-shared) is imported, we create a QQmlContext(Data) for it.
+ // Make sure that context does not leak.
+ QVERIFY(scriptContext.isNull());
+}
+
QTEST_MAIN(tst_qqmlcontext)
#include "tst_qqmlcontext.moc"
diff --git a/tests/auto/qml/qqmlecmascript/data/nonNotifyableConstant.qml b/tests/auto/qml/qqmlecmascript/data/nonNotifyableConstant.qml
new file mode 100644
index 0000000000..424b3e8b07
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/nonNotifyableConstant.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ objectName: trueProperty ? "foo" : "bar"
+}
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index b7d5db9914..5e752d124b 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -261,6 +261,7 @@ private slots:
void doubleEvaluate();
void forInLoop();
void nonNotifyable();
+ void nonNotifyableConstant();
void deleteWhileBindingRunning();
void callQtInvokables();
void resolveClashingProperties();
@@ -6889,6 +6890,18 @@ void tst_qqmlecmascript::nonNotifyable()
delete object;
}
+void tst_qqmlecmascript::nonNotifyableConstant()
+{
+ QQmlComponent component(&engine, testFileUrl("nonNotifyableConstant.qml"));
+ QQmlTestMessageHandler messageHandler;
+
+ // Shouldn't produce an error message about non-NOTIFYable properties,
+ // as the property has the CONSTANT attribute.
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY(object);
+ QCOMPARE(messageHandler.messages().size(), 0);
+}
+
void tst_qqmlecmascript::forInLoop()
{
QQmlComponent component(&engine, testFileUrl("forInLoop.qml"));
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index f19b18e7c8..bdf7d3dcfd 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -817,7 +817,7 @@ void tst_qquickflickable::returnToBounds()
window->rootContext()->setContextProperty("setRebound", setRebound);
window->setSource(testFileUrl("resize.qml"));
window->show();
- QTest::qWaitForWindowActive(window.data());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *obj = findItem<QQuickFlickable>(window->rootObject(), "flick");