From 376c9c9ae36dab06cf933dbd5d759dc0f40367b0 Mon Sep 17 00:00:00 2001 From: Risto Avila Date: Tue, 11 Mar 2014 11:58:11 +0200 Subject: Makes QPlatformTheme::PasswordMaskDelay themable using QStyle Creates new themable setting SH_LineEdit_PasswordMaskDelay which can be used to override QPlatformTheme::PasswordMaskDelay. SH_LineEdit_PasswordMaskDelay defines number in ms which the password character is visible when echoMode is set to Password [ChangeLog][General][QStyle] Creates a new themable variable SH_LineEdit_PasswordMaskDelay Change-Id: I26f0ddfda2b49bc293e00e8fcf62260cf4896ab2 Reviewed-by: Friedemann Kleint Reviewed-by: J-P Nurmi Reviewed-by: Jerome Pasion Reviewed-by: Jens Bache-Wiig --- src/widgets/widgets/qwidgetlinecontrol.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/widgets/widgets/qwidgetlinecontrol.cpp') diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index b16477246f..1f70dd719b 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -355,8 +355,10 @@ void QWidgetLineControl::init(const QString &txt) m_text = txt; updateDisplayText(); m_cursor = m_text.length(); - if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) + if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) { m_keyboardScheme = theme->themeHint(QPlatformTheme::KeyboardScheme).toInt(); + m_passwordMaskDelay = theme->themeHint(QPlatformTheme::PasswordMaskDelay).toInt(); + } // Generalize for X11 if (m_keyboardScheme == QPlatformTheme::KdeKeyboardScheme || m_keyboardScheme == QPlatformTheme::GnomeKeyboardScheme @@ -787,7 +789,7 @@ void QWidgetLineControl::internalInsert(const QString &s) if (m_echoMode == QLineEdit::Password) { if (m_passwordEchoTimer != 0) killTimer(m_passwordEchoTimer); - int delay = qGuiApp->styleHints()->passwordMaskDelay(); + int delay = m_passwordMaskDelay; #ifdef QT_BUILD_INTERNAL if (m_passwordMaskDelayOverride >= 0) delay = m_passwordMaskDelayOverride; -- cgit v1.2.3