Commit 48ff3f7a authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.NodeInstances: Fix id getter

Add getter for id in node instances.
parent 1a9bd5b1
......@@ -141,6 +141,8 @@ public:
static void registerDeclarativeTypes();
QString id() const;
#ifdef QTCREATOR_TEST
QObject* testHandle() const;
Internal::ObjectNodeInstance* internalInstance() const;
......
......@@ -644,6 +644,11 @@ void NodeInstance::registerDeclarativeTypes()
// qmlRegisterType<QmlDesigner::Internal::QmlPropertyChangesObject>();
}
QString NodeInstance::id() const
{
return m_nodeInstance->id();
}
#ifdef QTCREATOR_TEST
QObject* NodeInstance::testHandle() const
{
......
......@@ -699,8 +699,8 @@ void NodeInstanceView::removeIdFromContext(QObject *object)
{
if (hasInstanceForObject(object)) {
NodeInstance instance = instanceForObject(object);
if (instance.internalInstance()) {
QString id = instance.internalInstance()->id();
if (instance.isValid()) {
QString id = instance.id();
if (!id.isEmpty())
engine()->rootContext()->setContextProperty(id, 0);
}
......
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