diff options
author | Michael Brasser <michael.brasser@live.com> | 2013-11-06 19:32:45 -0600 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-15 19:05:27 +0100 |
commit | 42aacbf5eb0f43556be500d52fbbce106f32b049 (patch) | |
tree | c2a2896d2ef132e0d20f4f06e3f93ab8bd92d9f8 /src/gui/kernel/qplatformtheme.cpp | |
parent | f59e29d9bfab2863b29769e318ae96f4640bd768 (diff) | |
download | qtbase-42aacbf5eb0f43556be500d52fbbce106f32b049.tar.gz |
Improve interaction between QPlatformTheme and QPlatformIntegration hinting.
Ensure that custom style hints returned by subclassed
QPlatformIntegration::styleHints() are used if not explicitly overridden
by subclassed QPlatformTheme::themHints().
Task-number: QTBUG-34589
Change-Id: I0a3114cb00b532d2a5cd40941eca192b32412bcf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/gui/kernel/qplatformtheme.cpp')
-rw-r--r-- | src/gui/kernel/qplatformtheme.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index 562df1c913..1844232efe 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -50,6 +50,7 @@ #include <qtextformat.h> #include <private/qiconloader_p.h> #include <private/qguiapplication_p.h> +#include <qpa/qplatformintegration.h> QT_BEGIN_NAMESPACE @@ -399,7 +400,32 @@ QPixmap QPlatformTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF & QVariant QPlatformTheme::themeHint(ThemeHint hint) const { - return QPlatformTheme::defaultThemeHint(hint); + // For theme hints which mirror platform integration style hints, query + // the platform integration. The base QPlatformIntegration::styleHint() + // function will in turn query QPlatformTheme::defaultThemeHint() if there + // is no custom value. + switch (hint) { + case QPlatformTheme::CursorFlashTime: + return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::CursorFlashTime); + case QPlatformTheme::KeyboardInputInterval: + return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::KeyboardInputInterval); + case QPlatformTheme::KeyboardAutoRepeatRate: + return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::KeyboardAutoRepeatRate); + case QPlatformTheme::MouseDoubleClickInterval: + return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::MouseDoubleClickInterval); + case QPlatformTheme::StartDragDistance: + return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::StartDragDistance); + case QPlatformTheme::StartDragTime: + return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::StartDragTime); + case QPlatformTheme::StartDragVelocity: + return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::StartDragVelocity); + case QPlatformTheme::PasswordMaskDelay: + return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::PasswordMaskDelay); + case QPlatformTheme::PasswordMaskCharacter: + return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::PasswordMaskCharacter); + default: + return QPlatformTheme::defaultThemeHint(hint); + } } QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) |