diff options
author | Tarja Sundqvist <tarja.sundqvist@digia.com> | 2012-05-25 08:39:08 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-25 17:23:20 +0200 |
commit | 7266e11297874736e54bc59fd3d4d827d03ce2e2 (patch) | |
tree | 6fb5f5e1bfa264b9e915f3cee5b54ea773b4813f /src/widgets | |
parent | 79ab7c170d8c6b6d3b148f983121717e71fefeea (diff) |
QTBUG-16850: QLineEdit::setSelection removes blank characters
Changed checking of the start position so that it does not call d->control->text() because this removes blank characters when an input mask is used. Thus the
selection fails. Instead d->control->end() is used for checking the start position.
Task-number: QTBUG-16850
Change-Id: I62992fb81bd47d432bade9f219782d48eb309956
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index a74c529202..27f47b754d 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -907,7 +907,7 @@ int QLineEdit::selectionStart() const void QLineEdit::setSelection(int start, int length) { Q_D(QLineEdit); - if (start < 0 || start > (int)d->control->text().length()) { + if (start < 0 || start > (int)d->control->end()) { qWarning("QLineEdit::setSelection: Invalid start position (%d)", start); return; } |