roviz  0.7
Code Documentation of roviz
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ImageWidget Class Reference

A widget to show images. More...

#include <image_widget.h>

Inheritance diagram for ImageWidget:
Inheritance graph
Collaboration diagram for ImageWidget:
Collaboration graph

Public Member Functions

 ImageWidget (OutputPrivate *out)
 
void newObject (StreamObject obj) override
 Called when a new image arrived. More...
 
void reset (void) override
 Reset the widget to make it show the default image again.
 
QWidget * qwidget (void) override
 Convert this widget to a QWidget. More...
 
- Public Member Functions inherited from StreamWidget
 StreamWidget (OutputPrivate *out)
 
OutputPrivateoutput (void)
 Get the output associated with this widget. More...
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *event) override
 Paint the widget. More...
 
void resizeEvent (QResizeEvent *event) override
 Called on a resize event. More...
 
void recalcImageRect (double w, double h)
 Recalculates the image dimensions after a resize. More...
 

Protected Attributes

QImage image_qt
 
Image image
 
QRectF image_rect
 

Detailed Description

A widget to show images.

This widget automatically scales the image it is supposed to display to the correct size.

See also
Image
StreamWidget
StreamObject

Member Function Documentation

◆ newObject()

void ImageWidget::newObject ( StreamObject  obj)
overridevirtual

Called when a new image arrived.

Parameters
objStreamObject representing the new image to display

Implements StreamWidget.

Reimplemented in SparseWidget.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ paintEvent()

void ImageWidget::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Paint the widget.

Parameters
eventThe paint event

See QWidget::paintEvent

Reimplemented in SparseWidget.

Here is the caller graph for this function:

◆ qwidget()

QWidget * ImageWidget::qwidget ( void  )
overridevirtual

Convert this widget to a QWidget.

Returns
The QWidget

Implements StreamWidget.

◆ recalcImageRect()

void ImageWidget::recalcImageRect ( double  w,
double  h 
)
protected

Recalculates the image dimensions after a resize.

Parameters
wThe new width of the bounding rect
hThe new height of the bounding rect

◆ resizeEvent()

void ImageWidget::resizeEvent ( QResizeEvent *  event)
overrideprotected

Called on a resize event.

Parameters
eventThe resize event

See QWidget::resizeEvent


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