diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-05 01:00:49 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-05 01:00:49 +0200 |
commit | eb606d85b3f1548445cfd1fee43f882da88fb6e7 (patch) | |
tree | 8d878693d547f6db4641eff3178e2adf97ef98ea /src/gui/text | |
parent | 30e2bf8712596091c291615bcf9fdcbe58bf3504 (diff) | |
parent | e227c33455ef364353dd9f6d24934b9c35ff15ec (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: If4974bbf0a166de244dd57cb71b05fa28bcc34ce
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextcursor.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index 7719a2e6da..c88497840f 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -1145,6 +1145,15 @@ bool QTextCursor::isNull() const \a pos using a \c MoveMode specified by \a m. The cursor is positioned between characters. + \note The "characters" in this case refer to the string of QChar + objects, i.e. 16-bit Unicode characters, and \a pos 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. For a more + generic approach to navigating the document, use movePosition(), + which will respect the actual grapheme boundaries in the text. + \sa position(), movePosition(), anchor() */ void QTextCursor::setPosition(int pos, MoveMode m) @@ -1176,6 +1185,13 @@ void QTextCursor::setPosition(int pos, MoveMode m) Returns the absolute position of the cursor within the document. The cursor is positioned between characters. + \note The "characters" in this case refer to the string of QChar + objects, i.e. 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. + \sa setPosition(), movePosition(), anchor(), positionInBlock() */ int QTextCursor::position() const @@ -1192,6 +1208,13 @@ int QTextCursor::position() const This is equivalent to \c{ position() - block().position()}. + \note The "characters" in this case refer to the string of QChar + objects, i.e. 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. + \sa position() */ int QTextCursor::positionInBlock() const |