Could anyone help me to solve this problem?
Thank you in advance![]()
Could anyone help me to solve this problem?
Thank you in advance![]()
If you are still looking for a solution, It may not be it is not possible to do directly, there is an alternate way (and I guess, QGraphicsScene is designed to be used this way)
Size of the QGraphicsScene is by default unlimited, so set the required size, using QGraphicsScene::setSceneRect(), and QGraphicsView, will ensure to show all the size (it can show more than the set size, if the containing widget is larger). Setting the scene rectangle will not restrict the items being drawn outside the scene rectangle, this is because item draw them self and scene does not draw them, so items have to get the scene rectangle first and them draw themselves with in the scene rectangle.
In your case, as you posted of using large text which may be drawn beyond the scene rectangle, you should first get the scene rectangle, and set restriction to draw wrapped test with in this rectangle.
Bookmarks