diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-08-17 03:27:49 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-08-17 03:27:49 (GMT) |
commit | 0940b13ba7eb7420588b968eb392825e88981308 (patch) | |
tree | 448d6ce7bd977a602b4fe98658608281b03ee7ba /src | |
parent | 6e39638936503b6898769ffe3ab0d5e7e6718b23 (diff) | |
parent | b98e9e69dd8ba33d5f01b9518d95b63b86c4b443 (diff) | |
download | Qt-0940b13ba7eb7420588b968eb392825e88981308.zip Qt-0940b13ba7eb7420588b968eb392825e88981308.tar.gz Qt-0940b13ba7eb7420588b968eb392825e88981308.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Fix delayed password masking mid-string.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qlinecontrol.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index a879b49..198bc04 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE #ifdef QT_GUI_PASSWORD_ECHO_DELAY -static int qt_passwordEchoDelay = QT_GUI_PASSWORD_ECHO_DELAY; +static const int qt_passwordEchoDelay = QT_GUI_PASSWORD_ECHO_DELAY; #endif /*! @@ -93,8 +93,8 @@ void QLineControl::updateDisplayText(bool forceUpdate) if (m_echoMode == QLineEdit::Password) { str.fill(m_passwordCharacter); #ifdef QT_GUI_PASSWORD_ECHO_DELAY - if (m_passwordEchoTimer != 0 && !str.isEmpty()) { - int cursor = m_text.length() - 1; + if (m_passwordEchoTimer != 0 && m_cursor > 0 && m_cursor <= m_text.length()) { + int cursor = m_cursor - 1; QChar uc = m_text.at(cursor); str[cursor] = uc; if (cursor > 0 && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) { |