aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput.cpp
diff options
context:
space:
mode:
authorJaishree Vyas <Jaishree.Vyas@qt.io>2022-03-28 15:24:55 +0200
committerJaishree Vyas <Jaishree.Vyas@qt.io>2022-03-29 13:21:40 +0200
commit79807f37b5e9e9744fdaf7af380fd7bfb7ed85f4 (patch)
treeb0a71cd24081566f83b165e4c349864f46551e62 /src/quick/items/qquicktextinput.cpp
parent864dade139242f8ef8bb208d899fa8264cfb91f3 (diff)
Doc: Improve cursorPosition description in TextInput and TextEdit docs
Fixes: QTBUG-97169 Pick-to: 5.15 6.2 6.3 6.3.0 Change-Id: I060be767dd980c489d8e5426d67f2e8b6d21e96c Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ivan Tkachenko <me@ratijas.tk> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/quick/items/qquicktextinput.cpp')
-rw-r--r--src/quick/items/qquicktextinput.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 3978bf2890..2a136bf8d4 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -830,7 +830,20 @@ void QQuickTextInput::setCursorVisible(bool on)
/*!
\qmlproperty int QtQuick::TextInput::cursorPosition
- The position of the cursor in the TextInput.
+ The position of the cursor in the TextInput. The cursor is positioned between
+ characters.
+
+ \note The \e characters in this case refer to the string of \l QChar objects,
+ therefore 16-bit Unicode characters, and the position is considered an index
+ into this string. This does not necessarily correspond to individual graphemes
+ in the writing system, as a single grapheme may be represented by multiple
+ Unicode characters, such as in the case of surrogate pairs, linguistic
+ ligatures or diacritics.
+
+ \l displayText is different if echoMode is set to \l TextInput.Password: then
+ each passwordMaskCharacter is a "narrow" character
+ (the cursorPosition always moves by 1), even if the text in the TextInput is not.
+
*/
int QQuickTextInput::cursorPosition() const
{