From ae923f4a7c12394950a48dcdf303ad96cdb02109 Mon Sep 17 00:00:00 2001 From: Didier Clerc Date: Tue, 6 Aug 2013 11:39:44 +0900 Subject: [PATCH] Resolved an issue related to text item on unselection --- src/board/UBBoardView.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 7b8ef369..8413af44 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -503,6 +503,22 @@ void UBBoardView::handleItemsSelection(QGraphicsItem *item) } } } + }else{ + // Deselect the other items + foreach(QGraphicsItem* it, scene()->selectedItems()){ + UBGraphicsGroupContainerItem* pGroup = dynamic_cast(it); + if(NULL != pGroup){ + foreach(QGraphicsItem* pGIt, pGroup->childItems()){ + UBGraphicsTextItem* pTxt = dynamic_cast(pGIt); + if(NULL != pTxt){ + // We must clear the text selection + QTextCursor t = pTxt->textCursor(); + t.clearSelection(); + pTxt->setTextCursor(t); + } + } + } + } } }