Removed size limit inside image viewer, because QT already limits the window size to the 2/3 of screen size

This commit is contained in:
hunbernd 2020-01-21 22:11:13 +01:00
parent 83b18509e2
commit 91b03064b9
2 changed files with 2 additions and 11 deletions

View File

@ -51,17 +51,7 @@ PhotoView::~PhotoView()
void PhotoView::setPixmap(const QPixmap& pixmap)
{
QPixmap sqpixmap;
if(pixmap.width() > 800 ){
QPixmap sqpixmap = pixmap.scaled(640,480, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->photoLabel->setPixmap(sqpixmap);
}else if (pixmap.height() > 600){
QPixmap sqpixmap = pixmap.scaled(480,640, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->photoLabel->setPixmap(sqpixmap);
}
else{
ui->photoLabel->setPixmap(pixmap);
}
this->adjustSize();
}

View File

@ -32,6 +32,7 @@ void AspectRatioPixmapLabel::setPixmap ( const QPixmap & p)
{
pix = p;
QLabel::setPixmap(pix);
//std::cout << "Information size: " << pix.width() << 'x' << pix.height() << std::endl;
}
int AspectRatioPixmapLabel::heightForWidth( int width ) const