Skip to content
Snippets Groups Projects
Commit e721b9f7 authored by Lasse Holmstedt's avatar Lasse Holmstedt
Browse files

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

parent 20902cf1
No related branches found
No related tags found
No related merge requests found
...@@ -67,6 +67,12 @@ void QDeclarativeDesignView::reloadView() ...@@ -67,6 +67,12 @@ void QDeclarativeDesignView::reloadView()
emit reloadRequested(); emit reloadRequested();
} }
void QDeclarativeDesignView::clearEditorItems()
{
clearHighlight();
setSelectedItems(QList<QGraphicsItem*>());
}
void QDeclarativeDesignView::leaveEvent(QEvent *event) void QDeclarativeDesignView::leaveEvent(QEvent *event)
{ {
if (!designModeBehavior()) { if (!designModeBehavior()) {
...@@ -89,7 +95,7 @@ void QDeclarativeDesignView::mousePressEvent(QMouseEvent *event) ...@@ -89,7 +95,7 @@ void QDeclarativeDesignView::mousePressEvent(QMouseEvent *event)
void QDeclarativeDesignView::mouseMoveEvent(QMouseEvent *event) void QDeclarativeDesignView::mouseMoveEvent(QMouseEvent *event)
{ {
if (!designModeBehavior()) { if (!designModeBehavior()) {
clearHighlight(); clearEditorItems();
QDeclarativeView::mouseMoveEvent(event); QDeclarativeView::mouseMoveEvent(event);
return; return;
} }
...@@ -231,6 +237,9 @@ void QDeclarativeDesignView::setDesignModeBehavior(bool value) ...@@ -231,6 +237,9 @@ void QDeclarativeDesignView::setDesignModeBehavior(bool value)
if (rootObject()) if (rootObject())
m_subcomponentEditorTool->pushContext(rootObject()); m_subcomponentEditorTool->pushContext(rootObject());
} }
if (!m_designModeBehavior)
clearEditorItems();
} }
bool QDeclarativeDesignView::designModeBehavior() const bool QDeclarativeDesignView::designModeBehavior() const
......
...@@ -94,6 +94,7 @@ private Q_SLOTS: ...@@ -94,6 +94,7 @@ private Q_SLOTS:
void applyChangesFromClient(); void applyChangesFromClient();
private: private:
void clearEditorItems();
void createToolbar(); void createToolbar();
void changeToSelectTool(); void changeToSelectTool();
QList<QGraphicsItem*> filterForCurrentContext(QList<QGraphicsItem*> &itemlist) const; QList<QGraphicsItem*> filterForCurrentContext(QList<QGraphicsItem*> &itemlist) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment