People, I have a widget with a QGraphicsView where I load an image using these comands:
QGraphicsScene* scene = new QGraphicsScene; scene->addPixmap(QPixmap(strPath)); ui.graphicsView_2->setScene(scene); ui.graphicsView_2->setInteractive(true); I need to make a zoom tool which, using a ruber band, I could zoom the selected area. so I set the QGraphicsView this way: ui.graphicsView_2->setDragMode(QGraphicsView::RubberBandDrag); And the band appears automatically, whithout subclassing the GraphicsView and handling mouse events. So I Googled a lot, and I've found a way to zoom the rubber band selected area: QPolygonF selectionPoly = mapToScene(selectionRect); fitInView(QRectF(selectionPoly.boundingRect()); It really works? If yes, where do I need to put this code to work correctly? Thanks for any help! Best Regards, ------------------------------ Sérgio Cavalcante
_______________________________________________ Qt4-preview-feedback mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback
