Commit 912561c2 authored by Aleksei Kanash's avatar Aleksei Kanash

Fixs to SANKORE-363.

parent fd9fc419
...@@ -1951,6 +1951,36 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent) ...@@ -1951,6 +1951,36 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent)
UBGraphicsItem *ubgi = dynamic_cast<UBGraphicsItem*>(item); UBGraphicsItem *ubgi = dynamic_cast<UBGraphicsItem*>(item);
if (ubgi) if (ubgi)
{ {
bool bRemove = true;
switch (item->type())
{
case UBGraphicsW3CWidgetItem::Type:
{
UBGraphicsW3CWidgetItem *wc3_widget = dynamic_cast<UBGraphicsW3CWidgetItem*>(item);
if (0 != wc3_widget)
if (wc3_widget->hasFocus())
bRemove = false;
break;
}
case UBGraphicsAppleWidgetItem::Type:
{
UBGraphicsAppleWidgetItem *Apple_widget = dynamic_cast<UBGraphicsAppleWidgetItem*>(item);
if (0 !=Apple_widget)
if (Apple_widget->hasFocus())
bRemove = false;
break;
}
case UBGraphicsTextItem::Type:
{
UBGraphicsTextItem *text_item = dynamic_cast<UBGraphicsTextItem*>(item);
if (0 != text_item)
if (text_item->hasFocus())
bRemove = false;
break;
}
}
if (bRemove)
ubgi->remove(); ubgi->remove();
} }
} }
......
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