PDA

View Full Version : Need help to handle with QGraphicsScene/View



aguayro
27th January 2013, 16:57
I have a lot of images with different sizes, and i'd like to show them always centered on QGraphicsView (one at time, it's a slideshow), but the position makes crazy sometimes, usually with vertical images.
If i set QgraphicsScene rect to QGraphicsView scene, the result is good, but there is not scrollbars, and setting scrollbars always is not an elegant solution.
Any tip for the problem?
Is possible to set QGraphicsScene rect size = image size, and them center the scene in the view?
I'm not sure how to keep al the images centered in view

Lykurg
27th January 2013, 18:42
What's about QGraphicsView::setAlignment() with Qt::AlignCenter?