Commit e721b9f7 authored by Lasse Holmstedt's avatar Lasse Holmstedt

Clear editor items (highlights, selections) when not in design mode

parent 20902cf1
......@@ -67,6 +67,12 @@ void QDeclarativeDesignView::reloadView()
emit reloadRequested();
}
void QDeclarativeDesignView::clearEditorItems()
{
clearHighlight();
setSelectedItems(QList<QGraphicsItem*>());
}
void QDeclarativeDesignView::leaveEvent(QEvent *event)
{
if (!designModeBehavior()) {
......@@ -89,7 +95,7 @@ void QDeclarativeDesignView::mousePressEvent(QMouseEvent *event)
void QDeclarativeDesignView::mouseMoveEvent(QMouseEvent *event)
{
if (!designModeBehavior()) {
clearHighlight();
clearEditorItems();
QDeclarativeView::mouseMoveEvent(event);
return;
}
......@@ -231,6 +237,9 @@ void QDeclarativeDesignView::setDesignModeBehavior(bool value)
if (rootObject())
m_subcomponentEditorTool->pushContext(rootObject());
}
if (!m_designModeBehavior)
clearEditorItems();
}
bool QDeclarativeDesignView::designModeBehavior() const
......
......@@ -94,6 +94,7 @@ private Q_SLOTS:
void applyChangesFromClient();
private:
void clearEditorItems();
void createToolbar();
void changeToSelectTool();
QList<QGraphicsItem*> filterForCurrentContext(QList<QGraphicsItem*> &itemlist) const;
......
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