mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
Avoid scaling for null pixmaps (results in warnings)
This commit is contained in:
@@ -211,7 +211,7 @@ namespace BlackGui
|
||||
else
|
||||
{
|
||||
QPixmap qpm = pm.pixmap();
|
||||
if (qpm.height() > MaxHeight)
|
||||
if (qpm.height() > MaxHeight && !qpm.isNull())
|
||||
{
|
||||
qpm = qpm.scaledToWidth(MaxHeight, Qt::SmoothTransformation);
|
||||
}
|
||||
|
||||
@@ -167,9 +167,17 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
this->ui->lbl_Image->setText("");
|
||||
this->ui->lbl_Image->setPixmap(
|
||||
image.scaled(sizeAvailable, Qt::KeepAspectRatio, Qt::FastTransformation)
|
||||
);
|
||||
if (image.isNull())
|
||||
{
|
||||
static const QPixmap e;
|
||||
this->ui->lbl_Image->setPixmap(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->ui->lbl_Image->setPixmap(
|
||||
image.scaled(sizeAvailable, Qt::KeepAspectRatio, Qt::FastTransformation)
|
||||
);
|
||||
}
|
||||
this->display(timeOutMs);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user