From c17ff5907efaf2bb102c79258f54aa8b8b17e1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Pereira?= Date: Fri, 23 Jun 2023 15:28:56 +0100 Subject: [PATCH] Port away from obsolete QLabel method (#342) Qt provided a version of pixmap() which returned the pixmap by-pointer. That version is now obsolete. --- src/core/ui/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/ui/mainwindow.cpp b/src/core/ui/mainwindow.cpp index 72c60bc7..1e681bab 100644 --- a/src/core/ui/mainwindow.cpp +++ b/src/core/ui/mainwindow.cpp @@ -142,7 +142,8 @@ void MainWindow::resizeEvent(QResizeEvent *event) scaleSize.scale(_ui->scrLabel->contentsRect().size(), Qt::KeepAspectRatio); - if (!_ui->scrLabel->pixmap() || scaleSize != _ui->scrLabel->pixmap()->size()) + const QPixmap pixmap = _ui->scrLabel->pixmap(Qt::ReturnByValue); + if (pixmap.isNull() || scaleSize != pixmap.size()) updatePixmap(Core::instance()->getPixmap()); }