Commit 1099ecb9 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Add ModelNode::hasId



Change-Id: I0f6e46c2f3ee91579e754dde434aa51a33b9c671
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent e401248c
......@@ -155,6 +155,7 @@ public:
void setIdWithRefactoring(const QString &id);
void setIdWithoutRefactoring(const QString &id);
static bool isValidId(const QString &id);
bool hasId() const;
Model *model() const;
AbstractView *view() const;
......
......@@ -155,6 +155,11 @@ void InternalNode::setId(const QString& id)
m_id = id;
}
bool InternalNode::hasId() const
{
return !m_id.isEmpty();
}
uint qHash(const InternalNodePointer& node)
{
......
......@@ -86,6 +86,7 @@ public:
QString id() const;
void setId(const QString& id);
bool hasId() const;
QVariant auxiliaryData(const PropertyName &name) const;
void setAuxiliaryData(const PropertyName &name, const QVariant &data);
......
......@@ -164,6 +164,14 @@ bool ModelNode::isValidId(const QString &id)
return id.isEmpty() || (!idContainsWrongLetter(id) && !idIsQmlKeyWord(id));
}
bool ModelNode::hasId() const
{
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
return m_internalNode->hasId();
}
void ModelNode::setIdWithRefactoring(const QString& id)
{
if (model()->rewriterView()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment