mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-31 16:50:52 +01:00
Line editor : use QPropertyUndoCommand instead of ChangePartCommand
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4068 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -59,8 +59,7 @@ bool ESEventAddLine::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (!m_line) {
|
||||
m_line = new PartLine(m_editor);
|
||||
m_scene -> addItem(m_line);
|
||||
m_line -> setP1(pos);
|
||||
m_line -> setP2(pos);
|
||||
m_line->setLine(QLineF(pos, pos));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -81,11 +80,14 @@ bool ESEventAddLine::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
bool ESEventAddLine::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
bool ESEventAddLine::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
updateHelpCross (event -> scenePos());
|
||||
if (!m_line) return false;
|
||||
|
||||
m_line -> setP2(m_scene -> snapToGrid(event -> scenePos()));
|
||||
QLineF line = m_line->line();
|
||||
line.setP2(m_scene -> snapToGrid(event -> scenePos()));
|
||||
m_line -> setLine(line);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user