Commit 36fd3243 authored by Ilia Ryabokon's avatar Ilia Ryabokon

Sankore-958 recursive fix

parent 3f263533
...@@ -471,24 +471,18 @@ void UBGraphicsItemDelegate::lock(bool locked) ...@@ -471,24 +471,18 @@ void UBGraphicsItemDelegate::lock(bool locked)
mFrame->positionHandles(); mFrame->positionHandles();
} }
void UBGraphicsItemDelegate::showHideRecurs(const QVariant &pShow, QGraphicsItem *pItem)
{
pItem->setData(UBGraphicsItemData::ItemLayerType, pShow);
foreach (QGraphicsItem *insideItem, pItem->childItems()) {
showHideRecurs(pShow, insideItem);
}
}
void UBGraphicsItemDelegate::showHide(bool show) void UBGraphicsItemDelegate::showHide(bool show)
{ {
if (show) { QVariant showFlag = QVariant(show ? UBItemLayerType::Object : UBItemLayerType::Control);
mDelegated->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Object)); showHideRecurs(showFlag, mDelegated);
if (mDelegated->childItems().count()) {
foreach (QGraphicsItem *item, mDelegated->childItems()) {
item->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Object));
}
}
} else {
mDelegated->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control));
if (mDelegated->childItems().count()) {
foreach (QGraphicsItem *item, mDelegated->childItems()) {
item->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control));
}
}
}
mDelegated->update(); mDelegated->update();
emit showOnDisplayChanged(show); emit showOnDisplayChanged(show);
......
...@@ -297,6 +297,7 @@ protected slots: ...@@ -297,6 +297,7 @@ protected slots:
private: private:
void updateFrame(); void updateFrame();
void updateButtons(bool showUpdated = false); void updateButtons(bool showUpdated = false);
inline void showHideRecurs(const QVariant &pShow, QGraphicsItem *pItem);
QPointF mOffset; QPointF mOffset;
QTransform mPreviousTransform; QTransform mPreviousTransform;
......
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