diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-07-27 14:00:14 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-08-05 08:06:21 +0000 |
commit | 2cd2cba0868efb7e8dd2d00805f1a5ceed0a1349 (patch) | |
tree | 7fff626ad15f65aeb09508559d82b94f97337714 /src/plugins/platforms/windows/qwindowstheme.h | |
parent | 955b2bdfc0cb1d707f8914be230e5e00c548b6ab (diff) |
QtPlatformSupport: Add QAbstractFileIconEngine
Move the code from QtWidgets/QFileIconEngine into a new class with
virtuals in QtPlatformSupport so that platforms can reuse it.
Prototypically use the class in the Windows and macOS QPA plugins.
Remove QPlatformTheme::fileIconPixmap() and change the type
of the hint QPlatformTheme::IconPixmapSizes from QList<int>
to QList<QSize> so that it fits better with the icon code.
Change-Id: I580e936f3507218757565ca099272cd575b3a779
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowstheme.h')
-rw-r--r-- | src/plugins/platforms/windows/qwindowstheme.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowstheme.h b/src/plugins/platforms/windows/qwindowstheme.h index fa1fb4d998..0384899efa 100644 --- a/src/plugins/platforms/windows/qwindowstheme.h +++ b/src/plugins/platforms/windows/qwindowstheme.h @@ -43,6 +43,7 @@ #include "qwindowsthreadpoolrunner.h" #include <qpa/qplatformtheme.h> +#include <QtCore/QSharedPointer> #include <QtCore/QVariant> QT_BEGIN_NAMESPACE @@ -66,12 +67,14 @@ public: { return m_fonts[type]; } QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const Q_DECL_OVERRIDE; - QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size, - QPlatformTheme::IconOptions iconOptions = 0) const Q_DECL_OVERRIDE; + + QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions = 0) const override; void windowsThemeChanged(QWindow *window); void displayChanged() { refreshIconPixmapSizes(); } + QList<QSize> availableFileIconSizes() const { return m_fileIconSizes; } + static const char *name; private: @@ -85,8 +88,8 @@ private: static QWindowsTheme *m_instance; QPalette *m_palettes[NPalettes]; QFont *m_fonts[NFonts]; - mutable QWindowsThreadPoolRunner m_threadPoolRunner; - QVariant m_fileIconSizes; + const QSharedPointer<QWindowsThreadPoolRunner> m_threadPoolRunner; + QList<QSize> m_fileIconSizes; }; QT_END_NAMESPACE |