From 912561c2297fe771334ac7a429c3244b0c2a7275 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Tue, 17 Jan 2012 14:48:45 +0200 Subject: [PATCH] Fixs to SANKORE-363. --- src/domain/UBGraphicsScene.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 95b05d01..269a87a6 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -1951,7 +1951,37 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent) UBGraphicsItem *ubgi = dynamic_cast(item); if (ubgi) { - ubgi->remove(); + bool bRemove = true; + switch (item->type()) + { + case UBGraphicsW3CWidgetItem::Type: + { + UBGraphicsW3CWidgetItem *wc3_widget = dynamic_cast(item); + if (0 != wc3_widget) + if (wc3_widget->hasFocus()) + bRemove = false; + break; + } + case UBGraphicsAppleWidgetItem::Type: + { + UBGraphicsAppleWidgetItem *Apple_widget = dynamic_cast(item); + if (0 !=Apple_widget) + if (Apple_widget->hasFocus()) + bRemove = false; + break; + } + case UBGraphicsTextItem::Type: + { + UBGraphicsTextItem *text_item = dynamic_cast(item); + if (0 != text_item) + if (text_item->hasFocus()) + bRemove = false; + break; + } + } + + if (bRemove) + ubgi->remove(); } } }