Commit cf88d6a8 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer Committed by Christiaan Janssen

DeclarativeObserver: Fixed duplicates in item selection

Only add items to the current selection that aren't already part of it.

Also removed checking item for null, since it doesn't make sense to
include null pointers in the list of items to select.

Task-number: QTCREATORBUG-3426
Change-Id: I5a365570f87f72665b3382d05ca9937f56e8956b
Reviewed-on: default avatarChristiaan Janssen <>
parent b9bbf246
......@@ -635,8 +635,8 @@ void QDeclarativeViewObserverPrivate::setSelectedItemsForTools(QList<QGraphicsIt
foreach (QGraphicsItem *item, items) {
if (item) {
if (QGraphicsObject *obj = item->toGraphicsObject()) {
if (QGraphicsObject *obj = item->toGraphicsObject()) {
if (!currentSelection.contains(obj)) {
QObject::connect(obj, SIGNAL(destroyed(QObject*)),
this, SLOT(_q_removeFromSelection(QObject*)));
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