summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextcursor.cpp
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2010-01-07 23:30:02 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2010-01-07 23:30:02 (GMT)
commit3f3e86d6fce5bb781bc41def35d0f15c58ef769c (patch)
treef79a0317d168a1961c11c2b8f3b772029e2902e1 /src/gui/text/qtextcursor.cpp
parentdbbf451755d34be44f6b7ac2e7c03ffe5528fb1b (diff)
parenta3c1b0703575ed5fc364011c73dc104ecdb8ef0c (diff)
downloadQt-3f3e86d6fce5bb781bc41def35d0f15c58ef769c.zip
Qt-3f3e86d6fce5bb781bc41def35d0f15c58ef769c.tar.gz
Qt-3f3e86d6fce5bb781bc41def35d0f15c58ef769c.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-multimedia-team into 4.6
Diffstat (limited to 'src/gui/text/qtextcursor.cpp')
-rw-r--r--src/gui/text/qtextcursor.cpp55
1 files changed, 29 insertions, 26 deletions
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index ce62834..f1dbf23 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -862,27 +862,28 @@ QTextLayout *QTextCursorPrivate::blockLayout(QTextBlock &block) const{
\ingroup richtext-processing
\ingroup shared
-
- Text cursors are objects that are used to access and modify the contents
- and underlying structure of text documents via a programming interface
- that mimics the behavior of a cursor in a text editor. QTextCursor contains
- information about both the cursor's position within a QTextDocument and any
- selection that it has made.
+ Text cursors are objects that are used to access and modify the
+ contents and underlying structure of text documents via a
+ programming interface that mimics the behavior of a cursor in a
+ text editor. QTextCursor contains information about both the
+ cursor's position within a QTextDocument and any selection that it
+ has made.
QTextCursor is modeled on the way a text cursor behaves in a text
- editor, providing a programmatic means of performing standard actions
- through the user interface. A document can be thought of as a
- single string of characters with the cursor's position() being \e
- between any two characters (or at the very beginning or very end
- of the document). Documents can also contain tables, lists,
- images, and other objects in addition to text but, from the developer's
- point of view, the document can be treated as one long string.
- Some portions of that string can be considered to lie within particular
- blocks (e.g. paragraphs), or within a table's cell, or a list's item,
- or other structural elements. When we refer to "current character" we
- mean the character immediately after the cursor position() in the
- document; similarly the "current block" is the block that contains the
- cursor position().
+ editor, providing a programmatic means of performing standard
+ actions through the user interface. A document can be thought of
+ as a single string of characters. The cursor's current position()
+ then is always either \e between two consecutive characters in the
+ string, or else \e before the very first character or \e after the
+ very last character in the string. Documents can also contain
+ tables, lists, images, and other objects in addition to text but,
+ from the developer's point of view, the document can be treated as
+ one long string. Some portions of that string can be considered
+ to lie within particular blocks (e.g. paragraphs), or within a
+ table's cell, or a list's item, or other structural elements. When
+ we refer to "current character" we mean the character immediately
+ \e before the cursor position() in the document. Similarly, the
+ "current block" is the block that contains the cursor position().
A QTextCursor also has an anchor() position. The text that is
between the anchor() and the position() is the selection. If
@@ -940,11 +941,12 @@ QTextLayout *QTextCursorPrivate::blockLayout(QTextBlock &block) const{
undo/redo) using beginEditBlock() and endEditBlock().
Cursor movements are limited to valid cursor positions. In Latin
- writing this is usually after every character in the text. In some
- other writing systems cursor movements are limited to "clusters"
- (e.g. a syllable in Devanagari, or a base letter plus diacritics).
- Functions such as movePosition() and deleteChar() limit cursor
- movement to these valid positions.
+ writing this is between any two consecutive characters in the
+ text, before the first character, or after the last character. In
+ some other writing systems cursor movements are limited to
+ "clusters" (e.g. a syllable in Devanagari, or a base letter plus
+ diacritics). Functions such as movePosition() and deleteChar()
+ limit cursor movement to these valid positions.
\sa \link richtext.html Rich Text Processing\endlink
@@ -1739,8 +1741,9 @@ void QTextCursor::mergeBlockCharFormat(const QTextCharFormat &modifier)
}
/*!
- Returns the format of the character immediately before the cursor position(). If the cursor is
- positioned at the beginning of a text block that is not empty then the format of the character
+ Returns the format of the character immediately before the cursor
+ position(). If the cursor is positioned at the beginning of a text
+ block that is not empty then the format of the character
immediately after the cursor is returned.
\sa insertText(), blockFormat()