diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index fb9ec7f2..594df627 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -99,6 +99,12 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool init (); mFilterZIndex = false; + /* + mFilterZIndex = true; + mStartLayer = UBItemLayerType::FixedBackground; + mEndLayer = UBItemLayerType::Control; + */ + mLongPressTimer.setInterval(mLongPressInterval); mLongPressTimer.setSingleShot(true); diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 83d480d8..53203eb1 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -322,7 +322,7 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent, bool enableUndoRedoSta , mSelectionFrame(0) { UBCoreGraphicsScene::setObjectName("BoardScene"); - setItemIndexMethod(NoIndex); + //setItemIndexMethod(NoIndex); setUuid(QUuid::createUuid()); setDocument(parent); diff --git a/src/domain/UBGraphicsStrokesGroup.cpp b/src/domain/UBGraphicsStrokesGroup.cpp index b624946c..11b43fc9 100644 --- a/src/domain/UBGraphicsStrokesGroup.cpp +++ b/src/domain/UBGraphicsStrokesGroup.cpp @@ -48,6 +48,9 @@ UBGraphicsStrokesGroup::UBGraphicsStrokesGroup(QGraphicsItem *parent) setFlag(QGraphicsItem::ItemIsSelectable, true); setFlag(QGraphicsItem::ItemIsMovable, true); + mDebugText = NULL; + + } UBGraphicsStrokesGroup::~UBGraphicsStrokesGroup() @@ -81,6 +84,8 @@ void UBGraphicsStrokesGroup::setColor(const QColor &color, colorType pColorType) } } } + + mDebugText->setBrush(QBrush(color)); } QColor UBGraphicsStrokesGroup::color(colorType pColorType) const @@ -201,6 +206,24 @@ void UBGraphicsStrokesGroup::paint(QPainter *painter, const QStyleOptionGraphics QVariant UBGraphicsStrokesGroup::itemChange(GraphicsItemChange change, const QVariant &value) { + if (change == ItemZValueChange) { + double newZ = qvariant_cast(value); + + UBGraphicsPolygonItem * poly = NULL; + if (childItems().size() > 2) + poly = dynamic_cast(childItems()[1]); + + if (poly) { + if (!mDebugText) { + mDebugText = new QGraphicsSimpleTextItem("None", this); + //mDebugText->setPos(poly->scenePos()); + mDebugText->setPos(poly->boundingRect().topLeft() + QPointF(10, 10)); + mDebugText->setBrush(QBrush(poly->color())); + } + mDebugText->setText(QString("Z: %1").arg(newZ)); + } + + } QVariant newValue = Delegate()->itemChange(change, value); return QGraphicsItemGroup::itemChange(change, newValue); } diff --git a/src/domain/UBGraphicsStrokesGroup.h b/src/domain/UBGraphicsStrokesGroup.h index 5ddf789e..c2182187 100644 --- a/src/domain/UBGraphicsStrokesGroup.h +++ b/src/domain/UBGraphicsStrokesGroup.h @@ -66,6 +66,8 @@ protected: virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); + + QGraphicsSimpleTextItem * mDebugText; }; #endif // UBGRAPHICSSTROKESGROUP_H