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
28867b78
Commit
28867b78
authored
Jul 15, 2010
by
Lasse Holmstedt
Browse files
Remove context if it is destroyed
parent
bb596688
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/tools/qml/qmlobserver/editor/subcomponenteditortool.cpp
View file @
28867b78
...
...
@@ -217,6 +217,7 @@ bool SubcomponentEditorTool::itemIsChildOfQmlSubComponent(QGraphicsItem *item) c
void
SubcomponentEditorTool
::
pushContext
(
QGraphicsObject
*
contextItem
)
{
connect
(
contextItem
,
SIGNAL
(
destroyed
(
QObject
*
)),
SLOT
(
contextDestroyed
(
QObject
*
)));
m_currentContext
.
push
(
contextItem
);
}
...
...
@@ -247,4 +248,17 @@ QGraphicsObject *SubcomponentEditorTool::currentRootItem() const
return
m_currentContext
.
top
();
}
void
SubcomponentEditorTool
::
contextDestroyed
(
QObject
*
contextToDestroy
)
{
disconnect
(
contextToDestroy
,
SIGNAL
(
destroyed
(
QObject
*
)),
this
,
SLOT
(
contextDestroyed
(
QObject
*
)));
// pop out the whole context - it might not be safe anymore.
while
(
m_currentContext
.
size
()
>
1
)
{
m_currentContext
.
pop
();
}
m_mask
->
setVisible
(
false
);
}
}
// namespace QmlViewer
src/tools/qml/qmlobserver/editor/subcomponenteditortool.h
View file @
28867b78
...
...
@@ -57,6 +57,7 @@ protected:
private
slots
:
void
animate
();
void
contextDestroyed
(
QObject
*
context
);
private:
void
aboutToPopContext
();
...
...
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