added preview

This commit is contained in:
2019-03-10 23:50:58 +01:00
parent 9d17a27890
commit c135848192
5 changed files with 159 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#include "clabel.h"
#include <QResizeEvent>
cLabel::cLabel(QWidget *parent, Qt::WindowFlags f) :
QLabel(parent, f)
{
}
cLabel::cLabel(const QString &text, QWidget *parent, Qt::WindowFlags f) :
QLabel(text, parent, f)
{
}
void cLabel::setImage(cImage* lpImage)
{
m_lpImage = lpImage;
}
void cLabel::resizeEvent(QResizeEvent* e)
{
QLabel::resizeEvent(e);
setPixmap(QPixmap::fromImage(m_lpImage->scaled(width(), height(), Qt::AspectRatioMode::KeepAspectRatio, Qt::TransformationMode::SmoothTransformation)));
}