Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
6d229ef6
Commit
6d229ef6
authored
Sep 22, 2010
by
Marco Bubke
Committed by
Thomas Hartmann
Sep 24, 2010
Browse files
QmlDesigner.NodeInstances: Reset the Id for all child objects before
deletion
parent
c7963126
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/designercore/include/nodeinstanceview.h
View file @
6d229ef6
...
...
@@ -111,7 +111,6 @@ public:
private
slots
:
void
emitParentChanged
(
QObject
*
child
);
void
refreshLocalFileProperty
(
const
QString
&
path
);
void
removeIdFromContext
(
QObject
*
object
);
private:
// functions
NodeInstance
rootNodeInstance
()
const
;
...
...
src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
View file @
6d229ef6
...
...
@@ -417,6 +417,11 @@ void NodeInstanceView::removeAllInstanceNodeRelationships()
{
// prevent destroyed() signals calling back
foreach
(
NodeInstance
instance
,
m_objectInstanceHash
.
values
())
{
if
(
instance
.
isValid
())
instance
.
setId
(
QString
());
}
//first the root object
if
(
rootNodeInstance
().
internalObject
())
rootNodeInstance
().
internalObject
()
->
disconnect
();
...
...
@@ -552,7 +557,8 @@ void NodeInstanceView::removeInstanceNodeRelationship(const ModelNode &node)
{
Q_ASSERT
(
m_nodeInstanceHash
.
contains
(
node
));
NodeInstance
instance
=
instanceForNode
(
node
);
removeIdFromContext
(
instance
.
internalObject
());
if
(
instance
.
isValid
())
instance
.
setId
(
QString
());
m_objectInstanceHash
.
remove
(
instanceForNode
(
node
).
internalObject
());
m_nodeInstanceHash
.
remove
(
node
);
instance
.
makeInvalid
();
...
...
@@ -627,6 +633,10 @@ void NodeInstanceView::activateBaseState()
void
NodeInstanceView
::
removeRecursiveChildRelationship
(
const
ModelNode
&
removedNode
)
{
if
(
hasInstanceForNode
(
removedNode
))
{
instanceForNode
(
removedNode
).
setId
(
QString
());
}
foreach
(
const
ModelNode
&
childNode
,
removedNode
.
allDirectSubModelNodes
())
removeRecursiveChildRelationship
(
childNode
);
...
...
@@ -695,16 +705,4 @@ void NodeInstanceView::refreshLocalFileProperty(const QString &path)
}
}
void
NodeInstanceView
::
removeIdFromContext
(
QObject
*
object
)
{
if
(
hasInstanceForObject
(
object
))
{
NodeInstance
instance
=
instanceForObject
(
object
);
if
(
instance
.
isValid
())
{
QString
id
=
instance
.
id
();
if
(
!
id
.
isEmpty
())
engine
()
->
rootContext
()
->
setContextProperty
(
id
,
0
);
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment