Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
5.12.4
-
None
Description
I had the following code in my program, where I am trying to make a pen tool similar to adobe illustrator.
pathBeingDrawn = mainScene->addPath(QPainterPath(mouseClickPosition));
Here, the classes are
QGraphicsPathItem *pathBeingDrawn; QGraphicsScene *mainScene; QPointF mouseClickPosition;
Anyways, any attempt to draw the path results in the pathBeingDrawn initiating at the origin, even if mouseClickPosition is not QPointF(0,0). I know I can easily resolve this in my code with
QPainterPath p(); p.moveTo(mouseClickPosition); pathBeingDrawn->setPath(p);
But I only wish to point out the bug here. Ideally, if there's
QPainterPath(mouseClickPosition);
then I shouldn't have to substitute it with
QPainterPath p(); p.moveTo(mouseClickPosition); pathBeingDrawn->setPath(p);
on the graphics scene.
If this is not really a bug, let me know. Though I'm not sure I understand the point of the constructor
QPainterPath(QPointF &startPoint)
The image attached should give a good example of what I mean.