Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/RatioAwareLabel.h
T

30 lines
399 B
C++
Executable File

#pragma once
#include <QLabel>
#include <QObject>
#include <QPixmap>
class RatioAwareLabel : public QLabel
{
public:
RatioAwareLabel(QWidget *parent);
protected:
void resizeEvent(QResizeEvent *event) override;
QSize sizeHint() const override;
public slots:
void setPixmap(const QPixmap &pixmap);
private:
int heightRatio(int width) const;
void scale();
QPixmap m_pixmap;
};