From 462b36c3dee591bd964670dc614b995ece335331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 11 Aug 2020 22:35:55 +0200 Subject: QIconEngine: move away from virtual_hook usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upgrade existing functions to be virtual functions: - virtual QString iconName() - virtual bool isNull() - virtual QPixmap scaledPixmap(...) - virtual QList availableSizes(...) Make all of them non-const and remove the const_casts in the implementation. Keep the default implementation which calls virtual_hook(), for compatibility. Note: availableSizes was already virtual, but now loses the “const”. Port two overrides in the platform themes. Keep virutal_hook() around for future expansion. Task-number: QTBUG-85885 Change-Id: I76d0c9f75bfd6ca870c669047d4ef18b82c692e5 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/windows/qwindowstheme.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows') diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index ea74d8e372..0c778ecd24 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -888,7 +888,7 @@ public: explicit QWindowsFileIconEngine(const QFileInfo &info, QPlatformTheme::IconOptions opts) : QAbstractFileIconEngine(info, opts) {} - QList availableSizes(QIcon::Mode = QIcon::Normal, QIcon::State = QIcon::Off) const override + QList availableSizes(QIcon::Mode = QIcon::Normal, QIcon::State = QIcon::Off) override { return QWindowsTheme::instance()->availableFileIconSizes(); } protected: -- cgit v1.2.3