The ImageScrollArea class is a widget displaying an image and providing shortcuts to scale up/down the image. More...
Signals | |
| void | scaleChanged (double scaleFactor) |
Public Member Functions | |
| ImageScrollArea (QWidget *parent=0) | |
| QLabel * | image () |
| void | scaleImage (double factor, bool relative=true) |
Protected Member Functions | |
| virtual void | wheelEvent (QWheelEvent *event) |
Private Member Functions | |
| void | adjustScrollBar (QScrollBar *scrollBar, double factor, bool relative) |
Private Attributes | |
| QLabel * | imageLabel |
| QLabel in which the image is displayed. | |
| double | scaleFactor |
| Image scale factor (1.0 means normal size) | |
The ImageScrollArea class is a widget displaying an image and providing shortcuts to scale up/down the image.
Definition at line 26 of file ImageScrollArea.h.
| ImageScrollArea::ImageScrollArea | ( | QWidget * | parent = 0 ) |
Constructs an image scroll area with the given parent.
Definition at line 35 of file ImageScrollArea.cpp.
| void ImageScrollArea::adjustScrollBar | ( | QScrollBar * | scrollBar, |
| double | factor, | ||
| bool | relative | ||
| ) | [private] |
Adjusts scroll bars position when image scale is modified.
Definition at line 103 of file ImageScrollArea.cpp.
| QLabel * ImageScrollArea::image | ( | ) |
Returs a pointer to the QLabel displaying the image.
Definition at line 53 of file ImageScrollArea.cpp.
| void ImageScrollArea::scaleImage | ( | double | factor, |
| bool | relative = true |
||
| ) |
Scales the image.
If relative is true, image current scale is multiplied by factor. Otherwise, image current scale is replaced by factor.
Definition at line 82 of file ImageScrollArea.cpp.
| void ImageScrollArea::wheelEvent | ( | QWheelEvent * | event ) | [protected, virtual] |
Handles wheel events to navigate and zoom inside the scroll area.
Definition at line 61 of file ImageScrollArea.cpp.
1.7.2