Label is just a simple display widget, it doesn't have any image processing capabilities or view abstraction, so you have to do all the math yourself (there is nothing like QLabel::setZoom or QPixmap::setZoom). You can save the original image, select the area of the image via QPixmap::copy method and set it as the new label's pixmap. On each zoom change.
Alternative is to use QGraphicsView, add the image to scene, and then use transformation matrix to manipulate the scaling effect (m11() and m22() for horizontal / vertical scaling factors respectively), or "QGraphicsView::scale" method. More efficient and easier to implement.
Another option if you want to stick to QLabel is to subclass it, reimplement paintEvent and implement zoom by proper combinations of QPainter transformations (translate / scale).
Bookmarks