Commit b2f7c0c4 authored by Clément Fauconnier's avatar Clément Fauconnier

(finished) fixed some bugs where 'Locked' and 'Visible on extended screen'...

(finished) fixed some bugs where 'Locked' and 'Visible on extended screen' properties were not persisted for groups
parent 967d54d1
......@@ -84,23 +84,15 @@ void UBGraphicsGroupContainerItem::addToGroup(QGraphicsItem *item)
if (!UBGraphicsItem::isLocked(this) && UBGraphicsItem::isLocked(item)) {
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 {
Delegate()->setUBFlag(GF_FLIPPABLE_ALL_AXIS, UBGraphicsItem::isFlippable(item));
Delegate()->setUBFlag(GF_REVOLVABLE, UBGraphicsItem::isRotatable(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
bool ok;
......
......@@ -287,7 +287,12 @@ QVariant UBGraphicsItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange ch
}
} break;
case QGraphicsItem::ItemVisibleHasChanged :
{
bool shownOnDisplay = mDelegated->data(UBGraphicsItemData::ItemLayerType).toInt() != UBItemLayerType::Control;
showHide(shownOnDisplay);
break;
}
case QGraphicsItem::ItemPositionHasChanged :
case QGraphicsItem::ItemTransformHasChanged :
case QGraphicsItem::ItemZValueHasChanged :
......
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