summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformtheme.cpp
diff options
context:
space:
mode:
authorKevin Ottens <ervin@kde.org>2013-02-01 08:15:50 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-19 10:35:06 +0100
commitfc6b21436347f21c8a228bb0e256d946936095a2 (patch)
tree0669123527b1bd229498b5a8854871a958229d67 /src/gui/kernel/qplatformtheme.cpp
parent388f4f16b03949bbfc6bc8b18491ab16a43c484d (diff)
Let QPlatformTheme decide which engine QIcon::fromTheme uses
By default we still use QIconLoaderEngine but now platform theme plugins have the opportunity to override that. It is in particular planned to be used in a WIP platform theme plugin for KDE sessions. Change-Id: I07a82dc91daea44709b3a790f3f6e2a7a090d108 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/gui/kernel/qplatformtheme.cpp')
-rw-r--r--src/gui/kernel/qplatformtheme.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp
index ceb95c51e8..9f5c789a6e 100644
--- a/src/gui/kernel/qplatformtheme.cpp
+++ b/src/gui/kernel/qplatformtheme.cpp
@@ -46,6 +46,7 @@
#include <QtCore/qfileinfo.h>
#include <qpalette.h>
#include <qtextformat.h>
+#include <qiconloader_p.h>
QT_BEGIN_NAMESPACE
@@ -272,4 +273,19 @@ QPlatformSystemTrayIcon *QPlatformTheme::createPlatformSystemTrayIcon() const
}
#endif
+/*!
+ Factory function for the QIconEngine used by QIcon::fromTheme(). By default this
+ function returns a QIconLoaderEngine, but subclasses can reimplement it to
+ provide their own.
+
+ It is especially useful to benefit from some platform specific facilities or
+ optimizations like an inter-process cache in systems mostly built with Qt.
+
+ \since 5.1
+*/
+QIconEngine *QPlatformTheme::createIconEngine(const QString &iconName) const
+{
+ return new QIconLoaderEngine(iconName);
+}
+
QT_END_NAMESPACE