diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index b868f459..aee9e19d 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -815,7 +815,6 @@ UBGraphicsToolBarItem::UBGraphicsToolBarItem(QGraphicsItem * parent) : rect.setWidth(parent->boundingRect().width()); this->setRect(rect); - // setBrush(QColor(UBSettings::paletteColor)); setPen(Qt::NoPen); hide(); diff --git a/src/tools/UBGraphicsCurtainItemDelegate.cpp b/src/tools/UBGraphicsCurtainItemDelegate.cpp index 700b767b..75b70bce 100644 --- a/src/tools/UBGraphicsCurtainItemDelegate.cpp +++ b/src/tools/UBGraphicsCurtainItemDelegate.cpp @@ -32,7 +32,7 @@ #include "core/memcheck.h" UBGraphicsCurtainItemDelegate::UBGraphicsCurtainItemDelegate(UBGraphicsCurtainItem* pDelegated, QObject * parent) - : UBGraphicsItemDelegate(pDelegated, parent, GF_SCALABLE_ALL_AXIS | GF_MENU_SPECIFIED | GF_ZORDER_MANIPULATIONS_ALLOWED) + : UBGraphicsItemDelegate(pDelegated, parent, GF_SCALABLE_ALL_AXIS | GF_MENU_SPECIFIED) { //NOOP } @@ -45,9 +45,12 @@ UBGraphicsCurtainItemDelegate::~UBGraphicsCurtainItemDelegate() void UBGraphicsCurtainItemDelegate::init() { - mFrame->hide(); - mZOrderUpButton->hide(); - mZOrderDownButton->hide(); + if(!mFrame){ + createControls(); + mFrame->hide(); + mZOrderUpButton->hide(); + mZOrderDownButton->hide(); + } } @@ -74,17 +77,6 @@ bool UBGraphicsCurtainItemDelegate::mousePressEvent(QGraphicsSceneMouseEvent *ev QVariant UBGraphicsCurtainItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) { - if (change == QGraphicsItem::ItemZValueHasChanged) - { -// mFrame->setZValue(mDelegated->zValue() + 1); - -// foreach(DelegateButton* button, mButtons) -// { -// button->setZValue(mDelegated->zValue() + 2); -// button->setZValue(mDelegated->zValue() + 2); -// } - } - if (change == QGraphicsItem::ItemVisibleHasChanged) { UBGraphicsScene* ubScene = qobject_cast(mDelegated->scene());