Skip to content
GitLab
Menu
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
d7132fea
Commit
d7132fea
authored
Jan 20, 2011
by
Marco Bubke
Browse files
QmlDesigner.FormEditor: Fix crash for root type change
parent
91bdc5de
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/components/formeditor/formeditorview.cpp
View file @
d7132fea
...
...
@@ -182,19 +182,14 @@ void FormEditorView::nodeAboutToBeRemoved(const ModelNode &removedNode)
void
FormEditorView
::
rootNodeTypeChanged
(
const
QString
&
type
,
int
majorVersion
,
int
minorVersion
)
{
QmlItemNode
oldItemNode
(
rootModelNode
());
if
(
oldItemNode
.
isValid
()
&&
m_scene
->
hasItemForQmlItemNode
(
oldItemNode
))
{
FormEditorItem
*
item
=
m_scene
->
itemForQmlItemNode
(
oldItemNode
);
QList
<
QmlItemNode
>
nodeList
;
nodeList
.
append
(
oldItemNode
.
allSubModelNodes
());
nodeList
.
append
(
oldItemNode
);
QList
<
FormEditorItem
*>
removedItemList
;
removedItemList
.
append
(
scene
()
->
itemsForQmlItemNodes
(
nodeList
));
m_currentTool
->
itemsAboutToRemoved
(
removedItemList
);
foreach
(
FormEditorItem
*
item
,
m_scene
->
allFormEditorItems
())
{
item
->
setParentItem
(
0
);
item
->
setParent
(
0
);
}
foreach
(
FormEditorItem
*
item
,
m_scene
->
allFormEditorItems
())
{
delete
item
;
m_scene
->
removeItemFromHash
(
item
);
}
QmlModelView
::
rootNodeTypeChanged
(
type
,
majorVersion
,
minorVersion
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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