diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index 962121a9..b75b6521 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -474,15 +474,21 @@ void UBGraphicsItemDelegate::lock(bool locked) void UBGraphicsItemDelegate::showHide(bool show) { - if (show) - { + if (show) { mDelegated->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Object)); - } - else - { + 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(); emit showOnDisplayChanged(show);