(finished) fixed some bugs where 'Locked' and 'Visible on extended screen' properties were not persisted for groups

preferencesAboutTextFull
Clément Fauconnier 7 years ago
parent 967d54d134
commit b2f7c0c46d
  1. 12
      src/domain/UBGraphicsGroupContainerItem.cpp
  2. 7
      src/domain/UBGraphicsItemDelegate.cpp

@ -84,23 +84,15 @@ void UBGraphicsGroupContainerItem::addToGroup(QGraphicsItem *item)
if (!UBGraphicsItem::isLocked(this) && UBGraphicsItem::isLocked(item)) { if (!UBGraphicsItem::isLocked(this) && UBGraphicsItem::isLocked(item)) {
Delegate()->setLocked(true); Delegate()->setLocked(true);
} }
/*
if (data(UBGraphicsItemData::itemLayerType).toInt() != UBItemLayerType::Control
&& item->data(UBGraphicsItemData::itemLayerType).toInt() == UBItemLayerType::Control)
setData(UBGraphicsItemData::itemLayerType, UBItemLayerType::Control);
*/
//setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control));
} }
else { else {
Delegate()->setUBFlag(GF_FLIPPABLE_ALL_AXIS, UBGraphicsItem::isFlippable(item)); Delegate()->setUBFlag(GF_FLIPPABLE_ALL_AXIS, UBGraphicsItem::isFlippable(item));
Delegate()->setUBFlag(GF_REVOLVABLE, UBGraphicsItem::isRotatable(item)); Delegate()->setUBFlag(GF_REVOLVABLE, UBGraphicsItem::isRotatable(item));
Delegate()->setLocked(UBGraphicsItem::isLocked(item)); Delegate()->setLocked(UBGraphicsItem::isLocked(item));
setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control));
//setData(UBGraphicsItemData::itemLayerType, item->data(UBGraphicsItemData::itemLayerType));
} }
qDebug() << item->data(UBGraphicsItemData::itemLayerType); if (item->data(UBGraphicsItemData::ItemLayerType) == UBItemLayerType::Control)
setData(UBGraphicsItemData::ItemLayerType, item->data(UBGraphicsItemData::ItemLayerType));
// COMBINE // COMBINE
bool ok; bool ok;

@ -287,7 +287,12 @@ QVariant UBGraphicsItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange ch
} }
} break; } break;
case QGraphicsItem::ItemVisibleHasChanged :
{
bool shownOnDisplay = mDelegated->data(UBGraphicsItemData::ItemLayerType).toInt() != UBItemLayerType::Control;
showHide(shownOnDisplay);
break;
}
case QGraphicsItem::ItemPositionHasChanged : case QGraphicsItem::ItemPositionHasChanged :
case QGraphicsItem::ItemTransformHasChanged : case QGraphicsItem::ItemTransformHasChanged :
case QGraphicsItem::ItemZValueHasChanged : case QGraphicsItem::ItemZValueHasChanged :

Loading…
Cancel
Save