From d78c1cb734f897b7de70d8e41d13174493b36d40 Mon Sep 17 00:00:00 2001 From: Pengfei Date: Mon, 9 Aug 2021 22:05:25 +0800 Subject: [PATCH] Fix build for Qt < 5.15 --- src/frontend/title_info_dialog.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend/title_info_dialog.cpp b/src/frontend/title_info_dialog.cpp index 19ee249..823add1 100644 --- a/src/frontend/title_info_dialog.cpp +++ b/src/frontend/title_info_dialog.cpp @@ -174,8 +174,12 @@ void TitleInfoDialog::SaveIcon(bool large) { } last_path = QFileInfo(path).path(); - const auto pixmap = large ? ui->iconLargeLabel->pixmap(Qt::ReturnByValue) - : ui->iconSmallLabel->pixmap(Qt::ReturnByValue); +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) + const auto& pixmap = large ? ui->iconLargeLabel->pixmap(Qt::ReturnByValue) + : ui->iconSmallLabel->pixmap(Qt::ReturnByValue); +#else + const auto& pixmap = large ? *ui->iconLargeLabel->pixmap() : *ui->iconSmallLabel->pixmap(); +#endif if (!pixmap.save(path)) { QMessageBox::warning(this, tr("threeSD"), tr("Could not save icon.")); }