diff options
author | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-03-09 21:44:37 +0100 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-03-11 17:04:55 +0000 |
commit | a4c2e95ce16b3c4f9e0c9c983fb1ce9e70b5ce5a (patch) | |
tree | 8a652e75e5f384ebf490bf8de75ec869a4a6a788 /src/gui/image/qicon_p.h | |
parent | 6ef8387e42790d29ea8218f6c43514b2372e9ec6 (diff) |
Use own QIconEngine in QFileIconProvider
This allows us to lazily load icons from the platform theme
by reimplementing the pixmap(). Otherwise, we would instantiate
pixmaps in several sizes even though we would not need them
right away. Since, at least on OS X, icon sizes can go up to
128x128 pixels, we can end up saving an order of magnitude of
memory on icon pixmaps alone if we only use the smallest sizes
in our application.
Two side modifications are included. The first allows sub-
classing QPixmapIconEngine by exporting this class. The second
fixes the q_ptr in QFileIconProviderPrivate which was never set.
Change-Id: I91af322ded2823e475703871e607773177ae25d3
Task-number: QTBUG-41796
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/gui/image/qicon_p.h')
-rw-r--r-- | src/gui/image/qicon_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qicon_p.h b/src/gui/image/qicon_p.h index e0fec112b5..8b42e770fa 100644 --- a/src/gui/image/qicon_p.h +++ b/src/gui/image/qicon_p.h @@ -99,7 +99,7 @@ inline QPixmapIconEngineEntry::QPixmapIconEngineEntry(const QString &file, const pixmap.setDevicePixelRatio(1.0); } -class QPixmapIconEngine : public QIconEngine { +class Q_GUI_EXPORT QPixmapIconEngine : public QIconEngine { public: QPixmapIconEngine(); QPixmapIconEngine(const QPixmapIconEngine &); |