Final fix for SANKORE-363

preferencesAboutTextFull
Aleksei Kanash 13 years ago
parent 912561c229
commit e0d1c8ce8a
  1. 25
      src/domain/UBGraphicsScene.cpp

@ -1948,40 +1948,41 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent)
{ {
foreach(QGraphicsItem* item, si) foreach(QGraphicsItem* item, si)
{ {
UBGraphicsItem *ubgi = dynamic_cast<UBGraphicsItem*>(item);
if (ubgi)
{
bool bRemove = true;
switch (item->type()) switch (item->type())
{ {
case UBGraphicsW3CWidgetItem::Type: case UBGraphicsW3CWidgetItem::Type:
{ {
UBGraphicsW3CWidgetItem *wc3_widget = dynamic_cast<UBGraphicsW3CWidgetItem*>(item); UBGraphicsW3CWidgetItem *wc3_widget = dynamic_cast<UBGraphicsW3CWidgetItem*>(item);
if (0 != wc3_widget) if (0 != wc3_widget)
if (wc3_widget->hasFocus()) if (!wc3_widget->hasFocus())
bRemove = false; wc3_widget->remove();
break; break;
} }
case UBGraphicsAppleWidgetItem::Type: case UBGraphicsAppleWidgetItem::Type:
{ {
UBGraphicsAppleWidgetItem *Apple_widget = dynamic_cast<UBGraphicsAppleWidgetItem*>(item); UBGraphicsAppleWidgetItem *Apple_widget = dynamic_cast<UBGraphicsAppleWidgetItem*>(item);
if (0 !=Apple_widget) if (0 !=Apple_widget)
if (Apple_widget->hasFocus()) if (!Apple_widget->hasFocus())
bRemove = false; Apple_widget->remove();
break; break;
} }
case UBGraphicsTextItem::Type: case UBGraphicsTextItem::Type:
{ {
UBGraphicsTextItem *text_item = dynamic_cast<UBGraphicsTextItem*>(item); UBGraphicsTextItem *text_item = dynamic_cast<UBGraphicsTextItem*>(item);
if (0 != text_item) if (0 != text_item)
if (text_item->hasFocus()) if (!text_item->hasFocus())
bRemove = false; text_item->remove();
break; break;
} }
}
if (bRemove) default:
{
UBGraphicsItem *ubgi = dynamic_cast<UBGraphicsItem*>(item);
if (0 != ubgi)
ubgi->remove(); ubgi->remove();
else
UBCoreGraphicsScene::removeItem(item);
}
} }
} }
} }

Loading…
Cancel
Save