QgsPixmapLabel class

The QgsPixmapLabel class shows a pixmap and adjusts its size to the space given to the widget by the layout and keeping its aspect ratio.

Constructors, destructors, conversion operators

QgsPixmapLabel(QWidget* parent = nullptr) explicit
Constructor for QgsPixmapLabel.

Public functions

auto heightForWidth(int width) const -> int override
Calculates the height for the given width.
auto sizeHint() const -> QSize override
An optimal size for the widget.

Function documentation

int QgsPixmapLabel::heightForWidth(int width) const override

Calculates the height for the given width.

Parameters
width The width for the widget
Returns An appropriate height

QSize QgsPixmapLabel::sizeHint() const override

An optimal size for the widget.

Returns A size hint

Effectively using the height determined from the width with the given aspect ratio.