~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to .pc/debian-changes-4:4.7.1-0ubuntu7/doc/html/qtextcursor.html

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2011-01-18 20:37:32 UTC
  • Revision ID: james.westby@ubuntu.com-20110118203732-butn2uvaa6hydoqu
Tags: 4:4.7.1-0ubuntu8
Add kubuntu_26_dbusconnection_pointer.diff,
kubuntu_27_dbus_signal_filter_passes_not_handled.diff from Qt 4.8
to add a way to obtain the DBusConnectionpointer from a
QDBusConnection.  Requested by Ryan Lortie

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="UTF-8"?>
2
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
4
 
<head>
5
 
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
 
<!-- qtextcursor.cpp -->
7
 
  <title>Qt 4.7: QTextCursor Class Reference</title>
8
 
  <link rel="stylesheet" type="text/css" href="style/style.css" />
9
 
  <script src="scripts/jquery.js" type="text/javascript"></script>
10
 
  <script src="scripts/functions.js" type="text/javascript"></script>
11
 
</head>
12
 
<body class="offline narrow creator">
13
 
 <div class="header" id="qtdocheader">
14
 
    <div class="content"> 
15
 
    <div id="nav-logo">
16
 
      <a href="index.html">Home</a></div>
17
 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
18
 
    <div id="nav-topright">
19
 
      <ul>
20
 
        <li class="nav-topright-home"><a href="http://qt.nokia.com/">Qt HOME</a></li>
21
 
        <li class="nav-topright-dev"><a href="http://developer.qt.nokia.com/">DEV</a></li>
22
 
        <li class="nav-topright-labs"><a href="http://labs.qt.nokia.com/blogs/">LABS</a></li>
23
 
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://doc.qt.nokia.com/">
24
 
          DOC</a></li>
25
 
        <li class="nav-topright-blog"><a href="http://blog.qt.nokia.com/">BLOG</a></li>
26
 
      </ul>
27
 
    </div>
28
 
    <div id="shortCut">
29
 
      <ul>
30
 
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.7</a></span></li>
31
 
        <li class="shortCut-topleft-active"><a href="http://doc.qt.nokia.com">ALL VERSIONS        </a></li>
32
 
      </ul>
33
 
     </div>
34
 
 <ul class="sf-menu sf-js-enabled sf-shadow" id="narrowmenu"> 
35
 
                 <li><a href="#">API Lookup</a> 
36
 
                         <ul id="topmenuLook"> 
37
 
                           <li><a href="classes.html">Class index</a></li> 
38
 
                          <li><a href="functions.html">Function index</a></li> 
39
 
                           <li><a href="modules.html">Modules</a></li> 
40
 
                           <li><a href="namespaces.html">Namespaces</a></li> 
41
 
                           <li><a href="qtglobal.html">Global Declarations</a></li> 
42
 
                           <li><a href="licensing.html">Licenses and Credits</a></li> 
43
 
                           </ul> 
44
 
                 </li> 
45
 
                 <li><a href="#">Qt Topics</a> 
46
 
                         <ul id="topmenuTopic"> 
47
 
                           <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
48
 
                           <li><a href="qtquick.html">Device UI's &amp; Qt Quick</a></li> 
49
 
                           <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
50
 
                           <li><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li> 
51
 
                           <li><a href="platform-specific.html">Platform-specific info</a></li> 
52
 
                           <li><a href="technology-apis.html">Qt and Key Technologies</a></li> 
53
 
                           <li><a href="best-practices.html">How-To's and Best Practices</a></li> 
54
 
                         </ul> 
55
 
                </li> 
56
 
                 <li><a href="#">Examples</a> 
57
 
                         <ul id="topmenuexample"> 
58
 
                                 <li><a href="all-examples.html">Examples</a></li> 
59
 
                                 <li><a href="tutorials.html">Tutorials</a></li> 
60
 
                                 <li><a href="demos.html">Demos</a></li> 
61
 
                                 <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
62
 
                         </ul> 
63
 
                 </li> 
64
 
 </ul> 
65
 
    </div>
66
 
  </div>
67
 
  <div class="wrapper">
68
 
    <div class="hd">
69
 
      <span></span>
70
 
    </div>
71
 
    <div class="bd group">
72
 
      <div class="sidebar">
73
 
        <div class="searchlabel">
74
 
          Search index:</div>
75
 
        <div class="search">
76
 
          <form id="qtdocsearch" action="" onsubmit="return false;">
77
 
            <fieldset>
78
 
              <input type="text" name="searchstring" id="pageType" value="" />
79
 
            </fieldset>
80
 
          </form>
81
 
        </div>
82
 
        <div class="box first bottombar" id="lookup">
83
 
          <h2 title="API Lookup"><span></span>
84
 
            API Lookup</h2>
85
 
          <div  id="list001" class="list">
86
 
          <ul id="ul001" >
87
 
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
88
 
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
89
 
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
90
 
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
91
 
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
92
 
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
93
 
            </ul> 
94
 
          </div>
95
 
        </div>
96
 
        <div class="box bottombar" id="topics">
97
 
          <h2 title="Qt Topics"><span></span>
98
 
            Qt Topics</h2>
99
 
          <div id="list002" class="list">
100
 
            <ul id="ul002" >
101
 
                           <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
102
 
                           <li class="defaultLink"><a href="qtquick.html">Device UI's &amp; Qt Quick</a></li> 
103
 
                           <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
104
 
                           <li class="defaultLink"><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li> 
105
 
                           <li class="defaultLink"><a href="platform-specific.html">Platform-specific info</a></li> 
106
 
                           <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
107
 
                           <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
108
 
            </ul>  
109
 
          </div>
110
 
        </div>
111
 
        <div class="box" id="examples">
112
 
          <h2 title="Examples"><span></span>
113
 
            Examples</h2>
114
 
          <div id="list003" class="list">
115
 
        <ul id="ul003">
116
 
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
117
 
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
118
 
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
119
 
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
120
 
            </ul> 
121
 
          </div>
122
 
        </div>
123
 
      </div>
124
 
      <div class="wrap">
125
 
        <div class="toolbar">
126
 
          <div class="breadcrumb toolblock">
127
 
            <ul>
128
 
              <li class="first"><a href="index.html">Home</a></li>
129
 
              <!--  Bread crumbs goes here -->
130
 
              <li><a href="modules.html">Modules</a></li>              <li><a href="qtgui.html">QtGui</a></li>
131
 
              <li>QTextCursor</li>
132
 
            </ul>
133
 
          </div>
134
 
          <div class="toolbuttons toolblock">
135
 
            <ul>
136
 
              <li id="smallA" class="t_button">A</li>
137
 
              <li id="medA" class="t_button active">A</li>
138
 
              <li id="bigA" class="t_button">A</li>
139
 
              <li id="print" class="t_button"><a href="javascript:this.print();">
140
 
                <span>Print</span></a></li>
141
 
            </ul>
142
 
        </div>
143
 
        </div>
144
 
        <div class="content">
145
 
<div class="toc">
146
 
<h3><a name="toc">Contents</a></h3>
147
 
<ul>
148
 
<li class="level1"><a href="#public-types">Public Types</a></li>
149
 
<li class="level1"><a href="#public-functions">Public Functions</a></li>
150
 
<li class="level1"><a href="#details">Detailed Description</a></li>
151
 
</ul>
152
 
</div>
153
 
<h1 class="title">QTextCursor Class Reference</h1>
154
 
<!-- $$$QTextCursor-brief -->
155
 
<p>The QTextCursor class offers an API to access and modify QTextDocuments. <a href="#details">More...</a></p>
156
 
<!-- @@@QTextCursor -->
157
 
<pre class="highlightedCode brush: cpp"> #include &lt;QTextCursor&gt;</pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
158
 
<ul>
159
 
<li><a href="qtextcursor-members.html">List of all members, including inherited members</a></li>
160
 
</ul>
161
 
<a name="public-types"></a>
162
 
<h2>Public Types</h2>
163
 
<table class="alignedsummary">
164
 
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#MoveMode-enum">MoveMode</a></b> { MoveAnchor, KeepAnchor }</td></tr>
165
 
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#MoveOperation-enum">MoveOperation</a></b> { NoMove, Start, StartOfLine, StartOfBlock, ..., PreviousRow }</td></tr>
166
 
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#SelectionType-enum">SelectionType</a></b> { Document, BlockUnderCursor, LineUnderCursor, WordUnderCursor }</td></tr>
167
 
</table>
168
 
<a name="public-functions"></a>
169
 
<h2>Public Functions</h2>
170
 
<table class="alignedsummary">
171
 
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#QTextCursor">QTextCursor</a></b> ()</td></tr>
172
 
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#QTextCursor-2">QTextCursor</a></b> ( QTextDocument * <i>document</i> )</td></tr>
173
 
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#QTextCursor-4">QTextCursor</a></b> ( QTextFrame * <i>frame</i> )</td></tr>
174
 
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#QTextCursor-5">QTextCursor</a></b> ( const QTextBlock &amp; <i>block</i> )</td></tr>
175
 
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#QTextCursor-7">QTextCursor</a></b> ( const QTextCursor &amp; <i>cursor</i> )</td></tr>
176
 
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#dtor.QTextCursor">~QTextCursor</a></b> ()</td></tr>
177
 
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#anchor">anchor</a></b> () const</td></tr>
178
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#atBlockEnd">atBlockEnd</a></b> () const</td></tr>
179
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#atBlockStart">atBlockStart</a></b> () const</td></tr>
180
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#atEnd">atEnd</a></b> () const</td></tr>
181
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#atStart">atStart</a></b> () const</td></tr>
182
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#beginEditBlock">beginEditBlock</a></b> ()</td></tr>
183
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextBlock </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#block">block</a></b> () const</td></tr>
184
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextCharFormat </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#blockCharFormat">blockCharFormat</a></b> () const</td></tr>
185
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextBlockFormat </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#blockFormat">blockFormat</a></b> () const</td></tr>
186
 
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#blockNumber">blockNumber</a></b> () const</td></tr>
187
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextCharFormat </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#charFormat">charFormat</a></b> () const</td></tr>
188
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#clearSelection">clearSelection</a></b> ()</td></tr>
189
 
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#columnNumber">columnNumber</a></b> () const</td></tr>
190
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextList * </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#createList">createList</a></b> ( const QTextListFormat &amp; <i>format</i> )</td></tr>
191
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextList * </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#createList-2">createList</a></b> ( QTextListFormat::Style <i>style</i> )</td></tr>
192
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextFrame * </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#currentFrame">currentFrame</a></b> () const</td></tr>
193
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextList * </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#currentList">currentList</a></b> () const</td></tr>
194
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextTable * </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#currentTable">currentTable</a></b> () const</td></tr>
195
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#deleteChar">deleteChar</a></b> ()</td></tr>
196
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#deletePreviousChar">deletePreviousChar</a></b> ()</td></tr>
197
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextDocument * </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#document">document</a></b> () const</td></tr>
198
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#endEditBlock">endEditBlock</a></b> ()</td></tr>
199
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#hasComplexSelection">hasComplexSelection</a></b> () const</td></tr>
200
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#hasSelection">hasSelection</a></b> () const</td></tr>
201
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertBlock">insertBlock</a></b> ()</td></tr>
202
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertBlock-2">insertBlock</a></b> ( const QTextBlockFormat &amp; <i>format</i> )</td></tr>
203
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertBlock-3">insertBlock</a></b> ( const QTextBlockFormat &amp; <i>format</i>, const QTextCharFormat &amp; <i>charFormat</i> )</td></tr>
204
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertFragment">insertFragment</a></b> ( const QTextDocumentFragment &amp; <i>fragment</i> )</td></tr>
205
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextFrame * </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertFrame">insertFrame</a></b> ( const QTextFrameFormat &amp; <i>format</i> )</td></tr>
206
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertHtml">insertHtml</a></b> ( const QString &amp; <i>html</i> )</td></tr>
207
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertImage">insertImage</a></b> ( const QTextImageFormat &amp; <i>format</i> )</td></tr>
208
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertImage-2">insertImage</a></b> ( const QTextImageFormat &amp; <i>format</i>, QTextFrameFormat::Position <i>alignment</i> )</td></tr>
209
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertImage-3">insertImage</a></b> ( const QString &amp; <i>name</i> )</td></tr>
210
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertImage-4">insertImage</a></b> ( const QImage &amp; <i>image</i>, const QString &amp; <i>name</i> = QString() )</td></tr>
211
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextList * </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertList">insertList</a></b> ( const QTextListFormat &amp; <i>format</i> )</td></tr>
212
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextList * </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertList-2">insertList</a></b> ( QTextListFormat::Style <i>style</i> )</td></tr>
213
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextTable * </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertTable">insertTable</a></b> ( int <i>rows</i>, int <i>columns</i>, const QTextTableFormat &amp; <i>format</i> )</td></tr>
214
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextTable * </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertTable-2">insertTable</a></b> ( int <i>rows</i>, int <i>columns</i> )</td></tr>
215
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertText">insertText</a></b> ( const QString &amp; <i>text</i> )</td></tr>
216
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#insertText-2">insertText</a></b> ( const QString &amp; <i>text</i>, const QTextCharFormat &amp; <i>format</i> )</td></tr>
217
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#isCopyOf">isCopyOf</a></b> ( const QTextCursor &amp; <i>other</i> ) const</td></tr>
218
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#isNull">isNull</a></b> () const</td></tr>
219
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#joinPreviousEditBlock">joinPreviousEditBlock</a></b> ()</td></tr>
220
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#keepPositionOnInsert">keepPositionOnInsert</a></b> () const</td></tr>
221
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#mergeBlockCharFormat">mergeBlockCharFormat</a></b> ( const QTextCharFormat &amp; <i>modifier</i> )</td></tr>
222
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#mergeBlockFormat">mergeBlockFormat</a></b> ( const QTextBlockFormat &amp; <i>modifier</i> )</td></tr>
223
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#mergeCharFormat">mergeCharFormat</a></b> ( const QTextCharFormat &amp; <i>modifier</i> )</td></tr>
224
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#movePosition">movePosition</a></b> ( MoveOperation <i>operation</i>, MoveMode <i>mode</i> = MoveAnchor, int <i>n</i> = 1 )</td></tr>
225
 
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#position">position</a></b> () const</td></tr>
226
 
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#positionInBlock">positionInBlock</a></b> () const</td></tr>
227
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#removeSelectedText">removeSelectedText</a></b> ()</td></tr>
228
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#select">select</a></b> ( SelectionType <i>selection</i> )</td></tr>
229
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#selectedTableCells">selectedTableCells</a></b> ( int * <i>firstRow</i>, int * <i>numRows</i>, int * <i>firstColumn</i>, int * <i>numColumns</i> ) const</td></tr>
230
 
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#selectedText">selectedText</a></b> () const</td></tr>
231
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextDocumentFragment </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#selection">selection</a></b> () const</td></tr>
232
 
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#selectionEnd">selectionEnd</a></b> () const</td></tr>
233
 
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#selectionStart">selectionStart</a></b> () const</td></tr>
234
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#setBlockCharFormat">setBlockCharFormat</a></b> ( const QTextCharFormat &amp; <i>format</i> )</td></tr>
235
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#setBlockFormat">setBlockFormat</a></b> ( const QTextBlockFormat &amp; <i>format</i> )</td></tr>
236
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#setCharFormat">setCharFormat</a></b> ( const QTextCharFormat &amp; <i>format</i> )</td></tr>
237
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#setKeepPositionOnInsert">setKeepPositionOnInsert</a></b> ( bool <i>b</i> )</td></tr>
238
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#setPosition">setPosition</a></b> ( int <i>pos</i>, MoveMode <i>m</i> = MoveAnchor )</td></tr>
239
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#setVerticalMovementX">setVerticalMovementX</a></b> ( int <i>x</i> )</td></tr>
240
 
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#setVisualNavigation">setVisualNavigation</a></b> ( bool <i>b</i> )</td></tr>
241
 
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#verticalMovementX">verticalMovementX</a></b> () const</td></tr>
242
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#visualNavigation">visualNavigation</a></b> () const</td></tr>
243
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#operator-not-eq">operator!=</a></b> ( const QTextCursor &amp; <i>other</i> ) const</td></tr>
244
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#operator-lt">operator&lt;</a></b> ( const QTextCursor &amp; <i>other</i> ) const</td></tr>
245
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#operator-lt-eq">operator&lt;=</a></b> ( const QTextCursor &amp; <i>other</i> ) const</td></tr>
246
 
<tr><td class="memItemLeft rightAlign topAlign"> QTextCursor &amp; </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#operator-eq">operator=</a></b> ( const QTextCursor &amp; <i>cursor</i> )</td></tr>
247
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#operator-eq-eq">operator==</a></b> ( const QTextCursor &amp; <i>other</i> ) const</td></tr>
248
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#operator-gt">operator&gt;</a></b> ( const QTextCursor &amp; <i>other</i> ) const</td></tr>
249
 
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextcursor.html#operator-gt-eq">operator&gt;=</a></b> ( const QTextCursor &amp; <i>other</i> ) const</td></tr>
250
 
</table>
251
 
<a name="details"></a>
252
 
<!-- $$$QTextCursor-description -->
253
 
<div class="descr">
254
 
<h2>Detailed Description</h2>
255
 
<p>The QTextCursor class offers an API to access and modify QTextDocuments.</p>
256
 
<p>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 <a href="qtextdocument.html">QTextDocument</a> and any selection that it has made.</p>
257
 
<p>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. The cursor's current <a href="qtextcursor.html#position">position</a>() then is always either <i>between</i> two consecutive characters in the string, or else <i>before</i> the very first character or <i>after</i> 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&#x2e; paragraphs), or within a table's cell, or a list's item, or other structural elements. When we refer to &quot;current character&quot; we mean the character immediately <i>before</i> the cursor <a href="qtextcursor.html#position">position</a>() in the document. Similarly, the &quot;current block&quot; is the block that contains the cursor <a href="qtextcursor.html#position">position</a>().</p>
258
 
<p>A QTextCursor also has an <a href="qtextcursor.html#anchor">anchor</a>() position. The text that is between the <a href="qtextcursor.html#anchor">anchor</a>() and the <a href="qtextcursor.html#position">position</a>() is the selection. If <a href="qtextcursor.html#anchor">anchor</a>() == <a href="qtextcursor.html#position">position</a>() there is no selection.</p>
259
 
<p>The cursor position can be changed programmatically using <a href="qtextcursor.html#setPosition">setPosition</a>() and <a href="qtextcursor.html#movePosition">movePosition</a>(); the latter can also be used to select text. For selections see <a href="qtextcursor.html#selectionStart">selectionStart</a>(), <a href="qtextcursor.html#selectionEnd">selectionEnd</a>(), <a href="qtextcursor.html#hasSelection">hasSelection</a>(), <a href="qtextcursor.html#clearSelection">clearSelection</a>(), and <a href="qtextcursor.html#removeSelectedText">removeSelectedText</a>().</p>
260
 
<p>If the <a href="qtextcursor.html#position">position</a>() is at the start of a block <a href="qtextcursor.html#atBlockStart">atBlockStart</a>() returns true; and if it is at the end of a block <a href="qtextcursor.html#atBlockEnd">atBlockEnd</a>() returns true. The format of the current character is returned by <a href="qtextcursor.html#charFormat">charFormat</a>(), and the format of the current block is returned by <a href="qtextcursor.html#blockFormat">blockFormat</a>().</p>
261
 
<p>Formatting can be applied to the current text document using the <a href="qtextcursor.html#setCharFormat">setCharFormat</a>(), <a href="qtextcursor.html#mergeCharFormat">mergeCharFormat</a>(), <a href="qtextcursor.html#setBlockFormat">setBlockFormat</a>() and <a href="qtextcursor.html#mergeBlockFormat">mergeBlockFormat</a>() functions. The 'set' functions will replace the cursor's current character or block format, while the 'merge' functions add the given format properties to the cursor's current format. If the cursor has a selection the given format is applied to the current selection. Note that when only parts of a block is selected the block format is applied to the entire block. The text at the current character position can be turned into a list using <a href="qtextcursor.html#createList">createList</a>().</p>
262
 
<p>Deletions can be achieved using <a href="qtextcursor.html#deleteChar">deleteChar</a>(), <a href="qtextcursor.html#deletePreviousChar">deletePreviousChar</a>(), and <a href="qtextcursor.html#removeSelectedText">removeSelectedText</a>().</p>
263
 
<p>Text strings can be inserted into the document with the <a href="qtextcursor.html#insertText">insertText</a>() function, blocks (representing new paragraphs) can be inserted with <a href="qtextcursor.html#insertBlock">insertBlock</a>().</p>
264
 
<p>Existing fragments of text can be inserted with <a href="qtextcursor.html#insertFragment">insertFragment</a>() but, if you want to insert pieces of text in various formats, it is usually still easier to use <a href="qtextcursor.html#insertText">insertText</a>() and supply a character format.</p>
265
 
<p>Various types of higher-level structure can also be inserted into the document with the cursor:</p>
266
 
<ul>
267
 
<li>Lists are ordered sequences of block elements that are decorated with bullet points or symbols. These are inserted in a specified format with <a href="qtextcursor.html#insertList">insertList</a>().</li>
268
 
<li>Tables are inserted with the <a href="qtextcursor.html#insertTable">insertTable</a>() function, and can be given an optional format. These contain an array of cells that can be traversed using the cursor.</li>
269
 
<li>Inline images are inserted with <a href="qtextcursor.html#insertImage">insertImage</a>(). The image to be used can be specified in an image format, or by name.</li>
270
 
<li>Frames are inserted by calling <a href="qtextcursor.html#insertFrame">insertFrame</a>() with a specified format.</li>
271
 
</ul>
272
 
<p>Actions can be grouped (i.e&#x2e; treated as a single action for undo/redo) using <a href="qtextcursor.html#beginEditBlock">beginEditBlock</a>() and <a href="qtextcursor.html#endEditBlock">endEditBlock</a>().</p>
273
 
<p>Cursor movements are limited to valid cursor positions. In Latin 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 &quot;clusters&quot; (e.g&#x2e; a syllable in Devanagari, or a base letter plus diacritics). Functions such as <a href="qtextcursor.html#movePosition">movePosition</a>() and <a href="qtextcursor.html#deleteChar">deleteChar</a>() limit cursor movement to these valid positions.</p>
274
 
</div>
275
 
<p>See also <a href="richtext.html">Rich Text Processing</a>.</p>
276
 
<!-- @@@QTextCursor -->
277
 
<div class="types">
278
 
<h2>Member Type Documentation</h2>
279
 
<!-- $$$MoveMode$$$MoveAnchor$$$KeepAnchor -->
280
 
<h3 class="fn"><a name="MoveMode-enum"></a>enum QTextCursor::MoveMode</h3>
281
 
<table class="valuelist"><tr class="odd"><tr><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
282
 
<tr><td  class="topAlign"><tt>QTextCursor::MoveAnchor</tt></td><td class=" topAlign"><tt>0</tt></td><td  class="topAlign">Moves the anchor to the same position as the cursor itself.</td></tr>
283
 
<tr><td  class="topAlign"><tt>QTextCursor::KeepAnchor</tt></td><td class=" topAlign"><tt>1</tt></td><td  class="topAlign">Keeps the anchor where it is.</td></tr>
284
 
</table>
285
 
<p>If the <a href="qtextcursor.html#anchor">anchor</a>() is kept where it is and the <a href="qtextcursor.html#position">position</a>() is moved, the text in between will be selected.</p>
286
 
<!-- @@@MoveMode -->
287
 
<!-- $$$MoveOperation$$$NoMove$$$Start$$$Up$$$StartOfLine$$$StartOfBlock$$$StartOfWord$$$PreviousBlock$$$PreviousCharacter$$$PreviousWord$$$Left$$$WordLeft$$$End$$$Down$$$EndOfLine$$$EndOfWord$$$EndOfBlock$$$NextBlock$$$NextCharacter$$$NextWord$$$Right$$$WordRight$$$NextCell$$$PreviousCell$$$NextRow$$$PreviousRow -->
288
 
<h3 class="fn"><a name="MoveOperation-enum"></a>enum QTextCursor::MoveOperation</h3>
289
 
<table class="valuelist"><tr class="odd"><tr><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
290
 
<tr><td  class="topAlign"><tt>QTextCursor::NoMove</tt></td><td class=" topAlign"><tt>0</tt></td><td  class="topAlign">Keep the cursor where it is</td></tr>
291
 
<tr><td  class="topAlign"><tt>QTextCursor::Start</tt></td><td class=" topAlign"><tt>1</tt></td><td  class="topAlign">Move to the start of the document.</td></tr>
292
 
<tr><td  class="topAlign"><tt>QTextCursor::StartOfLine</tt></td><td class=" topAlign"><tt>3</tt></td><td  class="topAlign">Move to the start of the current line.</td></tr>
293
 
<tr><td  class="topAlign"><tt>QTextCursor::StartOfBlock</tt></td><td class=" topAlign"><tt>4</tt></td><td  class="topAlign">Move to the start of the current block.</td></tr>
294
 
<tr><td  class="topAlign"><tt>QTextCursor::StartOfWord</tt></td><td class=" topAlign"><tt>5</tt></td><td  class="topAlign">Move to the start of the current word.</td></tr>
295
 
<tr><td  class="topAlign"><tt>QTextCursor::PreviousBlock</tt></td><td class=" topAlign"><tt>6</tt></td><td  class="topAlign">Move to the start of the previous block.</td></tr>
296
 
<tr><td  class="topAlign"><tt>QTextCursor::PreviousCharacter</tt></td><td class=" topAlign"><tt>7</tt></td><td  class="topAlign">Move to the previous character.</td></tr>
297
 
<tr><td  class="topAlign"><tt>QTextCursor::PreviousWord</tt></td><td class=" topAlign"><tt>8</tt></td><td  class="topAlign">Move to the beginning of the previous word.</td></tr>
298
 
<tr><td  class="topAlign"><tt>QTextCursor::Up</tt></td><td class=" topAlign"><tt>2</tt></td><td  class="topAlign">Move up one line.</td></tr>
299
 
<tr><td  class="topAlign"><tt>QTextCursor::Left</tt></td><td class=" topAlign"><tt>9</tt></td><td  class="topAlign">Move left one character.</td></tr>
300
 
<tr><td  class="topAlign"><tt>QTextCursor::WordLeft</tt></td><td class=" topAlign"><tt>10</tt></td><td  class="topAlign">Move left one word.</td></tr>
301
 
<tr><td  class="topAlign"><tt>QTextCursor::End</tt></td><td class=" topAlign"><tt>11</tt></td><td  class="topAlign">Move to the end of the document.</td></tr>
302
 
<tr><td  class="topAlign"><tt>QTextCursor::EndOfLine</tt></td><td class=" topAlign"><tt>13</tt></td><td  class="topAlign">Move to the end of the current line.</td></tr>
303
 
<tr><td  class="topAlign"><tt>QTextCursor::EndOfWord</tt></td><td class=" topAlign"><tt>14</tt></td><td  class="topAlign">Move to the end of the current word.</td></tr>
304
 
<tr><td  class="topAlign"><tt>QTextCursor::EndOfBlock</tt></td><td class=" topAlign"><tt>15</tt></td><td  class="topAlign">Move to the end of the current block.</td></tr>
305
 
<tr><td  class="topAlign"><tt>QTextCursor::NextBlock</tt></td><td class=" topAlign"><tt>16</tt></td><td  class="topAlign">Move to the beginning of the next block.</td></tr>
306
 
<tr><td  class="topAlign"><tt>QTextCursor::NextCharacter</tt></td><td class=" topAlign"><tt>17</tt></td><td  class="topAlign">Move to the next character.</td></tr>
307
 
<tr><td  class="topAlign"><tt>QTextCursor::NextWord</tt></td><td class=" topAlign"><tt>18</tt></td><td  class="topAlign">Move to the next word.</td></tr>
308
 
<tr><td  class="topAlign"><tt>QTextCursor::Down</tt></td><td class=" topAlign"><tt>12</tt></td><td  class="topAlign">Move down one line.</td></tr>
309
 
<tr><td  class="topAlign"><tt>QTextCursor::Right</tt></td><td class=" topAlign"><tt>19</tt></td><td  class="topAlign">Move right one character.</td></tr>
310
 
<tr><td  class="topAlign"><tt>QTextCursor::WordRight</tt></td><td class=" topAlign"><tt>20</tt></td><td  class="topAlign">Move right one word.</td></tr>
311
 
<tr><td  class="topAlign"><tt>QTextCursor::NextCell</tt></td><td class=" topAlign"><tt>21</tt></td><td  class="topAlign">Move to the beginning of the next table cell inside the current table. If the current cell is the last cell in the row, the cursor will move to the first cell in the next row.</td></tr>
312
 
<tr><td  class="topAlign"><tt>QTextCursor::PreviousCell</tt></td><td class=" topAlign"><tt>22</tt></td><td  class="topAlign">Move to the beginning of the previous table cell inside the current table. If the current cell is the first cell in the row, the cursor will move to the last cell in the previous row.</td></tr>
313
 
<tr><td  class="topAlign"><tt>QTextCursor::NextRow</tt></td><td class=" topAlign"><tt>23</tt></td><td  class="topAlign">Move to the first new cell of the next row in the current table.</td></tr>
314
 
<tr><td  class="topAlign"><tt>QTextCursor::PreviousRow</tt></td><td class=" topAlign"><tt>24</tt></td><td  class="topAlign">Move to the last cell of the previous row in the current table.</td></tr>
315
 
</table>
316
 
<p>See also <a href="qtextcursor.html#movePosition">movePosition</a>().</p>
317
 
<!-- @@@MoveOperation -->
318
 
<!-- $$$SelectionType$$$WordUnderCursor$$$LineUnderCursor$$$BlockUnderCursor$$$Document -->
319
 
<h3 class="fn"><a name="SelectionType-enum"></a>enum QTextCursor::SelectionType</h3>
320
 
<p>This enum describes the types of selection that can be applied with the <a href="qtextcursor.html#select">select</a>() function.</p>
321
 
<table class="valuelist"><tr class="odd"><tr><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
322
 
<tr><td  class="topAlign"><tt>QTextCursor::Document</tt></td><td class=" topAlign"><tt>3</tt></td><td  class="topAlign">Selects the entire document.</td></tr>
323
 
<tr><td  class="topAlign"><tt>QTextCursor::BlockUnderCursor</tt></td><td class=" topAlign"><tt>2</tt></td><td  class="topAlign">Selects the block of text under the cursor.</td></tr>
324
 
<tr><td  class="topAlign"><tt>QTextCursor::LineUnderCursor</tt></td><td class=" topAlign"><tt>1</tt></td><td  class="topAlign">Selects the line of text under the cursor.</td></tr>
325
 
<tr><td  class="topAlign"><tt>QTextCursor::WordUnderCursor</tt></td><td class=" topAlign"><tt>0</tt></td><td  class="topAlign">Selects the word under the cursor. If the cursor is not positioned within a string of selectable characters, no text is selected.</td></tr>
326
 
</table>
327
 
<!-- @@@SelectionType -->
328
 
</div>
329
 
<div class="func">
330
 
<h2>Member Function Documentation</h2>
331
 
<!-- $$$QTextCursor[overload1]$$$QTextCursor -->
332
 
<h3 class="fn"><a name="QTextCursor"></a>QTextCursor::QTextCursor ()</h3>
333
 
<p>Constructs a null cursor.</p>
334
 
<!-- @@@QTextCursor -->
335
 
<!-- $$$QTextCursor$$$QTextCursorQTextDocument* -->
336
 
<h3 class="fn"><a name="QTextCursor-2"></a>QTextCursor::QTextCursor ( <a href="qtextdocument.html">QTextDocument</a> * <i>document</i> )</h3>
337
 
<p>Constructs a cursor pointing to the beginning of the <i>document</i>.</p>
338
 
<!-- @@@QTextCursor -->
339
 
<!-- $$$QTextCursor$$$QTextCursorQTextFrame* -->
340
 
<h3 class="fn"><a name="QTextCursor-4"></a>QTextCursor::QTextCursor ( <a href="qtextframe.html">QTextFrame</a> * <i>frame</i> )</h3>
341
 
<p>Constructs a cursor pointing to the beginning of the <i>frame</i>.</p>
342
 
<!-- @@@QTextCursor -->
343
 
<!-- $$$QTextCursor$$$QTextCursorconstQTextBlock& -->
344
 
<h3 class="fn"><a name="QTextCursor-5"></a>QTextCursor::QTextCursor ( const <a href="qtextblock.html">QTextBlock</a> &amp; <i>block</i> )</h3>
345
 
<p>Constructs a cursor pointing to the beginning of the <i>block</i>.</p>
346
 
<!-- @@@QTextCursor -->
347
 
<!-- $$$QTextCursor$$$QTextCursorconstQTextCursor& -->
348
 
<h3 class="fn"><a name="QTextCursor-7"></a>QTextCursor::QTextCursor ( const QTextCursor &amp; <i>cursor</i> )</h3>
349
 
<p>Constructs a new cursor that is a copy of <i>cursor</i>.</p>
350
 
<!-- @@@QTextCursor -->
351
 
<!-- $$$~QTextCursor[overload1]$$$~QTextCursor -->
352
 
<h3 class="fn"><a name="dtor.QTextCursor"></a>QTextCursor::~QTextCursor ()</h3>
353
 
<p>Destroys the <a href="qtextcursor.html">QTextCursor</a>.</p>
354
 
<!-- @@@~QTextCursor -->
355
 
<!-- $$$anchor[overload1]$$$anchor -->
356
 
<h3 class="fn"><a name="anchor"></a>int QTextCursor::anchor () const</h3>
357
 
<p>Returns the anchor position; this is the same as <a href="qtextcursor.html#position">position</a>() unless there is a selection in which case <a href="qtextcursor.html#position">position</a>() marks one end of the selection and anchor() marks the other end. Just like the cursor position, the anchor position is between characters.</p>
358
 
<p>See also <a href="qtextcursor.html#position">position</a>(), <a href="qtextcursor.html#setPosition">setPosition</a>(), <a href="qtextcursor.html#movePosition">movePosition</a>(), <a href="qtextcursor.html#selectionStart">selectionStart</a>(), and <a href="qtextcursor.html#selectionEnd">selectionEnd</a>().</p>
359
 
<!-- @@@anchor -->
360
 
<!-- $$$atBlockEnd[overload1]$$$atBlockEnd -->
361
 
<h3 class="fn"><a name="atBlockEnd"></a>bool QTextCursor::atBlockEnd () const</h3>
362
 
<p>Returns true if the cursor is at the end of a block; otherwise returns false.</p>
363
 
<p>See also <a href="qtextcursor.html#atBlockStart">atBlockStart</a>() and <a href="qtextcursor.html#atEnd">atEnd</a>().</p>
364
 
<!-- @@@atBlockEnd -->
365
 
<!-- $$$atBlockStart[overload1]$$$atBlockStart -->
366
 
<h3 class="fn"><a name="atBlockStart"></a>bool QTextCursor::atBlockStart () const</h3>
367
 
<p>Returns true if the cursor is at the start of a block; otherwise returns false.</p>
368
 
<p>See also <a href="qtextcursor.html#atBlockEnd">atBlockEnd</a>() and <a href="qtextcursor.html#atStart">atStart</a>().</p>
369
 
<!-- @@@atBlockStart -->
370
 
<!-- $$$atEnd[overload1]$$$atEnd -->
371
 
<h3 class="fn"><a name="atEnd"></a>bool QTextCursor::atEnd () const</h3>
372
 
<p>Returns true if the cursor is at the end of the document; otherwise returns false.</p>
373
 
<p>This function was introduced in Qt 4.6.</p>
374
 
<p>See also <a href="qtextcursor.html#atStart">atStart</a>() and <a href="qtextcursor.html#atBlockEnd">atBlockEnd</a>().</p>
375
 
<!-- @@@atEnd -->
376
 
<!-- $$$atStart[overload1]$$$atStart -->
377
 
<h3 class="fn"><a name="atStart"></a>bool QTextCursor::atStart () const</h3>
378
 
<p>Returns true if the cursor is at the start of the document; otherwise returns false.</p>
379
 
<p>See also <a href="qtextcursor.html#atBlockStart">atBlockStart</a>() and <a href="qtextcursor.html#atEnd">atEnd</a>().</p>
380
 
<!-- @@@atStart -->
381
 
<!-- $$$beginEditBlock[overload1]$$$beginEditBlock -->
382
 
<h3 class="fn"><a name="beginEditBlock"></a>void QTextCursor::beginEditBlock ()</h3>
383
 
<p>Indicates the start of a block of editing operations on the document that should appear as a single operation from an undo/redo point of view.</p>
384
 
<p>For example:</p>
385
 
<pre class="highlightedCode brush: cpp"> QTextCursor cursor(textDocument);
386
 
 cursor.beginEditBlock();
387
 
 cursor.insertText(&quot;Hello&quot;);
388
 
 cursor.insertText(&quot;World&quot;);
389
 
 cursor.endEditBlock();
390
 
 
391
 
 textDocument-&gt;undo();</pre>
392
 
<p>The call to undo() will cause both insertions to be undone, causing both &quot;World&quot; and &quot;Hello&quot; to be removed.</p>
393
 
<p>It is possible to nest calls to beginEditBlock and endEditBlock. The top-most pair will determine the scope of the undo/redo operation.</p>
394
 
<p>See also <a href="qtextcursor.html#endEditBlock">endEditBlock</a>().</p>
395
 
<!-- @@@beginEditBlock -->
396
 
<!-- $$$block[overload1]$$$block -->
397
 
<h3 class="fn"><a name="block"></a><a href="qtextblock.html">QTextBlock</a> QTextCursor::block () const</h3>
398
 
<p>Returns the block that contains the cursor.</p>
399
 
<!-- @@@block -->
400
 
<!-- $$$blockCharFormat[overload1]$$$blockCharFormat -->
401
 
<h3 class="fn"><a name="blockCharFormat"></a><a href="qtextcharformat.html">QTextCharFormat</a> QTextCursor::blockCharFormat () const</h3>
402
 
<p>Returns the block character format of the block the cursor is in.</p>
403
 
<p>The block char format is the format used when inserting text at the beginning of an empty block.</p>
404
 
<p>See also <a href="qtextcursor.html#setBlockCharFormat">setBlockCharFormat</a>().</p>
405
 
<!-- @@@blockCharFormat -->
406
 
<!-- $$$blockFormat[overload1]$$$blockFormat -->
407
 
<h3 class="fn"><a name="blockFormat"></a><a href="qtextblockformat.html">QTextBlockFormat</a> QTextCursor::blockFormat () const</h3>
408
 
<p>Returns the block format of the block the cursor is in.</p>
409
 
<p>See also <a href="qtextcursor.html#setBlockFormat">setBlockFormat</a>() and <a href="qtextcursor.html#charFormat">charFormat</a>().</p>
410
 
<!-- @@@blockFormat -->
411
 
<!-- $$$blockNumber[overload1]$$$blockNumber -->
412
 
<h3 class="fn"><a name="blockNumber"></a>int QTextCursor::blockNumber () const</h3>
413
 
<p>Returns the number of the block the cursor is in, or 0 if the cursor is invalid.</p>
414
 
<p>Note that this function only makes sense in documents without complex objects such as tables or frames.</p>
415
 
<p>This function was introduced in Qt 4.2.</p>
416
 
<!-- @@@blockNumber -->
417
 
<!-- $$$charFormat[overload1]$$$charFormat -->
418
 
<h3 class="fn"><a name="charFormat"></a><a href="qtextcharformat.html">QTextCharFormat</a> QTextCursor::charFormat () const</h3>
419
 
<p>Returns the format of the character immediately before the cursor <a href="qtextcursor.html#position">position</a>(). 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.</p>
420
 
<p>See also <a href="qtextcursor.html#setCharFormat">setCharFormat</a>(), <a href="qtextcursor.html#insertText">insertText</a>(), and <a href="qtextcursor.html#blockFormat">blockFormat</a>().</p>
421
 
<!-- @@@charFormat -->
422
 
<!-- $$$clearSelection[overload1]$$$clearSelection -->
423
 
<h3 class="fn"><a name="clearSelection"></a>void QTextCursor::clearSelection ()</h3>
424
 
<p>Clears the current selection by setting the anchor to the cursor position.</p>
425
 
<p>Note that it does <b>not</b> delete the text of the selection.</p>
426
 
<p>See also <a href="qtextcursor.html#removeSelectedText">removeSelectedText</a>() and <a href="qtextcursor.html#hasSelection">hasSelection</a>().</p>
427
 
<!-- @@@clearSelection -->
428
 
<!-- $$$columnNumber[overload1]$$$columnNumber -->
429
 
<h3 class="fn"><a name="columnNumber"></a>int QTextCursor::columnNumber () const</h3>
430
 
<p>Returns the position of the cursor within its containing line.</p>
431
 
<p>Note that this is the column number relative to a wrapped line, not relative to the block (i.e&#x2e; the paragraph).</p>
432
 
<p>You probably want to call <a href="qtextcursor.html#positionInBlock">positionInBlock</a>() instead.</p>
433
 
<p>This function was introduced in Qt 4.2.</p>
434
 
<p>See also <a href="qtextcursor.html#positionInBlock">positionInBlock</a>().</p>
435
 
<!-- @@@columnNumber -->
436
 
<!-- $$$createList[overload1]$$$createListconstQTextListFormat& -->
437
 
<h3 class="fn"><a name="createList"></a><a href="qtextlist.html">QTextList</a> * QTextCursor::createList ( const <a href="qtextlistformat.html">QTextListFormat</a> &amp; <i>format</i> )</h3>
438
 
<p>Creates and returns a new list with the given <i>format</i>, and makes the current paragraph the cursor is in the first list item.</p>
439
 
<p>See also <a href="qtextcursor.html#insertList">insertList</a>() and <a href="qtextcursor.html#currentList">currentList</a>().</p>
440
 
<!-- @@@createList -->
441
 
<!-- $$$createList$$$createListQTextListFormat::Style -->
442
 
<h3 class="fn"><a name="createList-2"></a><a href="qtextlist.html">QTextList</a> * QTextCursor::createList ( <a href="qtextlistformat.html#Style-enum">QTextListFormat::Style</a> <i>style</i> )</h3>
443
 
<p>This is an overloaded function.</p>
444
 
<p>Creates and returns a new list with the given <i>style</i>, making the cursor's current paragraph the first list item.</p>
445
 
<p>The style to be used is defined by the <a href="qtextlistformat.html#Style-enum">QTextListFormat::Style</a> enum.</p>
446
 
<p>See also <a href="qtextcursor.html#insertList">insertList</a>() and <a href="qtextcursor.html#currentList">currentList</a>().</p>
447
 
<!-- @@@createList -->
448
 
<!-- $$$currentFrame[overload1]$$$currentFrame -->
449
 
<h3 class="fn"><a name="currentFrame"></a><a href="qtextframe.html">QTextFrame</a> * QTextCursor::currentFrame () const</h3>
450
 
<p>Returns a pointer to the current frame. Returns 0 if the cursor is invalid.</p>
451
 
<p>See also <a href="qtextcursor.html#insertFrame">insertFrame</a>().</p>
452
 
<!-- @@@currentFrame -->
453
 
<!-- $$$currentList[overload1]$$$currentList -->
454
 
<h3 class="fn"><a name="currentList"></a><a href="qtextlist.html">QTextList</a> * QTextCursor::currentList () const</h3>
455
 
<p>Returns the current list if the cursor <a href="qtextcursor.html#position">position</a>() is inside a block that is part of a list; otherwise returns 0.</p>
456
 
<p>See also <a href="qtextcursor.html#insertList">insertList</a>() and <a href="qtextcursor.html#createList">createList</a>().</p>
457
 
<!-- @@@currentList -->
458
 
<!-- $$$currentTable[overload1]$$$currentTable -->
459
 
<h3 class="fn"><a name="currentTable"></a><a href="qtexttable.html">QTextTable</a> * QTextCursor::currentTable () const</h3>
460
 
<p>Returns a pointer to the current table if the cursor <a href="qtextcursor.html#position">position</a>() is inside a block that is part of a table; otherwise returns 0.</p>
461
 
<p>See also <a href="qtextcursor.html#insertTable">insertTable</a>().</p>
462
 
<!-- @@@currentTable -->
463
 
<!-- $$$deleteChar[overload1]$$$deleteChar -->
464
 
<h3 class="fn"><a name="deleteChar"></a>void QTextCursor::deleteChar ()</h3>
465
 
<p>If there is no selected text, deletes the character <i>at</i> the current cursor position; otherwise deletes the selected text.</p>
466
 
<p>See also <a href="qtextcursor.html#deletePreviousChar">deletePreviousChar</a>(), <a href="qtextcursor.html#hasSelection">hasSelection</a>(), and <a href="qtextcursor.html#clearSelection">clearSelection</a>().</p>
467
 
<!-- @@@deleteChar -->
468
 
<!-- $$$deletePreviousChar[overload1]$$$deletePreviousChar -->
469
 
<h3 class="fn"><a name="deletePreviousChar"></a>void QTextCursor::deletePreviousChar ()</h3>
470
 
<p>If there is no selected text, deletes the character <i>before</i> the current cursor position; otherwise deletes the selected text.</p>
471
 
<p>See also <a href="qtextcursor.html#deleteChar">deleteChar</a>(), <a href="qtextcursor.html#hasSelection">hasSelection</a>(), and <a href="qtextcursor.html#clearSelection">clearSelection</a>().</p>
472
 
<!-- @@@deletePreviousChar -->
473
 
<!-- $$$document[overload1]$$$document -->
474
 
<h3 class="fn"><a name="document"></a><a href="qtextdocument.html">QTextDocument</a> * QTextCursor::document () const</h3>
475
 
<p>Returns the document this cursor is associated with.</p>
476
 
<p>This function was introduced in Qt 4.5.</p>
477
 
<!-- @@@document -->
478
 
<!-- $$$endEditBlock[overload1]$$$endEditBlock -->
479
 
<h3 class="fn"><a name="endEditBlock"></a>void QTextCursor::endEditBlock ()</h3>
480
 
<p>Indicates the end of a block of editing operations on the document that should appear as a single operation from an undo/redo point of view.</p>
481
 
<p>See also <a href="qtextcursor.html#beginEditBlock">beginEditBlock</a>().</p>
482
 
<!-- @@@endEditBlock -->
483
 
<!-- $$$hasComplexSelection[overload1]$$$hasComplexSelection -->
484
 
<h3 class="fn"><a name="hasComplexSelection"></a>bool QTextCursor::hasComplexSelection () const</h3>
485
 
<p>Returns true if the cursor contains a selection that is not simply a range from <a href="qtextcursor.html#selectionStart">selectionStart</a>() to <a href="qtextcursor.html#selectionEnd">selectionEnd</a>(); otherwise returns false.</p>
486
 
<p>Complex selections are ones that span at least two cells in a table; their extent is specified by <a href="qtextcursor.html#selectedTableCells">selectedTableCells</a>().</p>
487
 
<!-- @@@hasComplexSelection -->
488
 
<!-- $$$hasSelection[overload1]$$$hasSelection -->
489
 
<h3 class="fn"><a name="hasSelection"></a>bool QTextCursor::hasSelection () const</h3>
490
 
<p>Returns true if the cursor contains a selection; otherwise returns false.</p>
491
 
<!-- @@@hasSelection -->
492
 
<!-- $$$insertBlock[overload1]$$$insertBlock -->
493
 
<h3 class="fn"><a name="insertBlock"></a>void QTextCursor::insertBlock ()</h3>
494
 
<p>Inserts a new empty block at the cursor <a href="qtextcursor.html#position">position</a>() with the current <a href="qtextcursor.html#blockFormat">blockFormat</a>() and <a href="qtextcursor.html#charFormat">charFormat</a>().</p>
495
 
<p>See also <a href="qtextcursor.html#setBlockFormat">setBlockFormat</a>().</p>
496
 
<!-- @@@insertBlock -->
497
 
<!-- $$$insertBlock$$$insertBlockconstQTextBlockFormat& -->
498
 
<h3 class="fn"><a name="insertBlock-2"></a>void QTextCursor::insertBlock ( const <a href="qtextblockformat.html">QTextBlockFormat</a> &amp; <i>format</i> )</h3>
499
 
<p>This is an overloaded function.</p>
500
 
<p>Inserts a new empty block at the cursor <a href="qtextcursor.html#position">position</a>() with block format <i>format</i> and the current <a href="qtextcursor.html#charFormat">charFormat</a>() as block char format.</p>
501
 
<p>See also <a href="qtextcursor.html#setBlockFormat">setBlockFormat</a>().</p>
502
 
<!-- @@@insertBlock -->
503
 
<!-- $$$insertBlock$$$insertBlockconstQTextBlockFormat&constQTextCharFormat& -->
504
 
<h3 class="fn"><a name="insertBlock-3"></a>void QTextCursor::insertBlock ( const <a href="qtextblockformat.html">QTextBlockFormat</a> &amp; <i>format</i>, const <a href="qtextcharformat.html">QTextCharFormat</a> &amp; <i>charFormat</i> )</h3>
505
 
<p>This is an overloaded function.</p>
506
 
<p>Inserts a new empty block at the cursor <a href="qtextcursor.html#position">position</a>() with block format <i>format</i> and <i>charFormat</i> as block char format.</p>
507
 
<p>See also <a href="qtextcursor.html#setBlockFormat">setBlockFormat</a>().</p>
508
 
<!-- @@@insertBlock -->
509
 
<!-- $$$insertFragment[overload1]$$$insertFragmentconstQTextDocumentFragment& -->
510
 
<h3 class="fn"><a name="insertFragment"></a>void QTextCursor::insertFragment ( const <a href="qtextdocumentfragment.html">QTextDocumentFragment</a> &amp; <i>fragment</i> )</h3>
511
 
<p>Inserts the text <i>fragment</i> at the current <a href="qtextcursor.html#position">position</a>().</p>
512
 
<!-- @@@insertFragment -->
513
 
<!-- $$$insertFrame[overload1]$$$insertFrameconstQTextFrameFormat& -->
514
 
<h3 class="fn"><a name="insertFrame"></a><a href="qtextframe.html">QTextFrame</a> * QTextCursor::insertFrame ( const <a href="qtextframeformat.html">QTextFrameFormat</a> &amp; <i>format</i> )</h3>
515
 
<p>Inserts a frame with the given <i>format</i> at the current cursor <a href="qtextcursor.html#position">position</a>(), moves the cursor <a href="qtextcursor.html#position">position</a>() inside the frame, and returns the frame.</p>
516
 
<p>If the cursor holds a selection, the whole selection is moved inside the frame.</p>
517
 
<p>See also <a href="qtextcursor.html#hasSelection">hasSelection</a>().</p>
518
 
<!-- @@@insertFrame -->
519
 
<!-- $$$insertHtml[overload1]$$$insertHtmlconstQString& -->
520
 
<h3 class="fn"><a name="insertHtml"></a>void QTextCursor::insertHtml ( const <a href="qstring.html">QString</a> &amp; <i>html</i> )</h3>
521
 
<p>Inserts the text <i>html</i> at the current <a href="qtextcursor.html#position">position</a>(). The text is interpreted as HTML.</p>
522
 
<p><b>Note:</b> When using this function with a style sheet, the style sheet will only apply to the current block in the document. In order to apply a style sheet throughout a document, use <a href="qtextdocument.html#defaultStyleSheet-prop">QTextDocument::setDefaultStyleSheet</a>() instead.</p>
523
 
<p>This function was introduced in Qt 4.2.</p>
524
 
<!-- @@@insertHtml -->
525
 
<!-- $$$insertImage[overload1]$$$insertImageconstQTextImageFormat& -->
526
 
<h3 class="fn"><a name="insertImage"></a>void QTextCursor::insertImage ( const <a href="qtextimageformat.html">QTextImageFormat</a> &amp; <i>format</i> )</h3>
527
 
<p>Inserts the image defined by <i>format</i> at the current <a href="qtextcursor.html#position">position</a>().</p>
528
 
<!-- @@@insertImage -->
529
 
<!-- $$$insertImage$$$insertImageconstQTextImageFormat&QTextFrameFormat::Position -->
530
 
<h3 class="fn"><a name="insertImage-2"></a>void QTextCursor::insertImage ( const <a href="qtextimageformat.html">QTextImageFormat</a> &amp; <i>format</i>, <a href="qtextframeformat.html#Position-enum">QTextFrameFormat::Position</a> <i>alignment</i> )</h3>
531
 
<p>This is an overloaded function.</p>
532
 
<p>Inserts the image defined by the given <i>format</i> at the cursor's current position with the specified <i>alignment</i>.</p>
533
 
<p>This function was introduced in Qt 4.2.</p>
534
 
<p>See also <a href="qtextcursor.html#position">position</a>().</p>
535
 
<!-- @@@insertImage -->
536
 
<!-- $$$insertImage$$$insertImageconstQString& -->
537
 
<h3 class="fn"><a name="insertImage-3"></a>void QTextCursor::insertImage ( const <a href="qstring.html">QString</a> &amp; <i>name</i> )</h3>
538
 
<p>This is an overloaded function.</p>
539
 
<p>Convenience method for inserting the image with the given <i>name</i> at the current <a href="qtextcursor.html#position">position</a>().</p>
540
 
<pre class="highlightedCode brush: cpp"> QImage img = ...
541
 
 textDocument-&gt;addResource(QTextDocument::ImageResource, QUrl(&quot;myimage&quot;), img);
542
 
 cursor.insertImage(&quot;myimage&quot;);</pre>
543
 
<!-- @@@insertImage -->
544
 
<!-- $$$insertImage$$$insertImageconstQImage&constQString& -->
545
 
<h3 class="fn"><a name="insertImage-4"></a>void QTextCursor::insertImage ( const <a href="qimage.html">QImage</a> &amp; <i>image</i>, const <a href="qstring.html">QString</a> &amp; <i>name</i> = QString() )</h3>
546
 
<p>This is an overloaded function.</p>
547
 
<p>Convenience function for inserting the given <i>image</i> with an optional <i>name</i> at the current <a href="qtextcursor.html#position">position</a>().</p>
548
 
<p>This function was introduced in Qt 4.5.</p>
549
 
<!-- @@@insertImage -->
550
 
<!-- $$$insertList[overload1]$$$insertListconstQTextListFormat& -->
551
 
<h3 class="fn"><a name="insertList"></a><a href="qtextlist.html">QTextList</a> * QTextCursor::insertList ( const <a href="qtextlistformat.html">QTextListFormat</a> &amp; <i>format</i> )</h3>
552
 
<p>Inserts a new block at the current position and makes it the first list item of a newly created list with the given <i>format</i>. Returns the created list.</p>
553
 
<p>See also <a href="qtextcursor.html#currentList">currentList</a>(), <a href="qtextcursor.html#createList">createList</a>(), and <a href="qtextcursor.html#insertBlock">insertBlock</a>().</p>
554
 
<!-- @@@insertList -->
555
 
<!-- $$$insertList$$$insertListQTextListFormat::Style -->
556
 
<h3 class="fn"><a name="insertList-2"></a><a href="qtextlist.html">QTextList</a> * QTextCursor::insertList ( <a href="qtextlistformat.html#Style-enum">QTextListFormat::Style</a> <i>style</i> )</h3>
557
 
<p>This is an overloaded function.</p>
558
 
<p>Inserts a new block at the current position and makes it the first list item of a newly created list with the given <i>style</i>. Returns the created list.</p>
559
 
<p>See also <a href="qtextcursor.html#currentList">currentList</a>(), <a href="qtextcursor.html#createList">createList</a>(), and <a href="qtextcursor.html#insertBlock">insertBlock</a>().</p>
560
 
<!-- @@@insertList -->
561
 
<!-- $$$insertTable[overload1]$$$insertTableintintconstQTextTableFormat& -->
562
 
<h3 class="fn"><a name="insertTable"></a><a href="qtexttable.html">QTextTable</a> * QTextCursor::insertTable ( int <i>rows</i>, int <i>columns</i>, const <a href="qtexttableformat.html">QTextTableFormat</a> &amp; <i>format</i> )</h3>
563
 
<p>Creates a new table with the given number of <i>rows</i> and <i>columns</i> in the specified <i>format</i>, inserts it at the current cursor <a href="qtextcursor.html#position">position</a>() in the document, and returns the table object. The cursor is moved to the beginning of the first cell.</p>
564
 
<p>There must be at least one row and one column in the table.</p>
565
 
<p>See also <a href="qtextcursor.html#currentTable">currentTable</a>().</p>
566
 
<!-- @@@insertTable -->
567
 
<!-- $$$insertTable$$$insertTableintint -->
568
 
<h3 class="fn"><a name="insertTable-2"></a><a href="qtexttable.html">QTextTable</a> * QTextCursor::insertTable ( int <i>rows</i>, int <i>columns</i> )</h3>
569
 
<p>This is an overloaded function.</p>
570
 
<p>Creates a new table with the given number of <i>rows</i> and <i>columns</i>, inserts it at the current cursor <a href="qtextcursor.html#position">position</a>() in the document, and returns the table object. The cursor is moved to the beginning of the first cell.</p>
571
 
<p>There must be at least one row and one column in the table.</p>
572
 
<p>See also <a href="qtextcursor.html#currentTable">currentTable</a>().</p>
573
 
<!-- @@@insertTable -->
574
 
<!-- $$$insertText[overload1]$$$insertTextconstQString& -->
575
 
<h3 class="fn"><a name="insertText"></a>void QTextCursor::insertText ( const <a href="qstring.html">QString</a> &amp; <i>text</i> )</h3>
576
 
<p>Inserts <i>text</i> at the current position, using the current character format.</p>
577
 
<p>If there is a selection, the selection is deleted and replaced by <i>text</i>, for example:</p>
578
 
<pre class="highlightedCode brush: cpp"> cursor.clearSelection();
579
 
 cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor);
580
 
 cursor.insertText(&quot;Hello World&quot;);</pre>
581
 
<p>This clears any existing selection, selects the word at the cursor (i.e&#x2e; from <a href="qtextcursor.html#position">position</a>() forward), and replaces the selection with the phrase &quot;Hello World&quot;.</p>
582
 
<p>Any ASCII linefeed characters (\n) in the inserted text are transformed into unicode block separators, corresponding to <a href="qtextcursor.html#insertBlock">insertBlock</a>() calls.</p>
583
 
<p>See also <a href="qtextcursor.html#charFormat">charFormat</a>() and <a href="qtextcursor.html#hasSelection">hasSelection</a>().</p>
584
 
<!-- @@@insertText -->
585
 
<!-- $$$insertText$$$insertTextconstQString&constQTextCharFormat& -->
586
 
<h3 class="fn"><a name="insertText-2"></a>void QTextCursor::insertText ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, const <a href="qtextcharformat.html">QTextCharFormat</a> &amp; <i>format</i> )</h3>
587
 
<p>This is an overloaded function.</p>
588
 
<p>Inserts <i>text</i> at the current position with the given <i>format</i>.</p>
589
 
<!-- @@@insertText -->
590
 
<!-- $$$isCopyOf[overload1]$$$isCopyOfconstQTextCursor& -->
591
 
<h3 class="fn"><a name="isCopyOf"></a>bool QTextCursor::isCopyOf ( const QTextCursor &amp; <i>other</i> ) const</h3>
592
 
<p>Returns true if this cursor and <i>other</i> are copies of each other, i.e&#x2e; one of them was created as a copy of the other and neither has moved since. This is much stricter than equality.</p>
593
 
<p>See also <a href="qtextcursor.html#operator-eq">operator=</a>() and <a href="qtextcursor.html#operator-eq-eq">operator==</a>().</p>
594
 
<!-- @@@isCopyOf -->
595
 
<!-- $$$isNull[overload1]$$$isNull -->
596
 
<h3 class="fn"><a name="isNull"></a>bool QTextCursor::isNull () const</h3>
597
 
<p>Returns true if the cursor is null; otherwise returns false. A null cursor is created by the default constructor.</p>
598
 
<!-- @@@isNull -->
599
 
<!-- $$$joinPreviousEditBlock[overload1]$$$joinPreviousEditBlock -->
600
 
<h3 class="fn"><a name="joinPreviousEditBlock"></a>void QTextCursor::joinPreviousEditBlock ()</h3>
601
 
<p>Like <a href="qtextcursor.html#beginEditBlock">beginEditBlock</a>() indicates the start of a block of editing operations that should appear as a single operation for undo/redo. However unlike <a href="qtextcursor.html#beginEditBlock">beginEditBlock</a>() it does not start a new block but reverses the previous call to <a href="qtextcursor.html#endEditBlock">endEditBlock</a>() and therefore makes following operations part of the previous edit block created.</p>
602
 
<p>For example:</p>
603
 
<pre class="highlightedCode brush: cpp"> QTextCursor cursor(textDocument);
604
 
 cursor.beginEditBlock();
605
 
 cursor.insertText(&quot;Hello&quot;);
606
 
 cursor.insertText(&quot;World&quot;);
607
 
 cursor.endEditBlock();
608
 
 
609
 
 ...
610
 
 
611
 
 cursor.joinPreviousEditBlock();
612
 
 cursor.insertText(&quot;Hey&quot;);
613
 
 cursor.endEditBlock();
614
 
 
615
 
 textDocument-&gt;undo();</pre>
616
 
<p>The call to undo() will cause all three insertions to be undone.</p>
617
 
<p>See also <a href="qtextcursor.html#beginEditBlock">beginEditBlock</a>() and <a href="qtextcursor.html#endEditBlock">endEditBlock</a>().</p>
618
 
<!-- @@@joinPreviousEditBlock -->
619
 
<!-- $$$keepPositionOnInsert[overload1]$$$keepPositionOnInsert -->
620
 
<h3 class="fn"><a name="keepPositionOnInsert"></a>bool QTextCursor::keepPositionOnInsert () const</h3>
621
 
<p>Returns whether the cursor should keep its current position when text gets inserted at the position of the cursor.</p>
622
 
<p>The default is false;</p>
623
 
<p>This function was introduced in Qt 4.7.</p>
624
 
<p>See also <a href="qtextcursor.html#setKeepPositionOnInsert">setKeepPositionOnInsert</a>().</p>
625
 
<!-- @@@keepPositionOnInsert -->
626
 
<!-- $$$mergeBlockCharFormat[overload1]$$$mergeBlockCharFormatconstQTextCharFormat& -->
627
 
<h3 class="fn"><a name="mergeBlockCharFormat"></a>void QTextCursor::mergeBlockCharFormat ( const <a href="qtextcharformat.html">QTextCharFormat</a> &amp; <i>modifier</i> )</h3>
628
 
<p>Modifies the block char format of the current block (or all blocks that are contained in the selection) with the block format specified by <i>modifier</i>.</p>
629
 
<p>See also <a href="qtextcursor.html#setBlockCharFormat">setBlockCharFormat</a>().</p>
630
 
<!-- @@@mergeBlockCharFormat -->
631
 
<!-- $$$mergeBlockFormat[overload1]$$$mergeBlockFormatconstQTextBlockFormat& -->
632
 
<h3 class="fn"><a name="mergeBlockFormat"></a>void QTextCursor::mergeBlockFormat ( const <a href="qtextblockformat.html">QTextBlockFormat</a> &amp; <i>modifier</i> )</h3>
633
 
<p>Modifies the block format of the current block (or all blocks that are contained in the selection) with the block format specified by <i>modifier</i>.</p>
634
 
<p>See also <a href="qtextcursor.html#setBlockFormat">setBlockFormat</a>() and <a href="qtextcursor.html#blockFormat">blockFormat</a>().</p>
635
 
<!-- @@@mergeBlockFormat -->
636
 
<!-- $$$mergeCharFormat[overload1]$$$mergeCharFormatconstQTextCharFormat& -->
637
 
<h3 class="fn"><a name="mergeCharFormat"></a>void QTextCursor::mergeCharFormat ( const <a href="qtextcharformat.html">QTextCharFormat</a> &amp; <i>modifier</i> )</h3>
638
 
<p>Merges the cursor's current character format with the properties described by format <i>modifier</i>. If the cursor has a selection, this function applies all the properties set in <i>modifier</i> to all the character formats that are part of the selection.</p>
639
 
<p>See also <a href="qtextcursor.html#hasSelection">hasSelection</a>() and <a href="qtextcursor.html#setCharFormat">setCharFormat</a>().</p>
640
 
<!-- @@@mergeCharFormat -->
641
 
<!-- $$$movePosition[overload1]$$$movePositionMoveOperationMoveModeint -->
642
 
<h3 class="fn"><a name="movePosition"></a>bool QTextCursor::movePosition ( <a href="qtextcursor.html#MoveOperation-enum">MoveOperation</a> <i>operation</i>, <a href="qtextcursor.html#MoveMode-enum">MoveMode</a> <i>mode</i> = MoveAnchor, int <i>n</i> = 1 )</h3>
643
 
<p>Moves the cursor by performing the given <i>operation</i> <i>n</i> times, using the specified <i>mode</i>, and returns true if all operations were completed successfully; otherwise returns false.</p>
644
 
<p>For example, if this function is repeatedly used to seek to the end of the next word, it will eventually fail when the end of the document is reached.</p>
645
 
<p>By default, the move operation is performed once (<i>n</i> = 1).</p>
646
 
<p>If <i>mode</i> is <tt>KeepAnchor</tt>, the cursor selects the text it moves over. This is the same effect that the user achieves when they hold down the Shift key and move the cursor with the cursor keys.</p>
647
 
<p>See also <a href="qtextcursor.html#setVisualNavigation">setVisualNavigation</a>().</p>
648
 
<!-- @@@movePosition -->
649
 
<!-- $$$position[overload1]$$$position -->
650
 
<h3 class="fn"><a name="position"></a>int QTextCursor::position () const</h3>
651
 
<p>Returns the absolute position of the cursor within the document. The cursor is positioned between characters.</p>
652
 
<p>See also <a href="qtextcursor.html#setPosition">setPosition</a>(), <a href="qtextcursor.html#movePosition">movePosition</a>(), <a href="qtextcursor.html#anchor">anchor</a>(), and <a href="qtextcursor.html#positionInBlock">positionInBlock</a>().</p>
653
 
<!-- @@@position -->
654
 
<!-- $$$positionInBlock[overload1]$$$positionInBlock -->
655
 
<h3 class="fn"><a name="positionInBlock"></a>int QTextCursor::positionInBlock () const</h3>
656
 
<p>Returns the relative position of the cursor within the block. The cursor is positioned between characters.</p>
657
 
<p>This is equivalent to <tt>position() - block().position()</tt>.</p>
658
 
<p>This function was introduced in Qt 4.7.</p>
659
 
<p>See also <a href="qtextcursor.html#position">position</a>().</p>
660
 
<!-- @@@positionInBlock -->
661
 
<!-- $$$removeSelectedText[overload1]$$$removeSelectedText -->
662
 
<h3 class="fn"><a name="removeSelectedText"></a>void QTextCursor::removeSelectedText ()</h3>
663
 
<p>If there is a selection, its content is deleted; otherwise does nothing.</p>
664
 
<p>See also <a href="qtextcursor.html#hasSelection">hasSelection</a>().</p>
665
 
<!-- @@@removeSelectedText -->
666
 
<!-- $$$select[overload1]$$$selectSelectionType -->
667
 
<h3 class="fn"><a name="select"></a>void QTextCursor::select ( <a href="qtextcursor.html#SelectionType-enum">SelectionType</a> <i>selection</i> )</h3>
668
 
<p>Selects text in the document according to the given <i>selection</i>.</p>
669
 
<!-- @@@select -->
670
 
<!-- $$$selectedTableCells[overload1]$$$selectedTableCellsint*int*int*int* -->
671
 
<h3 class="fn"><a name="selectedTableCells"></a>void QTextCursor::selectedTableCells ( int * <i>firstRow</i>, int * <i>numRows</i>, int * <i>firstColumn</i>, int * <i>numColumns</i> ) const</h3>
672
 
<p>If the selection spans over table cells, <i>firstRow</i> is populated with the number of the first row in the selection, <i>firstColumn</i> with the number of the first column in the selection, and <i>numRows</i> and <i>numColumns</i> with the number of rows and columns in the selection. If the selection does not span any table cells the results are harmless but undefined.</p>
673
 
<!-- @@@selectedTableCells -->
674
 
<!-- $$$selectedText[overload1]$$$selectedText -->
675
 
<h3 class="fn"><a name="selectedText"></a><a href="qstring.html">QString</a> QTextCursor::selectedText () const</h3>
676
 
<p>Returns the current selection's text (which may be empty). This only returns the text, with no rich text formatting information. If you want a document fragment (i.e&#x2e; formatted rich text) use <a href="qtextcursor.html#selection">selection</a>() instead.</p>
677
 
<p><b>Note:</b> If the selection obtained from an editor spans a line break, the text will contain a Unicode U+2029 paragraph separator character instead of a newline <tt>\n</tt> character. Use <a href="qstring.html#replace">QString::replace</a>() to replace these characters with newlines.</p>
678
 
<!-- @@@selectedText -->
679
 
<!-- $$$selection[overload1]$$$selection -->
680
 
<h3 class="fn"><a name="selection"></a><a href="qtextdocumentfragment.html">QTextDocumentFragment</a> QTextCursor::selection () const</h3>
681
 
<p>Returns the current selection (which may be empty) with all its formatting information. If you just want the selected text (i.e&#x2e; plain text) use <a href="qtextcursor.html#selectedText">selectedText</a>() instead.</p>
682
 
<p><b>Note:</b> Unlike <a href="qtextdocumentfragment.html#toPlainText">QTextDocumentFragment::toPlainText</a>(), <a href="qtextcursor.html#selectedText">selectedText</a>() may include special unicode characters such as <a href="qchar.html#SpecialCharacter-enum">QChar::ParagraphSeparator</a>.</p>
683
 
<p>See also <a href="qtextdocumentfragment.html#toPlainText">QTextDocumentFragment::toPlainText</a>().</p>
684
 
<!-- @@@selection -->
685
 
<!-- $$$selectionEnd[overload1]$$$selectionEnd -->
686
 
<h3 class="fn"><a name="selectionEnd"></a>int QTextCursor::selectionEnd () const</h3>
687
 
<p>Returns the end of the selection or <a href="qtextcursor.html#position">position</a>() if the cursor doesn't have a selection.</p>
688
 
<p>See also <a href="qtextcursor.html#selectionStart">selectionStart</a>(), <a href="qtextcursor.html#position">position</a>(), and <a href="qtextcursor.html#anchor">anchor</a>().</p>
689
 
<!-- @@@selectionEnd -->
690
 
<!-- $$$selectionStart[overload1]$$$selectionStart -->
691
 
<h3 class="fn"><a name="selectionStart"></a>int QTextCursor::selectionStart () const</h3>
692
 
<p>Returns the start of the selection or <a href="qtextcursor.html#position">position</a>() if the cursor doesn't have a selection.</p>
693
 
<p>See also <a href="qtextcursor.html#selectionEnd">selectionEnd</a>(), <a href="qtextcursor.html#position">position</a>(), and <a href="qtextcursor.html#anchor">anchor</a>().</p>
694
 
<!-- @@@selectionStart -->
695
 
<!-- $$$setBlockCharFormat[overload1]$$$setBlockCharFormatconstQTextCharFormat& -->
696
 
<h3 class="fn"><a name="setBlockCharFormat"></a>void QTextCursor::setBlockCharFormat ( const <a href="qtextcharformat.html">QTextCharFormat</a> &amp; <i>format</i> )</h3>
697
 
<p>Sets the block char format of the current block (or all blocks that are contained in the selection) to <i>format</i>.</p>
698
 
<p>See also <a href="qtextcursor.html#blockCharFormat">blockCharFormat</a>().</p>
699
 
<!-- @@@setBlockCharFormat -->
700
 
<!-- $$$setBlockFormat[overload1]$$$setBlockFormatconstQTextBlockFormat& -->
701
 
<h3 class="fn"><a name="setBlockFormat"></a>void QTextCursor::setBlockFormat ( const <a href="qtextblockformat.html">QTextBlockFormat</a> &amp; <i>format</i> )</h3>
702
 
<p>Sets the block format of the current block (or all blocks that are contained in the selection) to <i>format</i>.</p>
703
 
<p>See also <a href="qtextcursor.html#blockFormat">blockFormat</a>() and <a href="qtextcursor.html#mergeBlockFormat">mergeBlockFormat</a>().</p>
704
 
<!-- @@@setBlockFormat -->
705
 
<!-- $$$setCharFormat[overload1]$$$setCharFormatconstQTextCharFormat& -->
706
 
<h3 class="fn"><a name="setCharFormat"></a>void QTextCursor::setCharFormat ( const <a href="qtextcharformat.html">QTextCharFormat</a> &amp; <i>format</i> )</h3>
707
 
<p>Sets the cursor's current character format to the given <i>format</i>. If the cursor has a selection, the given <i>format</i> is applied to the current selection.</p>
708
 
<p>See also <a href="qtextcursor.html#charFormat">charFormat</a>(), <a href="qtextcursor.html#hasSelection">hasSelection</a>(), and <a href="qtextcursor.html#mergeCharFormat">mergeCharFormat</a>().</p>
709
 
<!-- @@@setCharFormat -->
710
 
<!-- $$$setKeepPositionOnInsert[overload1]$$$setKeepPositionOnInsertbool -->
711
 
<h3 class="fn"><a name="setKeepPositionOnInsert"></a>void QTextCursor::setKeepPositionOnInsert ( bool <i>b</i> )</h3>
712
 
<p>Defines whether the cursor should keep its current position when text gets inserted at the current position of the cursor.</p>
713
 
<p>If <i>b</i> is true, the cursor keeps its current position when text gets inserted at the positing of the cursor. If <i>b</i> is false, the cursor moves along with the inserted text.</p>
714
 
<p>The default is false.</p>
715
 
<p>Note that a cursor always moves when text is inserted before the current position of the cursor, and it always keeps its position when text is inserted after the current position of the cursor.</p>
716
 
<p>This function was introduced in Qt 4.7.</p>
717
 
<p>See also <a href="qtextcursor.html#keepPositionOnInsert">keepPositionOnInsert</a>().</p>
718
 
<!-- @@@setKeepPositionOnInsert -->
719
 
<!-- $$$setPosition[overload1]$$$setPositionintMoveMode -->
720
 
<h3 class="fn"><a name="setPosition"></a>void QTextCursor::setPosition ( int <i>pos</i>, <a href="qtextcursor.html#MoveMode-enum">MoveMode</a> <i>m</i> = MoveAnchor )</h3>
721
 
<p>Moves the cursor to the absolute position in the document specified by <i>pos</i> using a <tt>MoveMode</tt> specified by <i>m</i>. The cursor is positioned between characters.</p>
722
 
<p>See also <a href="qtextcursor.html#position">position</a>(), <a href="qtextcursor.html#movePosition">movePosition</a>(), and <a href="qtextcursor.html#anchor">anchor</a>().</p>
723
 
<!-- @@@setPosition -->
724
 
<!-- $$$setVerticalMovementX[overload1]$$$setVerticalMovementXint -->
725
 
<h3 class="fn"><a name="setVerticalMovementX"></a>void QTextCursor::setVerticalMovementX ( int <i>x</i> )</h3>
726
 
<p>Sets the visual x position for vertical cursor movements to <i>x</i>.</p>
727
 
<p>The vertical movement x position is cleared automatically when the cursor moves horizontally, and kept unchanged when the cursor moves vertically. The mechanism allows the cursor to move up and down on a visually straight line with proportional fonts, and to gently &quot;jump&quot; over short lines.</p>
728
 
<p>A value of -1 indicates no predefined x position. It will then be set automatically the next time the cursor moves up or down.</p>
729
 
<p>This function was introduced in Qt 4.7.</p>
730
 
<p>See also <a href="qtextcursor.html#verticalMovementX">verticalMovementX</a>().</p>
731
 
<!-- @@@setVerticalMovementX -->
732
 
<!-- $$$setVisualNavigation[overload1]$$$setVisualNavigationbool -->
733
 
<h3 class="fn"><a name="setVisualNavigation"></a>void QTextCursor::setVisualNavigation ( bool <i>b</i> )</h3>
734
 
<p>Sets visual navigation to <i>b</i>.</p>
735
 
<p>Visual navigation means skipping over hidden text pragraphs. The default is false.</p>
736
 
<p>This function was introduced in Qt 4.4.</p>
737
 
<p>See also <a href="qtextcursor.html#visualNavigation">visualNavigation</a>() and <a href="qtextcursor.html#movePosition">movePosition</a>().</p>
738
 
<!-- @@@setVisualNavigation -->
739
 
<!-- $$$verticalMovementX[overload1]$$$verticalMovementX -->
740
 
<h3 class="fn"><a name="verticalMovementX"></a>int QTextCursor::verticalMovementX () const</h3>
741
 
<p>Returns the visual x position for vertical cursor movements.</p>
742
 
<p>A value of -1 indicates no predefined x position. It will then be set automatically the next time the cursor moves up or down.</p>
743
 
<p>This function was introduced in Qt 4.7.</p>
744
 
<p>See also <a href="qtextcursor.html#setVerticalMovementX">setVerticalMovementX</a>().</p>
745
 
<!-- @@@verticalMovementX -->
746
 
<!-- $$$visualNavigation[overload1]$$$visualNavigation -->
747
 
<h3 class="fn"><a name="visualNavigation"></a>bool QTextCursor::visualNavigation () const</h3>
748
 
<p>Returns true if the cursor does visual navigation; otherwise returns false.</p>
749
 
<p>Visual navigation means skipping over hidden text pragraphs. The default is false.</p>
750
 
<p>This function was introduced in Qt 4.4.</p>
751
 
<p>See also <a href="qtextcursor.html#setVisualNavigation">setVisualNavigation</a>() and <a href="qtextcursor.html#movePosition">movePosition</a>().</p>
752
 
<!-- @@@visualNavigation -->
753
 
<!-- $$$operator!=[overload1]$$$operator!=constQTextCursor& -->
754
 
<h3 class="fn"><a name="operator-not-eq"></a>bool QTextCursor::operator!= ( const QTextCursor &amp; <i>other</i> ) const</h3>
755
 
<p>Returns true if the <i>other</i> cursor is at a different position in the document as this cursor; otherwise returns false.</p>
756
 
<!-- @@@operator!= -->
757
 
<!-- $$$operator<[overload1]$$$operator<constQTextCursor& -->
758
 
<h3 class="fn"><a name="operator-lt"></a>bool QTextCursor::operator&lt; ( const QTextCursor &amp; <i>other</i> ) const</h3>
759
 
<p>Returns true if the <i>other</i> cursor is positioned later in the document than this cursor; otherwise returns false.</p>
760
 
<!-- @@@operator< -->
761
 
<!-- $$$operator<=[overload1]$$$operator<=constQTextCursor& -->
762
 
<h3 class="fn"><a name="operator-lt-eq"></a>bool QTextCursor::operator&lt;= ( const QTextCursor &amp; <i>other</i> ) const</h3>
763
 
<p>Returns true if the <i>other</i> cursor is positioned later or at the same position in the document as this cursor; otherwise returns false.</p>
764
 
<!-- @@@operator<= -->
765
 
<!-- $$$operator=[overload1]$$$operator=constQTextCursor& -->
766
 
<h3 class="fn"><a name="operator-eq"></a>QTextCursor &amp; QTextCursor::operator= ( const QTextCursor &amp; <i>cursor</i> )</h3>
767
 
<p>Makes a copy of <i>cursor</i> and assigns it to this <a href="qtextcursor.html">QTextCursor</a>. Note that <a href="qtextcursor.html">QTextCursor</a> is an <a href="shared.html">implicitly shared</a> class.</p>
768
 
<!-- @@@operator= -->
769
 
<!-- $$$operator==[overload1]$$$operator==constQTextCursor& -->
770
 
<h3 class="fn"><a name="operator-eq-eq"></a>bool QTextCursor::operator== ( const QTextCursor &amp; <i>other</i> ) const</h3>
771
 
<p>Returns true if the <i>other</i> cursor is at the same position in the document as this cursor; otherwise returns false.</p>
772
 
<!-- @@@operator== -->
773
 
<!-- $$$operator>[overload1]$$$operator>constQTextCursor& -->
774
 
<h3 class="fn"><a name="operator-gt"></a>bool QTextCursor::operator&gt; ( const QTextCursor &amp; <i>other</i> ) const</h3>
775
 
<p>Returns true if the <i>other</i> cursor is positioned earlier in the document than this cursor; otherwise returns false.</p>
776
 
<!-- @@@operator> -->
777
 
<!-- $$$operator>=[overload1]$$$operator>=constQTextCursor& -->
778
 
<h3 class="fn"><a name="operator-gt-eq"></a>bool QTextCursor::operator&gt;= ( const QTextCursor &amp; <i>other</i> ) const</h3>
779
 
<p>Returns true if the <i>other</i> cursor is positioned earlier or at the same position in the document as this cursor; otherwise returns false.</p>
780
 
<!-- @@@operator>= -->
781
 
</div>
782
 
        <div class="feedback t_button">
783
 
          [+] Documentation Feedback</div>
784
 
      </div>
785
 
    </div>
786
 
    </div> 
787
 
    <div class="ft">
788
 
      <span></span>
789
 
    </div>
790
 
  </div> 
791
 
  <div class="footer">
792
 
    <p>
793
 
      <acronym title="Copyright">&copy;</acronym> 2008-2010 Nokia Corporation and/or its
794
 
      subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
795
 
      in Finland and/or other countries worldwide.</p>
796
 
    <p>
797
 
      All other trademarks are property of their respective owners. <a title="Privacy Policy"
798
 
        href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
799
 
    <br />
800
 
    <p>
801
 
      Licensees holding valid Qt Commercial licenses may use this document in accordance with the      Qt Commercial License Agreement provided with the Software or, alternatively, in accordance      with the terms contained in a written agreement between you and Nokia.</p>
802
 
    <p>
803
 
      Alternatively, this document may be used under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU
804
 
      Free Documentation License version 1.3</a>
805
 
      as published by the Free Software Foundation.</p>
806
 
  </div>
807
 
  <div id="feedbackBox">
808
 
      <div id="feedcloseX" class="feedclose t_button">X</div>
809
 
    <form id="feedform" action="http://doc.qt.nokia.com/docFeedbck/feedback.php" method="get">
810
 
      <p id="noteHead">Thank you for giving your feedback.</p> <p class="note">Make sure it is related to this specific page. For more general bugs and 
811
 
      requests, please use the <a href="http://bugreports.qt.nokia.com/secure/Dashboard.jspa">Qt Bug Tracker</a>.</p>
812
 
      <p><textarea id="feedbox" name="feedText" rows="5" cols="40"></textarea></p>
813
 
      <p><input id="feedsubmit" class="feedclose" type="submit" name="feedback" /></p>
814
 
    </form>
815
 
  </div>
816
 
  <div id="blurpage">
817
 
  </div>
818
 
</body>
819
 
</html>