diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index 962121a9..b6ec5868 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -471,18 +471,18 @@ void UBGraphicsItemDelegate::lock(bool locked) mFrame->positionHandles(); } - -void UBGraphicsItemDelegate::showHide(bool show) +void UBGraphicsItemDelegate::showHideRecurs(const QVariant &pShow, QGraphicsItem *pItem) { - if (show) - { - mDelegated->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Object)); - } - else - { - mDelegated->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control)); + pItem->setData(UBGraphicsItemData::ItemLayerType, pShow); + foreach (QGraphicsItem *insideItem, pItem->childItems()) { + showHideRecurs(pShow, insideItem); } +} +void UBGraphicsItemDelegate::showHide(bool show) +{ + QVariant showFlag = QVariant(show ? UBItemLayerType::Object : UBItemLayerType::Control); + showHideRecurs(showFlag, mDelegated); mDelegated->update(); emit showOnDisplayChanged(show); diff --git a/src/domain/UBGraphicsItemDelegate.h b/src/domain/UBGraphicsItemDelegate.h index fc5c460c..099dd06d 100644 --- a/src/domain/UBGraphicsItemDelegate.h +++ b/src/domain/UBGraphicsItemDelegate.h @@ -297,6 +297,7 @@ protected slots: private: void updateFrame(); void updateButtons(bool showUpdated = false); + inline void showHideRecurs(const QVariant &pShow, QGraphicsItem *pItem); QPointF mOffset; QTransform mPreviousTransform;