|
|
@ -49,8 +49,7 @@ UBGraphicsStrokesGroup::UBGraphicsStrokesGroup(QGraphicsItem *parent) |
|
|
|
setFlag(QGraphicsItem::ItemIsMovable, true); |
|
|
|
setFlag(QGraphicsItem::ItemIsMovable, true); |
|
|
|
|
|
|
|
|
|
|
|
mDebugText = NULL; |
|
|
|
mDebugText = NULL; |
|
|
|
|
|
|
|
debugTextEnabled = false; // set to true to get a graphical display of strokes' Z-levels
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsStrokesGroup::~UBGraphicsStrokesGroup() |
|
|
|
UBGraphicsStrokesGroup::~UBGraphicsStrokesGroup() |
|
|
@ -206,7 +205,7 @@ void UBGraphicsStrokesGroup::paint(QPainter *painter, const QStyleOptionGraphics |
|
|
|
|
|
|
|
|
|
|
|
QVariant UBGraphicsStrokesGroup::itemChange(GraphicsItemChange change, const QVariant &value) |
|
|
|
QVariant UBGraphicsStrokesGroup::itemChange(GraphicsItemChange change, const QVariant &value) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (change == ItemZValueChange) { |
|
|
|
if (debugTextEnabled && change == ItemZValueChange) { |
|
|
|
double newZ = qvariant_cast<double>(value); |
|
|
|
double newZ = qvariant_cast<double>(value); |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsPolygonItem * poly = NULL; |
|
|
|
UBGraphicsPolygonItem * poly = NULL; |
|
|
@ -216,14 +215,13 @@ QVariant UBGraphicsStrokesGroup::itemChange(GraphicsItemChange change, const QVa |
|
|
|
if (poly) { |
|
|
|
if (poly) { |
|
|
|
if (!mDebugText) { |
|
|
|
if (!mDebugText) { |
|
|
|
mDebugText = new QGraphicsSimpleTextItem("None", this); |
|
|
|
mDebugText = new QGraphicsSimpleTextItem("None", this); |
|
|
|
//mDebugText->setPos(poly->scenePos());
|
|
|
|
|
|
|
|
mDebugText->setPos(poly->boundingRect().topLeft() + QPointF(10, 10)); |
|
|
|
mDebugText->setPos(poly->boundingRect().topLeft() + QPointF(10, 10)); |
|
|
|
mDebugText->setBrush(QBrush(poly->color())); |
|
|
|
mDebugText->setBrush(QBrush(poly->color())); |
|
|
|
} |
|
|
|
} |
|
|
|
mDebugText->setText(QString("Z: %1").arg(newZ)); |
|
|
|
mDebugText->setText(QString("Z: %1").arg(newZ)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QVariant newValue = Delegate()->itemChange(change, value); |
|
|
|
QVariant newValue = Delegate()->itemChange(change, value); |
|
|
|
return QGraphicsItemGroup::itemChange(change, newValue); |
|
|
|
return QGraphicsItemGroup::itemChange(change, newValue); |
|
|
|
} |
|
|
|
} |
|
|
|