Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* A QLabel that rescales the set pixmap with respect of the current aspect ratio
|
||||
* $Id: flm_preview_file_dialog.cpp 52224 2020-09-30 12:31:15Z ojog_i $
|
||||
* $HeadURL: svn://192.168.133.21/TDS/branches/product/iterations/21_01_chaos/Lts/Plugins/FileManagement/Gui/Explorer/flm_preview_file_dialog.cpp $
|
||||
* $Author: ojog_i $
|
||||
*
|
||||
* Created by Mike Wille, SLTE, 2020-03-03
|
||||
*/
|
||||
|
||||
#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;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user