Skip to content

Commit c17ff59

Browse files
authored
Port away from obsolete QLabel method (#342)
Qt provided a version of pixmap() which returned the pixmap by-pointer. That version is now obsolete.
1 parent 8ff321e commit c17ff59

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/ui/mainwindow.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ void MainWindow::resizeEvent(QResizeEvent *event)
142142

143143
scaleSize.scale(_ui->scrLabel->contentsRect().size(), Qt::KeepAspectRatio);
144144

145-
if (!_ui->scrLabel->pixmap() || scaleSize != _ui->scrLabel->pixmap()->size())
145+
const QPixmap pixmap = _ui->scrLabel->pixmap(Qt::ReturnByValue);
146+
if (pixmap.isNull() || scaleSize != pixmap.size())
146147
updatePixmap(Core::instance()->getPixmap());
147148
}
148149

0 commit comments

Comments
 (0)