diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-05-25 11:42:48 (GMT) |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-05-25 12:23:04 (GMT) |
commit | f75fda0365a4e4bf1f26dedc40d96d37a2599174 (patch) | |
tree | dea947d13c35216766cb5f2bd1109feb47483365 /src/plugins | |
parent | 73060143c30d38ea99e6d7a77ff81c94f58899d7 (diff) | |
download | Qt-f75fda0365a4e4bf1f26dedc40d96d37a2599174.zip Qt-f75fda0365a4e4bf1f26dedc40d96d37a2599174.tar.gz Qt-f75fda0365a4e4bf1f26dedc40d96d37a2599174.tar.bz2 |
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
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmltooling/declarativeobserver/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 QList<QGrap } 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*))); currentSelection.append(obj); |