diff options
Diffstat (limited to 'Plugins/MultiEditorImage/multieditorimage.cpp')
| -rw-r--r-- | Plugins/MultiEditorImage/multieditorimage.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Plugins/MultiEditorImage/multieditorimage.cpp b/Plugins/MultiEditorImage/multieditorimage.cpp index 59b5a49..68ed77b 100644 --- a/Plugins/MultiEditorImage/multieditorimage.cpp +++ b/Plugins/MultiEditorImage/multieditorimage.cpp @@ -89,7 +89,11 @@ void MultiEditorImage::notifyAboutUnload() void MultiEditorImage::scale(double factor) { currentZoom *= factor; +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + imgLabel->resize(currentZoom * imgLabel->pixmap(Qt::ReturnByValue).size()); +#else imgLabel->resize(currentZoom * imgLabel->pixmap()->size()); +#endif zoomInAct->setEnabled(currentZoom < 10.0); zoomOutAct->setEnabled(currentZoom > 0.1); } @@ -135,9 +139,17 @@ void MultiEditorImage::saveFile() setFileDialogInitPathByFile(fileName); - if (!format.isEmpty() && !fileName.endsWith(format, Qt::CaseInsensitive) && imgLabel->pixmap()) + QPixmap thePixmap = +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + imgLabel->pixmap(Qt::ReturnByValue); +#else + *(imgLabel->pixmap()); +#endif + + imgLabel->resize(currentZoom * thePixmap.size()); + if (!format.isEmpty() && !fileName.endsWith(format, Qt::CaseInsensitive) && !thePixmap.isNull()) { - if (!imgLabel->pixmap()->save(fileName)) + if (!thePixmap.save(fileName)) { QString requestedFormat = QFileInfo(fileName).completeSuffix(); notifyWarn(tr("Tried to save image under different format (%1) than original (%2), " |
