From 9d8ebdf9d85c254ff201b6c5bbb03a4db4bcbd9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Wed, 25 May 2011 13:42:48 +0200 Subject: [PATCH] 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-by: Christiaan Janssen (cherry picked from commit f75fda0365a4e4bf1f26dedc40d96d37a2599174) --- .../qdeclarativeviewobserver.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp b/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp index a49a758..bb23831 100644 --- a/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp +++ b/src/plugins/qmltooling/declarativeobserver/qdeclarativeviewobserver.cpp @@ -494,8 +494,8 @@ void QDeclarativeViewObserverPrivate::setSelectedItemsForTools(const QListtoGraphicsObject()) { + if (QGraphicsObject *obj = item->toGraphicsObject()) { + if (!currentSelection.contains(obj)) { QObject::connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(_q_removeFromSelection(QObject*))); currentSelection.append(obj); -- 1.7.2.5