Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QGraphicsView and QGraphicsScene go Home area...



  • QGraphicsView and QGraphicsScene did not set the setScene and created QSize (800, 800) QGraphicsRectItem in QPoint (0,0) of Scene.

    I want to show the CenterPoint of the Scene's RectItem in the middle of the screen when I press the home key of the keyboard when the view shows an area, scrolls, or scale zoom (in, out).

    QGraphicsView's resetMatrix or translate shows a strange area. Is there a workaround?


  • Qt Champions 2017

    translate is the right choice to change the drawing reference point. Also show the sample workable code to check on what is the strange behaviour & what you are expecting.



  • @dheerendra

    this translate exmple..

    0_1543370673148_9e0ee4b3-8066-4fbf-9997-7ac8f8fb7829-image.png


Log in to reply