mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 17:50:52 +01:00
element editor : improve add line
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3454 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -72,18 +72,6 @@ bool ESEventAddLine::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//Remove the current line if exist
|
||||
//or finish if no line
|
||||
if (event -> button() == Qt::RightButton) {
|
||||
if (m_line) {
|
||||
delete m_line; m_line = nullptr;
|
||||
}
|
||||
else {
|
||||
m_running = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -101,3 +89,17 @@ bool ESEventAddLine::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
m_line -> setLine(QLineF(m_line->line().p1(), pos));
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddLine::mouseReleaseEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
bool ESEventAddLine::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (event -> button() == Qt::RightButton) {
|
||||
if (m_line) {delete m_line; m_line = nullptr;}
|
||||
else {m_running = false;}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user