Public Member Functions | Protected Member Functions | Private Attributes | List of all members
rviz::ScaledImageWidget Class Reference

A widget for showing a scaled version of an image (QPixmap). More...

#include <scaled_image_widget.h>

Inheritance diagram for rviz::ScaledImageWidget:
Inheritance graph
[legend]

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_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ScaledImageWidget()

rviz::ScaledImageWidget::ScaledImageWidget ( float  scale,
QWidget *  parent = nullptr 
)

Definition at line 39 of file scaled_image_widget.cpp.

◆ ~ScaledImageWidget()

rviz::ScaledImageWidget::~ScaledImageWidget ( )
inlineoverride

Definition at line 51 of file scaled_image_widget.h.

Member Function Documentation

◆ paintEvent()

void rviz::ScaledImageWidget::paintEvent ( QPaintEvent *  event)
overrideprotected

Definition at line 54 of file scaled_image_widget.cpp.

◆ setImage()

void rviz::ScaledImageWidget::setImage ( QPixmap  image)

Definition at line 43 of file scaled_image_widget.cpp.

◆ sizeHint()

QSize rviz::ScaledImageWidget::sizeHint ( ) const
override

Definition at line 49 of file scaled_image_widget.cpp.

Member Data Documentation

◆ image_

QPixmap rviz::ScaledImageWidget::image_
private

Definition at line 63 of file scaled_image_widget.h.

◆ scale_

float rviz::ScaledImageWidget::scale_
private

Definition at line 64 of file scaled_image_widget.h.


The documentation for this class was generated from the following files:


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Aug 2 2024 08:43:11