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:
blacksun
2014-11-05 10:09:12 +00:00
parent 1177512f23
commit c81b4fb07c
3 changed files with 26 additions and 14 deletions

View File

@@ -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;
}