aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/MultiEditorImage/multieditorimage.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:07:47 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:07:47 -0500
commit558b1e35fd0777ac97763c1b28056ac984e583e7 (patch)
tree1eb2557119a117ea76535c89cd14a49e510b96bf /Plugins/MultiEditorImage/multieditorimage.cpp
parentc22eb635c11fd45f9c30f911d70e1d79111a49ce (diff)
parent1fdc150116cad39aae5c5da407c3312b47a59e3a (diff)
Update upstream source from tag 'upstream/3.3.3+dfsg1'
Update to upstream version '3.3.3+dfsg1' with Debian dir 9a301fff4922aed2fec0c04c7d011947168c42f1
Diffstat (limited to 'Plugins/MultiEditorImage/multieditorimage.cpp')
-rw-r--r--Plugins/MultiEditorImage/multieditorimage.cpp16
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), "