A widget for showing a scaled version of an image (QPixmap). More...
#include <scaled_image_widget.h>
Public Member Functions | |
ScaledImageWidget (float scale, QWidget *parent=nullptr) | |
void | setImage (QPixmap image) |
QSize | sizeHint () const override |
~ScaledImageWidget () override | |
Protected Member Functions | |
void | paintEvent (QPaintEvent *event) override |
Private Attributes | |
QPixmap | image_ |
float | scale_ |
A widget for showing a scaled version of an image (QPixmap).
The scale is just a suggestion, given to Qt by calls to sizeHint(), which returns the image size multiplied by the scale. The actual rendered size is the largest that fits the image into the current widget size without changing the aspect ratio. It is always rendered in the center.
Definition at line 46 of file scaled_image_widget.h.
rviz::ScaledImageWidget::ScaledImageWidget | ( | float | scale, |
QWidget * | parent = nullptr |
||
) |
Definition at line 37 of file scaled_image_widget.cpp.
|
inlineoverride |
Definition at line 51 of file scaled_image_widget.h.
|
overrideprotected |
Definition at line 52 of file scaled_image_widget.cpp.
void rviz::ScaledImageWidget::setImage | ( | QPixmap | image | ) |
Definition at line 41 of file scaled_image_widget.cpp.
|
override |
Definition at line 47 of file scaled_image_widget.cpp.
|
private |
Definition at line 63 of file scaled_image_widget.h.
|
private |
Definition at line 64 of file scaled_image_widget.h.