forked from qt-creator/qt-creator
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:
@@ -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());
|
||||
}
|
||||
|
@@ -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());
|
||||
|
||||
|
Reference in New Issue
Block a user