AspectRatioLabel Class

class QInstaller::AspectRatioLabel

The AspectRatioLabel class provides a label for displaying a pixmap that maintains its original aspect ratio when resized. More...

Header: #include <AspectRatioLabel>
Inherits: QLabel

Public Functions

AspectRatioLabel(QWidget *parent = nullptr)

Reimplemented Public Functions

virtual int heightForWidth(int w) const override
virtual QSize sizeHint() const override

Public Slots

virtual void resizeEvent(QResizeEvent *event) override
void setPixmap(const QPixmap &pixmap)

Detailed Description

Member Function Documentation

AspectRatioLabel::AspectRatioLabel(QWidget *parent = nullptr)

Constructs the label with parent as parent.

[override virtual slot] void AspectRatioLabel::resizeEvent(QResizeEvent *event)

Reimplements: QWidget::resizeEvent(QResizeEvent *event).

[slot] void AspectRatioLabel::setPixmap(const QPixmap &pixmap)

Sets the pixmap shown on the label. Setting a new pixmap clears the previous content.

[override virtual] int AspectRatioLabel::heightForWidth(int w) const

Reimplements: QLabel::heightForWidth(int w) const.

[override virtual] QSize AspectRatioLabel::sizeHint() const

Reimplements: QLabel::sizeHint() const.

© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. The Qt Company, Qt and their respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.