diff options
3 files changed, 13 insertions, 3 deletions
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index 98c758267d..3406109a28 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -399,7 +399,7 @@ const char *QDeclarativeProperty::propertyTypeName() const return 0; if (d->isValueType()) { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(d->engine); + QDeclarativeEnginePrivate *ep = d->engine?QDeclarativeEnginePrivate::get(d->engine):0; QDeclarativeValueType *valueType = 0; if (ep) valueType = ep->valueTypes[d->core.propType]; else valueType = QDeclarativeValueTypeFactory::valueType(d->core.propType); @@ -987,7 +987,7 @@ QVariant QDeclarativePropertyPrivate::readValueProperty() { if (isValueType()) { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + QDeclarativeEnginePrivate *ep = engine?QDeclarativeEnginePrivate::get(engine):0; QDeclarativeValueType *valueType = 0; if (ep) valueType = ep->valueTypes[core.propType]; else valueType = QDeclarativeValueTypeFactory::valueType(core.propType); @@ -1072,7 +1072,7 @@ bool QDeclarativePropertyPrivate::writeValueProperty(const QVariant &value, Writ bool rv = false; if (isValueType()) { - QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); + QDeclarativeEnginePrivate *ep = engine?QDeclarativeEnginePrivate::get(engine):0; QDeclarativeValueType *writeBack = 0; if (ep) { diff --git a/tests/auto/declarative/qdeclarativeproperty/data/NoContextTypeA.qml b/tests/auto/declarative/qdeclarativeproperty/data/NoContextTypeA.qml new file mode 100644 index 0000000000..f58967cbb2 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeproperty/data/NoContextTypeA.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +QtObject { + property string someString +} diff --git a/tests/auto/declarative/qdeclarativeproperty/data/NoContextTypeB.qml b/tests/auto/declarative/qdeclarativeproperty/data/NoContextTypeB.qml new file mode 100644 index 0000000000..4b3672873d --- /dev/null +++ b/tests/auto/declarative/qdeclarativeproperty/data/NoContextTypeB.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +QtObject { + property NoContextTypeA myTypeA +} |