mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-02 01:40:52 +01:00
polygon editor : use QPropertyUndoCommand instead of ChangePartCommand
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4069 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -199,6 +199,7 @@ void PartPolygon::setPolygon(const QPolygonF &polygon)
|
||||
if (m_polygon == polygon) return;
|
||||
prepareGeometryChange();
|
||||
m_polygon = polygon;
|
||||
emit polygonChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,6 +240,14 @@ void PartPolygon::removeLastPoint()
|
||||
}
|
||||
}
|
||||
|
||||
void PartPolygon::setClosed(bool close)
|
||||
{
|
||||
if (m_closed == close) return;
|
||||
prepareGeometryChange();
|
||||
m_closed = close;
|
||||
emit closedChange();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PartPolygon::mousePressEvent
|
||||
* Handle mouse press event
|
||||
@@ -274,6 +283,7 @@ void PartPolygon::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
QPointF pos_ = event->modifiers() == Qt::ControlModifier ? event->pos() : mapFromScene(elementScene()->snapToGrid(event->scenePos()));
|
||||
prepareGeometryChange();
|
||||
m_polygon.replace(m_handler_index, pos_);
|
||||
emit polygonChanged();
|
||||
}
|
||||
else
|
||||
CustomElementGraphicPart::mouseMoveEvent(event);
|
||||
|
||||
Reference in New Issue
Block a user