From fc3207dfe1b615a856b6ad8eef22a8774e4a17f4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Jul 2012 09:54:50 +0200 Subject: Mirror potentially themeable style hints in QPlatformTheme. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, most of the QStyleHint-values are potentially configureable by the user in certain desktop environments. Add them to the QPlatformTheme and query the theme first. Keep the values in QPlatformIntegration such that simple integrations that do not implement themes are not forced to implement them to change the values. Change-Id: I15742a5968df0ad5d7398cceae640dc7e541da52 Reviewed-by: David Faure Reviewed-by: Jørgen Lind --- src/gui/kernel/qplatformtheme.cpp | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/gui/kernel/qplatformtheme.cpp') diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index d1ca8b740f..14336ab42b 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -63,6 +63,30 @@ QT_BEGIN_NAMESPACE This enum describes the available theme hints. + \value CursorFlashTime (int) Cursor flash time in ms, overriding + QPlatformIntegration::styleHint. + + \value KeyboardInputInterval (int) Keyboard input interval in ms, overriding + QPlatformIntegration::styleHint. + + \value MouseDoubleClickInterval (int) Mouse double click interval in ms, + overriding QPlatformIntegration::styleHint. + + \value StartDragDistance (int) Start drag distance, + overriding QPlatformIntegration::styleHint. + + \value StartDragTime (int) Start drag time in ms,, + overriding QPlatformIntegration::styleHint. + + \value KeyboardAutoRepeatRate (int) Keyboard auto repeat rate, + overriding QPlatformIntegration::styleHint. + + \value PasswordMaskDelay (int) Pass word mask delay in ms,, + overriding QPlatformIntegration::styleHint. + + \value StartDragVelocity (int) Velocity of a drag, + overriding QPlatformIntegration::styleHint. + \value TextCursorWidth (int) Determines the width of the text cursor. \value DropShadow (bool) Determines whether the drop shadow effect for @@ -138,8 +162,29 @@ const QFont *QPlatformTheme::font(Font type) const } QVariant QPlatformTheme::themeHint(ThemeHint hint) const +{ + return QPlatformTheme::defaultThemeHint(hint); +} + +QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) { switch (hint) { + case QPlatformTheme::CursorFlashTime: + return QVariant(1000); + case QPlatformTheme::KeyboardInputInterval: + return QVariant(400); + case QPlatformTheme::KeyboardAutoRepeatRate: + return QVariant(30); + case QPlatformTheme::MouseDoubleClickInterval: + return QVariant(400); + case QPlatformTheme::StartDragDistance: + return QVariant(10); + case QPlatformTheme::StartDragTime: + return QVariant(500); + case QPlatformTheme::PasswordMaskDelay: + return QVariant(int(0)); + case QPlatformTheme::StartDragVelocity: + return QVariant(int(0)); // no limit case QPlatformTheme::UseFullScreenForPopupMenu: return QVariant(false); case QPlatformTheme::WindowAutoPlacement: -- cgit v1.2.3