diff options
author | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2012-10-10 13:58:19 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-16 15:29:15 +0200 |
commit | c3b939818af214392505c58b93d5f8df46fa09d8 (patch) | |
tree | c52ffb1de9ad3cd9fda641b454a5979dfeb98426 /src/gui/kernel/qplatformtheme.cpp | |
parent | c153f471d2b45ea0fbe9848b59403807c1cd37ab (diff) |
QPA: Introducing QPlatformTheme standardPixmap(), fileIconPixmap()
The basic idea is that the platform theme is now responsible for
providing the pixmaps for the given standard name, or any file or
directory. Then, the QStyle implementation should query the platform
theme for the pixmaps, and build the icons accordingly using
ThemeHint::IconPixmapSizes. Same thing for QFileIconProvider. This
also opens future support for getting platform dependent pixmaps in
QtQuick components.
Also includes the implementation for the Cocoa (QCocoaTheme) and
Windows (QWindowsTheme) platform plugins.
Task-number: QTBUG-27450
Change-Id: I4e8406585d970a9af481be10f6643cf0abbc38a3
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/gui/kernel/qplatformtheme.cpp')
-rw-r--r-- | src/gui/kernel/qplatformtheme.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index b91d3d0281..2e896eecf4 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -43,6 +43,7 @@ #include <QtCore/QVariant> #include <QtCore/QStringList> +#include <QtCore/qfileinfo.h> #include <qpalette.h> #include <qtextformat.h> @@ -164,6 +165,22 @@ const QFont *QPlatformTheme::font(Font type) const return 0; } +QPixmap QPlatformTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) const +{ + Q_UNUSED(sp); + Q_UNUSED(size); + // TODO Should return QCommonStyle pixmaps? + return QPixmap(); +} + +QPixmap QPlatformTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size) const +{ + Q_UNUSED(fileInfo); + Q_UNUSED(size); + // TODO Should return QCommonStyle pixmaps? + return QPixmap(); +} + QVariant QPlatformTheme::themeHint(ThemeHint hint) const { return QPlatformTheme::defaultThemeHint(hint); @@ -223,6 +240,8 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) return QVariant(int(QTextCharFormat::SpellCheckUnderline)); case TabAllWidgets: return QVariant(true); + case IconPixmapSizes: + return QVariant::fromValue(QList<int>()); } return QVariant(); } |