Element editor : add handler for modifie primitives

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4058 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-07-20 17:45:37 +00:00
parent effa4e9997
commit c885ce3d7a
18 changed files with 543 additions and 42 deletions

View File

@@ -155,6 +155,17 @@ QVector<QPointF> QetGraphicsHandlerUtility::pointsForRect(const QRectF &rect)
return vector;
}
/**
* @brief QetGraphicsHandlerUtility::pointsForLine
* The point that define a line in a QVector.
* there is two points.
* @param line
* @return
*/
QVector<QPointF> QetGraphicsHandlerUtility::pointsForLine(const QLineF &line) {
return (QVector<QPointF> {line.p1(), line.p2()});
}
/**
* @brief QetGraphicsHandlerUtility::rectForPosAtIndex
* Return a rectangle after modification of the point '@pos' at index '@index' of original rectangle '@old_rect'.
@@ -180,3 +191,17 @@ QRectF QetGraphicsHandlerUtility::rectForPosAtIndex(const QRectF &old_rect, cons
return rect;
}
/**
* @brief QetGraphicsHandlerUtility::lineForPosAtIndex
* Return a line after modification of @pos at index @index of @old_line.
* @param old_line
* @param pos
* @param index
* @return
*/
QLineF QetGraphicsHandlerUtility::lineForPosAtIndex(const QLineF &old_line, const QPointF &pos, int index) {
QLineF line = old_line;
index == 0 ? line.setP1(pos) : line.setP2(pos);
return line;
}