I have a QGraphicsView
in which I am painting a QGraphicsItem
and QGraphicsTextItem
.
I have set the flag ItemIsMovable
for the QGraphicsTextItem
for editing the long text.
Here my concern. When I am moving the QGraphicsTextItem
to view the long text, it is also moving the QGraphicsText
to left.
But I want only the QGraphicsTextItem
to be movable.
I want to fix the position of QGraphicsItem
? How do I do that?
Edit:
Here is the output of my code. I have this
QGraphicsView
at the top-left of my application. The Viewport of this QGraphicsView
is the width of the QGraphicsItem
.
When I click on the QGraphicsTextItem
and move the cursor to the right to view the text, the QGraphicsItem
also moves and becomes hidden as shown in the image.
How do I fix the position of this QGraphicsItem
?