aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-04-23 10:04:28 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-23 11:26:14 +0200
commit5f7ba49e2501286670e19ee8ba7d48b169fa3330 (patch)
treef15759630065bae0370a8980abb373beb486bb3e /src/quick/items/qquicktextinput.cpp
parente865df80a907ceb3354a3369f9467022f451d692 (diff)
TextInput: Fix cursor navigation with mask
text().length() was used to check if a cursor movement to the right was valid. The problem is that with a mask and not text set yet (inputMask: "#0:00;*") pressing the right arrow would not move the cursor. The input and other functions use the actual d->m_text since that includes the mask length. Task-number: QTBUG-30740 Change-Id: Ic225778e5a49d80b754b63d0eb4a438eaa9818e2 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/quick/items/qquicktextinput.cpp')
-rw-r--r--src/quick/items/qquicktextinput.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 0d0d0a17e0..65a0d6215a 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -1470,7 +1470,7 @@ void QQuickTextInput::keyPressEvent(QKeyEvent* ev)
int cursorPosition = d->m_cursor;
if (cursorPosition == 0)
ignore = ev->key() == (d->layoutDirection() == Qt::LeftToRight ? Qt::Key_Left : Qt::Key_Right);
- if (!ignore && cursorPosition == text().length())
+ if (!ignore && cursorPosition == d->m_text.length())
ignore = ev->key() == (d->layoutDirection() == Qt::LeftToRight ? Qt::Key_Right : Qt::Key_Left);
}
if (ignore) {