QmlDesigner.Model: Adding warnings

The API is confusing so we give a warning.

Change-Id: I7a26766609316772bebc3088d820d472243b2c74
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
Thomas Hartmann
2013-04-10 10:18:36 +02:00
parent 2a261588f4
commit 7b94ac13ed
2 changed files with 6 additions and 0 deletions

View File

@@ -62,6 +62,9 @@ void BindingProperty::setExpression(const QString &expression)
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (isDynamic())
qWarning() << "Calling BindingProperty::setExpression on dynamic property.";
if (name() == "id") { // the ID for a node is independent of the state, so it has to be set with ModelNode::setId
throw InvalidPropertyException(__LINE__, __FUNCTION__, __FILE__, name());
}

View File

@@ -61,6 +61,9 @@ void VariantProperty::setValue(const QVariant &value)
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (isDynamic())
qWarning() << "Calling VariantProperty::setValue on dynamic property.";
if (value.isNull())
throw InvalidArgumentException(__LINE__, __FUNCTION__, __FILE__, name());