qt - detect when graphicsitem boundingRect exceeds scene rect -
I am adding a qgraphicsTextitem when the user clicks on the graphics and I setteextInteractionFlags (using QT to edit mode for GraphicStepTimetime).
But the problem is that the user can edit the text and the text viewpoint is more than the visible area or the visual rectangle.
The user should restrict the given text to the inside of the scene, how can I do this in the graphics frame
Even when texttime text starts in the middle and logs in If I get out of the text, then I have to move the text to the left side.
You must explicitly Again, you need the You may override the Remember that the Bounding Rect item is in the coordinates, you need to consider the position of the item to get this view to get the coordinates. sceneRect to
QGraphicsScene . Otherwise, it will automatically develop.
QGraphicsTextItem subclass, or create your own QGraphicsItem from scratch.
virtual QRectF boundingRect () const , you can call the base
boundingRect , make an inquiry that this view reset , And move the item with
setPos to the left .
Comments
Post a Comment