A widget for displaying an image, with support for zooming, rotation, selection, and cropping.
More...
#include <ImageViewerPanel.h++>
A widget for displaying an image, with support for zooming, rotation, selection, and cropping.
- Author
- Mark Lindner
◆ ImageViewerPanel()
◆ ~ImageViewerPanel()
◆ clearSelection
Clears the selection, if any.
◆ crop
void crop |
( |
const QRect & |
rect | ) |
|
|
slot |
Crops the image to the specified region.
◆ image()
Returns the image that is currently displayed by the widget.
◆ imageHeight()
int imageHeight |
( |
| ) |
const |
|
inline |
Returns the height, in pixels, of the image that is currently displayed by the widget.
◆ imageSizeChanged
void imageSizeChanged |
( |
QSize |
size | ) |
|
|
signal |
Emitted when the size of the image changes.
◆ imageWidth()
Returns the width, in pixels, of the image that is currently displayed by the widget.
◆ mouseMoveEvent()
virtual void mouseMoveEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
◆ mousePressEvent()
virtual void mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
◆ rotateLeft
Rotates the image 90 degrees counterclockwise.
◆ rotateRight
Rotates the image 90 degrees clockwise.
◆ scaleFactor()
float scaleFactor |
( |
| ) |
const |
|
inline |
Returns the current scale factor.
◆ selection()
QRect selection |
( |
| ) |
const |
Returns the current selection, or an empty rectangle if there is none.
◆ setAllowSelection()
void setAllowSelection |
( |
bool |
allowSelection | ) |
|
Enables or disables selection.
When enabled, dragging the mouse across the image will crate a rubber-band selection box. Selection is disabled by default.
◆ setImage
void setImage |
( |
QPixmap |
pixmap | ) |
|
|
slot |
Sets the image to be displayed by the widget.
◆ zoomIn
Zooms the image in.
The scale factor is multiplied by 1.25, unless the result would be greater than 4.0.
◆ zoomOut
Zooms the image out.
The scale factor is divided by 1.25, unless the result would be greater than 0.25.
◆ zoomReset
Resets the scale factor to 1.0.
◆ zoomScaleChanged
void zoomScaleChanged |
( |
float |
scale | ) |
|
|
signal |
Emitted when the zoom scale factor changes.
◆ zoomToFit
void zoomToFit |
( |
const QRect & |
rect | ) |
|
|
slot |
Zooms the image so that it fits optimally within the given rectangle.
The documentation for this class was generated from the following file: