summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2021-02-16 14:39:06 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-22 17:23:06 +0000
commitb147c28e275596e36243905f4d9e4f140bfedb81 (patch)
treeba863e5237ac546b18f42544518c6fcec88be7f8 /src/gui/image
parent573ba145d76f239dbc7464a78aabc06ed4d00419 (diff)
Add scaledPixmap() override
QAbstractFileIconEngine implements the QIconEngine interface and creates a new interface where subclasses override the filePixmap() function. QIconEngine subclasses must now also override scaledPixmap(); add implementation which forwards to filePixmap(). (The intermediate implementation in QPixmapIconEngine is not used by QAbstractFileIconEngine.) Task-number: QTBUG-91104 Change-Id: I229e3a003ad0c3fff768eac7e75c59fe7145fcaa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit bb110cee5dbcce58c44e9a59b47fd0bbf6aaddaa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qabstractfileiconengine.cpp6
-rw-r--r--src/gui/image/qabstractfileiconengine_p.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/image/qabstractfileiconengine.cpp b/src/gui/image/qabstractfileiconengine.cpp
index c5800d9119..8fa29e8227 100644
--- a/src/gui/image/qabstractfileiconengine.cpp
+++ b/src/gui/image/qabstractfileiconengine.cpp
@@ -85,6 +85,12 @@ QPixmap QAbstractFileIconEngine::pixmap(const QSize &size, QIcon::Mode mode,
return result;
}
+QPixmap QAbstractFileIconEngine::scaledPixmap(const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale)
+{
+ Q_UNUSED(scale); // (size is pre-multiplied by scale)
+ return pixmap(size, mode, state);
+}
+
QSize QAbstractFileIconEngine::actualSize(const QSize &size, QIcon::Mode mode,
QIcon::State state)
{
diff --git a/src/gui/image/qabstractfileiconengine_p.h b/src/gui/image/qabstractfileiconengine_p.h
index 865da58f15..eccc83a4fe 100644
--- a/src/gui/image/qabstractfileiconengine_p.h
+++ b/src/gui/image/qabstractfileiconengine_p.h
@@ -64,6 +64,7 @@ public:
: QPixmapIconEngine(), m_fileInfo(info), m_options(opts) {}
QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State) override;
+ QPixmap scaledPixmap(const QSize &size, QIcon::Mode mode, QIcon::State, qreal scale) override;
QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
QFileInfo fileInfo() const { return m_fileInfo; }