From 3f2635330783ff73011aa40f78567c8b81082622 Mon Sep 17 00:00:00 2001 From: Ilia Ryabokon Date: Thu, 23 Aug 2012 15:45:05 +0300 Subject: [PATCH] Sankore-958 Hide groups on extended screen --- src/domain/UBGraphicsItemDelegate.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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);