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).

Will set: TextEditorInteraction);

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 sceneRect to QGraphicsScene . Otherwise, it will automatically develop.

Again, you need the QGraphicsTextItem subclass, or create your own QGraphicsItem from scratch.

You may override the 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 .

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.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -