Qml Designer: fixes crashbug

This commit is contained in:
Thomas Hartmann
2010-01-08 17:11:39 +01:00
parent 2e5ce0ae75
commit 82352c0819

View File

@@ -58,7 +58,7 @@ PropertyEditorValue::PropertyEditorValue(QObject *parent)
QVariant PropertyEditorValue::value() const QVariant PropertyEditorValue::value() const
{ {
QVariant returnValue = m_value; QVariant returnValue = m_value;
if (modelNode().metaInfo().isValid() && modelNode().metaInfo().property(name()).isValid()) if (modelNode().isValid() && modelNode().metaInfo().isValid() && modelNode().metaInfo().property(name()).isValid())
if (modelNode().metaInfo().property(name()).type() == QLatin1String("QUrl")) { if (modelNode().metaInfo().property(name()).type() == QLatin1String("QUrl")) {
returnValue = returnValue.toUrl().toString(); returnValue = returnValue.toUrl().toString();
} }
@@ -137,7 +137,7 @@ bool PropertyEditorValue::isInSubState() const
bool PropertyEditorValue::isBound() const bool PropertyEditorValue::isBound() const
{ {
return modelNode().property(name()).isBindingProperty(); return modelNode().isValid() && modelNode().property(name()).isValid() && modelNode().property(name()).isBindingProperty();
} }
void PropertyEditorValue::setIsInSubState(bool isInSubState) void PropertyEditorValue::setIsInSubState(bool isInSubState)