/usr/share/qt5/doc/qtquick/qml-qtquick-textinput.html is in qtdeclarative5-doc-html 5.5.1-2ubuntu6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquicktextinput.cpp -->
<title>TextInput QML Type | Qt Quick 5.5</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul>
<li>Qt 5.5</li>
<li><a href="qtquick-index.html">Qt Quick</a></li>
<li><a href="qtquick-qmlmodule.html">QML Types</a></li>
<li>TextInput QML Type</li>
<li id="buildversion">Qt 5.5.1 Reference Documentation</li>
</ul>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">TextInput QML Type</h1>
<span class="subtitle"></span>
<!-- $$$TextInput-brief -->
<p>Displays an editable line of text <a href="#details">More...</a></p>
<!-- @@@TextInput -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQuick 2.5</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <p><a href="qml-qtquick-item.html">Item</a></p>
</td></tr></table></div><ul>
<li><a href="qml-qtquick-textinput-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#acceptableInput-prop">acceptableInput</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#activeFocusOnPress-prop">activeFocusOnPress</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#autoScroll-prop">autoScroll</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#canPaste-prop">canPaste</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#canRedo-prop">canRedo</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#canUndo-prop">canUndo</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#color-prop">color</a></b></b> : color</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#contentHeight-prop">contentHeight</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#contentWidth-prop">contentWidth</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#cursorDelegate-prop">cursorDelegate</a></b></b> : Component</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#cursorPosition-prop">cursorPosition</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#cursorRectangle-prop">cursorRectangle</a></b></b> : rectangle</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#cursorVisible-prop">cursorVisible</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#displayText-prop">displayText</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#echoMode-prop">echoMode</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#effectiveHorizontalAlignment-prop">effectiveHorizontalAlignment</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#font.bold-prop">font.bold</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#font.capitalization-prop">font.capitalization</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#font.family-prop">font.family</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#font.italic-prop">font.italic</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#font.letterSpacing-prop">font.letterSpacing</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#font.pixelSize-prop">font.pixelSize</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#font.pointSize-prop">font.pointSize</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#font.strikeout-prop">font.strikeout</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#font.underline-prop">font.underline</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#font.weight-prop">font.weight</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#font.wordSpacing-prop">font.wordSpacing</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#horizontalAlignment-prop">horizontalAlignment</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#inputMask-prop">inputMask</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#inputMethodComposing-prop">inputMethodComposing</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#inputMethodHints-prop">inputMethodHints</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#length-prop">length</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#maximumLength-prop">maximumLength</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#mouseSelectionMode-prop">mouseSelectionMode</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#passwordCharacter-prop">passwordCharacter</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#passwordMaskDelay-prop">passwordMaskDelay</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#persistentSelection-prop">persistentSelection</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#readOnly-prop">readOnly</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#renderType-prop">renderType</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#selectByMouse-prop">selectByMouse</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#selectedText-prop">selectedText</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#selectedTextColor-prop">selectedTextColor</a></b></b> : color</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#selectionColor-prop">selectionColor</a></b></b> : color</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#selectionEnd-prop">selectionEnd</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#selectionStart-prop">selectionStart</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#text-prop">text</a></b></b> : string</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#validator-prop">validator</a></b></b> : Validator</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#verticalAlignment-prop">verticalAlignment</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#wrapMode-prop">wrapMode</a></b></b> : enumeration</li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#accepted-signal">accepted</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#editingFinished-signal">editingFinished</a></b></b>()</li>
</ul>
<a name="methods"></a>
<h2 id="methods">Methods</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#copy-method">copy</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#cut-method">cut</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#deselect-method">deselect</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#ensureVisible-method">ensureVisible</a></b></b>(int <i> position</i>)</li>
<li class="fn">string <b><b><a href="qml-qtquick-textinput.html#getText-method">getText</a></b></b>(int <i> start</i>, int <i> end</i>)</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#insert-method">insert</a></b></b>(int <i> position</i>, string <i> text</i>)</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#isRightToLeft-method">isRightToLeft</a></b></b>(int <i> start</i>, int <i> end</i>)</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#moveCursorSelection-method">moveCursorSelection</a></b></b>(int <i> position</i>, SelectionMode <i> mode</i>)</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#paste-method">paste</a></b></b>()</li>
<li class="fn">int <b><b><a href="qml-qtquick-textinput.html#positionAt-method">positionAt</a></b></b>(real <i> x</i>, real <i> y</i>, CursorPosition <i> position</i>)</li>
<li class="fn">rect <b><b><a href="qml-qtquick-textinput.html#positionToRectangle-method">positionToRectangle</a></b></b>(int <i> pos</i>)</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#redo-method">redo</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#remove-method">remove</a></b></b>(int <i> start</i>, int <i> end</i>)</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#select-method">select</a></b></b>(int <i> start</i>, int <i> end</i>)</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#selectAll-method">selectAll</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#selectWord-method">selectWord</a></b></b>()</li>
<li class="fn"><b><b><a href="qml-qtquick-textinput.html#undo-method">undo</a></b></b>()</li>
</ul>
<!-- $$$TextInput-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
</p>
<p>The <a href="qml-qtquick-textinput.html">TextInput</a> type displays a single line of editable plain text.</p>
<p><a href="qml-qtquick-textinput.html">TextInput</a> is used to accept a line of text input. Input constraints can be placed on a <a href="qml-qtquick-textinput.html">TextInput</a> item (for example, through a <a href="qml-qtquick-textinput.html#validator-prop">validator</a> or <a href="qml-qtquick-textinput.html#inputMask-prop">inputMask</a>), and setting <a href="qml-qtquick-textinput.html#echoMode-prop">echoMode</a> to an appropriate value enables <a href="qml-qtquick-textinput.html">TextInput</a> to be used for a password input field.</p>
<p>On OS X, the Up/Down key bindings for Home/End are explicitly disabled. If you want such bindings (on any platform), you will need to construct them in QML.</p>
<p><b>See also </b><a href="qml-qtquick-textedit.html">TextEdit</a> and <a href="qml-qtquick-text.html">Text</a>.</p>
<!-- @@@TextInput -->
<h2>Property Documentation</h2>
<!-- $$$acceptableInput -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="acceptableInput-prop"><td class="tblQmlPropNode"><p><a name="acceptableInput-prop"></a><span class="name">acceptableInput</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>This property is always true unless a validator or input mask has been set. If a validator or input mask has been set, this property will only be true if the current text is acceptable to the validator or input mask as a final string (not as an intermediate string).</p>
</div></div><!-- @@@acceptableInput -->
<br/>
<!-- $$$activeFocusOnPress -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="activeFocusOnPress-prop"><td class="tblQmlPropNode"><p><a name="activeFocusOnPress-prop"></a><span class="name">activeFocusOnPress</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Whether the <a href="qml-qtquick-textinput.html">TextInput</a> should gain active focus on a mouse press. By default this is set to true.</p>
</div></div><!-- @@@activeFocusOnPress -->
<br/>
<!-- $$$autoScroll -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="autoScroll-prop"><td class="tblQmlPropNode"><p><a name="autoScroll-prop"></a><span class="name">autoScroll</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Whether the <a href="qml-qtquick-textinput.html">TextInput</a> should scroll when the text is longer than the width. By default this is set to true.</p>
<p><b>See also </b><a href="qml-qtquick-textinput.html#ensureVisible-method">ensureVisible()</a>.</p>
</div></div><!-- @@@autoScroll -->
<br/>
<!-- $$$canPaste -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="canPaste-prop"><td class="tblQmlPropNode"><p><a name="canPaste-prop"></a><span class="name">canPaste</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Returns true if the <a href="qml-qtquick-textinput.html">TextInput</a> is writable and the content of the clipboard is suitable for pasting into the <a href="qml-qtquick-textinput.html">TextInput</a>.</p>
</div></div><!-- @@@canPaste -->
<br/>
<!-- $$$canRedo -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="canRedo-prop"><td class="tblQmlPropNode"><p><a name="canRedo-prop"></a><span class="name">canRedo</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Returns true if the <a href="qml-qtquick-textinput.html">TextInput</a> is writable and there are <a href="qml-qtquick-textinput.html#undo-method">undone</a> operations that can be redone.</p>
</div></div><!-- @@@canRedo -->
<br/>
<!-- $$$canUndo -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="canUndo-prop"><td class="tblQmlPropNode"><p><a name="canUndo-prop"></a><span class="name">canUndo</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Returns true if the <a href="qml-qtquick-textinput.html">TextInput</a> is writable and there are previous operations that can be undone.</p>
</div></div><!-- @@@canUndo -->
<br/>
<!-- $$$color -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="color-prop"><td class="tblQmlPropNode"><p><a name="color-prop"></a><span class="name">color</span> : <span class="type">color</span></p></td></tr></table></div></div><div class="qmldoc"><p>The text color.</p>
</div></div><!-- @@@color -->
<br/>
<!-- $$$contentHeight -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="contentHeight-prop"><td class="tblQmlPropNode"><p><a name="contentHeight-prop"></a><span class="name">contentHeight</span> : <span class="type">real</span></p></td></tr></table></div></div><div class="qmldoc"><p>Returns the height of the text, including the height past the height that is covered if the text does not fit within the set height.</p>
</div></div><!-- @@@contentHeight -->
<br/>
<!-- $$$contentWidth -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="contentWidth-prop"><td class="tblQmlPropNode"><p><a name="contentWidth-prop"></a><span class="name">contentWidth</span> : <span class="type">real</span></p></td></tr></table></div></div><div class="qmldoc"><p>Returns the width of the text, including the width past the width which is covered due to insufficient wrapping if <a href="qml-qtquick-textinput.html#wrapMode-prop">wrapMode</a> is set.</p>
</div></div><!-- @@@contentWidth -->
<br/>
<!-- $$$cursorDelegate -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="cursorDelegate-prop"><td class="tblQmlPropNode"><p><a name="cursorDelegate-prop"></a><span class="name">cursorDelegate</span> : <span class="type">Component</span></p></td></tr></table></div></div><div class="qmldoc"><p>The delegate for the cursor in the <a href="qml-qtquick-textinput.html">TextInput</a>.</p>
<p>If you set a cursorDelegate for a <a href="qml-qtquick-textinput.html">TextInput</a>, this delegate will be used for drawing the cursor instead of the standard cursor. An instance of the delegate will be created and managed by the <a href="qml-qtquick-textinput.html">TextInput</a> when a cursor is needed, and the x property of delegate instance will be set so as to be one pixel before the top left of the current character.</p>
<p>Note that the root item of the delegate component must be a <a href="qquickitem.html">QQuickItem</a> or <a href="qquickitem.html">QQuickItem</a> derived item.</p>
</div></div><!-- @@@cursorDelegate -->
<br/>
<!-- $$$cursorPosition -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="cursorPosition-prop"><td class="tblQmlPropNode"><p><a name="cursorPosition-prop"></a><span class="name">cursorPosition</span> : <span class="type">int</span></p></td></tr></table></div></div><div class="qmldoc"><p>The position of the cursor in the <a href="qml-qtquick-textinput.html">TextInput</a>.</p>
</div></div><!-- @@@cursorPosition -->
<br/>
<!-- $$$cursorRectangle -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="cursorRectangle-prop"><td class="tblQmlPropNode"><p><a name="cursorRectangle-prop"></a><span class="name">cursorRectangle</span> : <span class="type">rectangle</span></p></td></tr></table></div></div><div class="qmldoc"><p>The rectangle where the standard text cursor is rendered within the text input. Read only.</p>
<p>The position and height of a custom <a href="qml-qtquick-textinput.html#cursorDelegate-prop">cursorDelegate</a> are updated to follow the cursorRectangle automatically when it changes. The width of the delegate is unaffected by changes in the cursor rectangle.</p>
</div></div><!-- @@@cursorRectangle -->
<br/>
<!-- $$$cursorVisible -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="cursorVisible-prop"><td class="tblQmlPropNode"><p><a name="cursorVisible-prop"></a><span class="name">cursorVisible</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Set to true when the <a href="qml-qtquick-textinput.html">TextInput</a> shows a cursor.</p>
<p>This property is set and unset when the <a href="qml-qtquick-textinput.html">TextInput</a> gets active focus, so that other properties can be bound to whether the cursor is currently showing. As it gets set and unset automatically, when you set the value yourself you must keep in mind that your value may be overwritten.</p>
<p>It can be set directly in script, for example if a KeyProxy might forward keys to it and you desire it to look active when this happens (but without actually giving it active focus).</p>
<p>It should not be set directly on the item, like in the below QML, as the specified value will be overridden an lost on focus changes.</p>
<pre class="cpp">TextInput {
text: <span class="string">"Text"</span>
cursorVisible: <span class="keyword">false</span>
}</pre>
<p>In the above snippet the cursor will still become visible when the <a href="qml-qtquick-textinput.html">TextInput</a> gains active focus.</p>
</div></div><!-- @@@cursorVisible -->
<br/>
<!-- $$$displayText -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="displayText-prop"><td class="tblQmlPropNode"><p><a name="displayText-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">displayText</span> : <span class="type">string</span></p></td></tr></table></div></div><div class="qmldoc"><p>This is the text displayed in the <a href="qml-qtquick-textinput.html">TextInput</a>.</p>
<p>If <a href="qml-qtquick-textinput.html#echoMode-prop">echoMode</a> is set to TextInput::Normal, this holds the same value as the <a href="qml-qtquick-textinput.html#text-prop">TextInput::text</a> property. Otherwise, this property holds the text visible to the user, while the <a href="qml-qtquick-textinput.html#text-prop">text</a> property holds the actual entered text.</p>
<p><b>Note: </b>Unlike the <a href="qml-qtquick-textinput.html#text-prop">TextInput::text</a> property, this contains partial text input from an input method.</p></div></div><!-- @@@displayText -->
<br/>
<!-- $$$echoMode -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="echoMode-prop"><td class="tblQmlPropNode"><p><a name="echoMode-prop"></a><span class="name">echoMode</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>Specifies how the text should be displayed in the <a href="qml-qtquick-textinput.html">TextInput</a>.</p>
<ul>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.Normal - Displays the text as it is. (Default)</li>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.Password - Displays platform-dependent password mask characters instead of the actual characters.</li>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.NoEcho - Displays nothing.</li>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.PasswordEchoOnEdit - Displays characters as they are entered while editing, otherwise identical to <code>TextInput.Password</code>.</li>
</ul>
</div></div><!-- @@@echoMode -->
<br/>
<!-- $$$effectiveHorizontalAlignment -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="effectiveHorizontalAlignment-prop"><td class="tblQmlPropNode"><p><a name="effectiveHorizontalAlignment-prop"></a><span class="name">effectiveHorizontalAlignment</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets the horizontal alignment of the text within the <a href="qml-qtquick-textinput.html">TextInput</a> item's width and height. By default, the text alignment follows the natural alignment of the text, for example text that is read from left to right will be aligned to the left.</p>
<p><a href="qml-qtquick-textinput.html">TextInput</a> does not have vertical alignment, as the natural height is exactly the height of the single line of text. If you set the height manually to something larger, <a href="qml-qtquick-textinput.html">TextInput</a> will always be top aligned vertically. You can use anchors to align it however you want within another item.</p>
<p>The valid values for <code>horizontalAlignment</code> are <code>TextInput.AlignLeft</code>, <code>TextInput.AlignRight</code> and <code>TextInput.AlignHCenter</code>.</p>
<p>Valid values for <code>verticalAlignment</code> are <code>TextInput.AlignTop</code> (default), <code>TextInput.AlignBottom</code> <code>TextInput.AlignVCenter</code>.</p>
<p>When using the attached property <a href="qml-qtquick-layoutmirroring.html#enabled-prop">LayoutMirroring::enabled</a> to mirror application layouts, the horizontal alignment of text will also be mirrored. However, the property <code>horizontalAlignment</code> will remain unchanged. To query the effective horizontal alignment of <a href="qml-qtquick-textinput.html">TextInput</a>, use the read-only property <code>effectiveHorizontalAlignment</code>.</p>
</div></div><!-- @@@effectiveHorizontalAlignment -->
<br/>
<!-- $$$font.bold -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="font.bold-prop"><td class="tblQmlPropNode"><p><a name="font.bold-prop"></a><span class="name">font.bold</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets whether the font weight is bold.</p>
</div></div><!-- @@@font.bold -->
<br/>
<!-- $$$font.capitalization -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="font.capitalization-prop"><td class="tblQmlPropNode"><p><a name="font.capitalization-prop"></a><span class="name">font.capitalization</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets the capitalization for the text.</p>
<ul>
<li>Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.</li>
<li>Font.AllUppercase - This alters the text to be rendered in all uppercase type.</li>
<li>Font.AllLowercase - This alters the text to be rendered in all lowercase type.</li>
<li>Font.SmallCaps - This alters the text to be rendered in small-caps type.</li>
<li>Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.</li>
</ul>
<pre class="qml"><span class="type"><a href="qml-qtquick-textinput.html">TextInput</a></span> { <span class="name">text</span>: <span class="string">"Hello"</span>; <span class="name">font</span>.capitalization: <span class="name">Font</span>.<span class="name">AllLowercase</span> }</pre>
</div></div><!-- @@@font.capitalization -->
<br/>
<!-- $$$font.family -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="font.family-prop"><td class="tblQmlPropNode"><p><a name="font.family-prop"></a><span class="name">font.family</span> : <span class="type">string</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets the family name of the font.</p>
<p>The family name is case insensitive and may optionally include a foundry name, e.g. "Helvetica [Cronyx]". If the family is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen. If the family isn't available a family will be set using the font matching algorithm.</p>
</div></div><!-- @@@font.family -->
<br/>
<!-- $$$font.italic -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="font.italic-prop"><td class="tblQmlPropNode"><p><a name="font.italic-prop"></a><span class="name">font.italic</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets whether the font has an italic style.</p>
</div></div><!-- @@@font.italic -->
<br/>
<!-- $$$font.letterSpacing -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="font.letterSpacing-prop"><td class="tblQmlPropNode"><p><a name="font.letterSpacing-prop"></a><span class="name">font.letterSpacing</span> : <span class="type">real</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets the letter spacing for the font.</p>
<p>Letter spacing changes the default spacing between individual letters in the font. A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.</p>
</div></div><!-- @@@font.letterSpacing -->
<br/>
<!-- $$$font.pixelSize -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="font.pixelSize-prop"><td class="tblQmlPropNode"><p><a name="font.pixelSize-prop"></a><span class="name">font.pixelSize</span> : <span class="type">int</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets the font size in pixels.</p>
<p>Using this function makes the font device dependent. Use <code>pointSize</code> to set the size of the font in a device independent manner.</p>
</div></div><!-- @@@font.pixelSize -->
<br/>
<!-- $$$font.pointSize -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="font.pointSize-prop"><td class="tblQmlPropNode"><p><a name="font.pointSize-prop"></a><span class="name">font.pointSize</span> : <span class="type">real</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets the font size in points. The point size must be greater than zero.</p>
</div></div><!-- @@@font.pointSize -->
<br/>
<!-- $$$font.strikeout -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="font.strikeout-prop"><td class="tblQmlPropNode"><p><a name="font.strikeout-prop"></a><span class="name">font.strikeout</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets whether the font has a strikeout style.</p>
</div></div><!-- @@@font.strikeout -->
<br/>
<!-- $$$font.underline -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="font.underline-prop"><td class="tblQmlPropNode"><p><a name="font.underline-prop"></a><span class="name">font.underline</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets whether the text is underlined.</p>
</div></div><!-- @@@font.underline -->
<br/>
<!-- $$$font.weight -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="font.weight-prop"><td class="tblQmlPropNode"><p><a name="font.weight-prop"></a><span class="name">font.weight</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets the font's weight.</p>
<p>The weight can be one of:</p>
<ul>
<li>Font.Thin</li>
<li>Font.Light</li>
<li>Font.ExtraLight</li>
<li>Font.Normal - the default</li>
<li>Font.Medium</li>
<li>Font.DemiBold</li>
<li>Font.Bold</li>
<li>Font.ExtraBold</li>
<li>Font.Black</li>
</ul>
<pre class="qml"><span class="type"><a href="qml-qtquick-textinput.html">TextInput</a></span> { <span class="name">text</span>: <span class="string">"Hello"</span>; <span class="name">font</span>.weight: <span class="name">Font</span>.<span class="name">DemiBold</span> }</pre>
</div></div><!-- @@@font.weight -->
<br/>
<!-- $$$font.wordSpacing -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="font.wordSpacing-prop"><td class="tblQmlPropNode"><p><a name="font.wordSpacing-prop"></a><span class="name">font.wordSpacing</span> : <span class="type">real</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets the word spacing for the font.</p>
<p>Word spacing changes the default spacing between individual words. A positive value increases the word spacing by a corresponding amount of pixels, while a negative value decreases the inter-word spacing accordingly.</p>
</div></div><!-- @@@font.wordSpacing -->
<br/>
<!-- $$$horizontalAlignment -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="horizontalAlignment-prop"><td class="tblQmlPropNode"><p><a name="horizontalAlignment-prop"></a><span class="name">horizontalAlignment</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets the horizontal alignment of the text within the <a href="qml-qtquick-textinput.html">TextInput</a> item's width and height. By default, the text alignment follows the natural alignment of the text, for example text that is read from left to right will be aligned to the left.</p>
<p><a href="qml-qtquick-textinput.html">TextInput</a> does not have vertical alignment, as the natural height is exactly the height of the single line of text. If you set the height manually to something larger, <a href="qml-qtquick-textinput.html">TextInput</a> will always be top aligned vertically. You can use anchors to align it however you want within another item.</p>
<p>The valid values for <code>horizontalAlignment</code> are <code>TextInput.AlignLeft</code>, <code>TextInput.AlignRight</code> and <code>TextInput.AlignHCenter</code>.</p>
<p>Valid values for <code>verticalAlignment</code> are <code>TextInput.AlignTop</code> (default), <code>TextInput.AlignBottom</code> <code>TextInput.AlignVCenter</code>.</p>
<p>When using the attached property <a href="qml-qtquick-layoutmirroring.html#enabled-prop">LayoutMirroring::enabled</a> to mirror application layouts, the horizontal alignment of text will also be mirrored. However, the property <code>horizontalAlignment</code> will remain unchanged. To query the effective horizontal alignment of <a href="qml-qtquick-textinput.html">TextInput</a>, use the read-only property <code>effectiveHorizontalAlignment</code>.</p>
</div></div><!-- @@@horizontalAlignment -->
<br/>
<!-- $$$inputMask -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="inputMask-prop"><td class="tblQmlPropNode"><p><a name="inputMask-prop"></a><span class="name">inputMask</span> : <span class="type">string</span></p></td></tr></table></div></div><div class="qmldoc"><p>Allows you to set an input mask on the <a href="qml-qtquick-textinput.html">TextInput</a>, restricting the allowable text inputs. See QLineEdit::inputMask for further details, as the exact same mask strings are used by <a href="qml-qtquick-textinput.html">TextInput</a>.</p>
<p><b>See also </b><a href="qml-qtquick-textinput.html#acceptableInput-prop">acceptableInput</a> and <a href="qml-qtquick-textinput.html#validator-prop">validator</a>.</p>
</div></div><!-- @@@inputMask -->
<br/>
<!-- $$$inputMethodComposing -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="inputMethodComposing-prop"><td class="tblQmlPropNode"><p><a name="inputMethodComposing-prop"></a><span class="name">inputMethodComposing</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>This property holds whether the <a href="qml-qtquick-textinput.html">TextInput</a> has partial text input from an input method.</p>
<p>While it is composing an input method may rely on mouse or key events from the <a href="qml-qtquick-textinput.html">TextInput</a> to edit or commit the partial text. This property can be used to determine when to disable events handlers that may interfere with the correct operation of an input method.</p>
</div></div><!-- @@@inputMethodComposing -->
<br/>
<!-- $$$inputMethodHints -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="inputMethodHints-prop"><td class="tblQmlPropNode"><p><a name="inputMethodHints-prop"></a><span class="name">inputMethodHints</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>Provides hints to the input method about the expected content of the text input and how it should operate.</p>
<p>The value is a bit-wise combination of flags, or Qt.ImhNone if no hints are set.</p>
<p>Flags that alter behaviour are:</p>
<ul>
<li>Qt.ImhHiddenText - Characters should be hidden, as is typically used when entering passwords. This is automatically set when setting <a href="qml-qtquick-textinput.html#echoMode-prop">echoMode</a> to <code>TextInput.Password</code>.</li>
<li>Qt.ImhSensitiveData - Typed text should not be stored by the active input method in any persistent storage like predictive user dictionary.</li>
<li>Qt.ImhNoAutoUppercase - The input method should not try to automatically switch to upper case when a sentence ends.</li>
<li>Qt.ImhPreferNumbers - Numbers are preferred (but not required).</li>
<li>Qt.ImhPreferUppercase - Upper case letters are preferred (but not required).</li>
<li>Qt.ImhPreferLowercase - Lower case letters are preferred (but not required).</li>
<li>Qt.ImhNoPredictiveText - Do not use predictive text (i.e. dictionary lookup) while typing.</li>
<li>Qt.ImhDate - The text editor functions as a date field.</li>
<li>Qt.ImhTime - The text editor functions as a time field.</li>
<li>Qt.ImhMultiLine - The text editor doesn't close software input keyboard when Return or Enter key is pressed (since <a href="qtquick-module.html">QtQuick</a> 2.4).</li>
</ul>
<p>Flags that restrict input (exclusive flags) are:</p>
<ul>
<li>Qt.ImhDigitsOnly - Only digits are allowed.</li>
<li>Qt.ImhFormattedNumbersOnly - Only number input is allowed. This includes decimal point and minus sign.</li>
<li>Qt.ImhUppercaseOnly - Only upper case letter input is allowed.</li>
<li>Qt.ImhLowercaseOnly - Only lower case letter input is allowed.</li>
<li>Qt.ImhDialableCharactersOnly - Only characters suitable for phone dialing are allowed.</li>
<li>Qt.ImhEmailCharactersOnly - Only characters suitable for email addresses are allowed.</li>
<li>Qt.ImhUrlCharactersOnly - Only characters suitable for URLs are allowed.</li>
</ul>
<p>Masks:</p>
<ul>
<li>Qt.ImhExclusiveInputMask - This mask yields nonzero if any of the exclusive flags are used.</li>
</ul>
</div></div><!-- @@@inputMethodHints -->
<br/>
<!-- $$$length -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="length-prop"><td class="tblQmlPropNode"><p><a name="length-prop"></a><span class="name">length</span> : <span class="type">int</span></p></td></tr></table></div></div><div class="qmldoc"><p>Returns the total number of characters in the <a href="qml-qtquick-textinput.html">TextInput</a> item.</p>
<p>If the <a href="qml-qtquick-textinput.html">TextInput</a> has an <a href="qml-qtquick-textinput.html#inputMask-prop">inputMask</a> the length will include mask characters and may differ from the length of the string returned by the <a href="qml-qtquick-textinput.html#text-prop">text</a> property.</p>
<p>This property can be faster than querying the length the <a href="qml-qtquick-textinput.html#text-prop">text</a> property as it doesn't require any copying or conversion of the <a href="qml-qtquick-textinput.html">TextInput</a>'s internal string data.</p>
</div></div><!-- @@@length -->
<br/>
<!-- $$$maximumLength -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="maximumLength-prop"><td class="tblQmlPropNode"><p><a name="maximumLength-prop"></a><span class="name">maximumLength</span> : <span class="type">int</span></p></td></tr></table></div></div><div class="qmldoc"><p>The maximum permitted length of the text in the <a href="qml-qtquick-textinput.html">TextInput</a>.</p>
<p>If the text is too long, it is truncated at the limit.</p>
<p>By default, this property contains a value of 32767.</p>
</div></div><!-- @@@maximumLength -->
<br/>
<!-- $$$mouseSelectionMode -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="mouseSelectionMode-prop"><td class="tblQmlPropNode"><p><a name="mouseSelectionMode-prop"></a><span class="name">mouseSelectionMode</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>Specifies how text should be selected using a mouse.</p>
<ul>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.SelectCharacters - The selection is updated with individual characters. (Default)</li>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.SelectWords - The selection is updated with whole words.</li>
</ul>
<p>This property only applies when <a href="qml-qtquick-textinput.html#selectByMouse-prop">selectByMouse</a> is true.</p>
</div></div><!-- @@@mouseSelectionMode -->
<br/>
<!-- $$$passwordCharacter -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="passwordCharacter-prop"><td class="tblQmlPropNode"><p><a name="passwordCharacter-prop"></a><span class="name">passwordCharacter</span> : <span class="type">string</span></p></td></tr></table></div></div><div class="qmldoc"><p>This is the character displayed when <a href="qml-qtquick-textinput.html#echoMode-prop">echoMode</a> is set to Password or PasswordEchoOnEdit. By default it is the password character used by the platform theme.</p>
<p>If this property is set to a string with more than one character, the first character is used. If the string is empty, the value is ignored and the property is not set.</p>
</div></div><!-- @@@passwordCharacter -->
<br/>
<!-- $$$passwordMaskDelay -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="passwordMaskDelay-prop"><td class="tblQmlPropNode"><p><a name="passwordMaskDelay-prop"></a><span class="name">passwordMaskDelay</span> : <span class="type">int</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets the delay before visible character is masked with password character, in milliseconds.</p>
<p>The reset method will be called by assigning undefined.</p>
<p>This QML property was introduced in Qt 5.4.</p>
</div></div><!-- @@@passwordMaskDelay -->
<br/>
<!-- $$$persistentSelection -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="persistentSelection-prop"><td class="tblQmlPropNode"><p><a name="persistentSelection-prop"></a><span class="name">persistentSelection</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Whether the <a href="qml-qtquick-textinput.html">TextInput</a> should keep its selection when it loses active focus to another item in the scene. By default this is set to false;</p>
</div></div><!-- @@@persistentSelection -->
<br/>
<!-- $$$readOnly -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="readOnly-prop"><td class="tblQmlPropNode"><p><a name="readOnly-prop"></a><span class="name">readOnly</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets whether user input can modify the contents of the <a href="qml-qtquick-textinput.html">TextInput</a>.</p>
<p>If readOnly is set to true, then user input will not affect the text property. Any bindings or attempts to set the text property will still work.</p>
</div></div><!-- @@@readOnly -->
<br/>
<!-- $$$renderType -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="renderType-prop"><td class="tblQmlPropNode"><p><a name="renderType-prop"></a><span class="name">renderType</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>Override the default rendering type for this component.</p>
<p>Supported render types are:</p>
<ul>
<li>Text.QtRendering - the default</li>
<li>Text.NativeRendering</li>
</ul>
<p>Select Text.NativeRendering if you prefer text to look native on the target platform and do not require advanced features such as transformation of the text. Using such features in combination with the NativeRendering render type will lend poor and sometimes pixelated results.</p>
</div></div><!-- @@@renderType -->
<br/>
<!-- $$$selectByMouse -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="selectByMouse-prop"><td class="tblQmlPropNode"><p><a name="selectByMouse-prop"></a><span class="name">selectByMouse</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>Defaults to false.</p>
<p>If true, the user can use the mouse to select text in some platform-specific way. Note that for some platforms this may not be an appropriate interaction (eg. may conflict with how the text needs to behave inside a Flickable.</p>
</div></div><!-- @@@selectByMouse -->
<br/>
<!-- $$$selectedText -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="selectedText-prop"><td class="tblQmlPropNode"><p><a name="selectedText-prop"></a><span class="name">selectedText</span> : <span class="type">string</span></p></td></tr></table></div></div><div class="qmldoc"><p>This read-only property provides the text currently selected in the text input.</p>
<p>It is equivalent to the following snippet, but is faster and easier to use.</p>
<pre class="js"><span class="name">myTextInput</span>.<span class="name">text</span>.<span class="name">toString</span>().<span class="name">substring</span>(<span class="name">myTextInput</span>.<span class="name">selectionStart</span>,
<span class="name">myTextInput</span>.<span class="name">selectionEnd</span>);</pre>
</div></div><!-- @@@selectedText -->
<br/>
<!-- $$$selectedTextColor -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="selectedTextColor-prop"><td class="tblQmlPropNode"><p><a name="selectedTextColor-prop"></a><span class="name">selectedTextColor</span> : <span class="type">color</span></p></td></tr></table></div></div><div class="qmldoc"><p>The highlighted text color, used in selections.</p>
</div></div><!-- @@@selectedTextColor -->
<br/>
<!-- $$$selectionColor -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="selectionColor-prop"><td class="tblQmlPropNode"><p><a name="selectionColor-prop"></a><span class="name">selectionColor</span> : <span class="type">color</span></p></td></tr></table></div></div><div class="qmldoc"><p>The text highlight color, used behind selections.</p>
</div></div><!-- @@@selectionColor -->
<br/>
<!-- $$$selectionEnd -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="selectionEnd-prop"><td class="tblQmlPropNode"><p><a name="selectionEnd-prop"></a><span class="name">selectionEnd</span> : <span class="type">int</span></p></td></tr></table></div></div><div class="qmldoc"><p>The cursor position after the last character in the current selection.</p>
<p>This property is read-only. To change the selection, use select(start,end), <a href="qml-qtquick-textinput.html#selectAll-method">selectAll()</a>, or <a href="qml-qtquick-textinput.html#selectWord-method">selectWord()</a>.</p>
<p><b>See also </b><a href="qml-qtquick-textinput.html#selectionStart-prop">selectionStart</a>, <a href="qml-qtquick-textinput.html#cursorPosition-prop">cursorPosition</a>, and <a href="qml-qtquick-textinput.html#selectedText-prop">selectedText</a>.</p>
</div></div><!-- @@@selectionEnd -->
<br/>
<!-- $$$selectionStart -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="selectionStart-prop"><td class="tblQmlPropNode"><p><a name="selectionStart-prop"></a><span class="name">selectionStart</span> : <span class="type">int</span></p></td></tr></table></div></div><div class="qmldoc"><p>The cursor position before the first character in the current selection.</p>
<p>This property is read-only. To change the selection, use select(start,end), <a href="qml-qtquick-textinput.html#selectAll-method">selectAll()</a>, or <a href="qml-qtquick-textinput.html#selectWord-method">selectWord()</a>.</p>
<p><b>See also </b><a href="qml-qtquick-textinput.html#selectionEnd-prop">selectionEnd</a>, <a href="qml-qtquick-textinput.html#cursorPosition-prop">cursorPosition</a>, and <a href="qml-qtquick-textinput.html#selectedText-prop">selectedText</a>.</p>
</div></div><!-- @@@selectionStart -->
<br/>
<!-- $$$text -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="text-prop"><td class="tblQmlPropNode"><p><a name="text-prop"></a><span class="name">text</span> : <span class="type">string</span></p></td></tr></table></div></div><div class="qmldoc"><p>The text in the <a href="qml-qtquick-textinput.html">TextInput</a>.</p>
</div></div><!-- @@@text -->
<br/>
<!-- $$$validator -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="validator-prop"><td class="tblQmlPropNode"><p><a name="validator-prop"></a><span class="name">validator</span> : <span class="type">Validator</span></p></td></tr></table></div></div><div class="qmldoc"><p>Allows you to set a validator on the <a href="qml-qtquick-textinput.html">TextInput</a>. When a validator is set the <a href="qml-qtquick-textinput.html">TextInput</a> will only accept input which leaves the text property in an acceptable or intermediate state. The accepted signal will only be sent if the text is in an acceptable state when enter is pressed.</p>
<p>Currently supported validators are <a href="qml-qtquick-intvalidator.html">IntValidator</a>, <a href="qml-qtquick-doublevalidator.html">DoubleValidator</a> and <a href="qml-qtquick-regexpvalidator.html">RegExpValidator</a>. An example of using validators is shown below, which allows input of integers between 11 and 31 into the text input:</p>
<pre class="cpp">import <span class="type"><a href="qtquick-module.html">QtQuick</a></span> <span class="number">2.0</span>
TextInput{
validator: IntValidator{bottom: <span class="number">11</span>; top: <span class="number">31</span>;}
focus: <span class="keyword">true</span>
}</pre>
<p><b>See also </b><a href="qml-qtquick-textinput.html#acceptableInput-prop">acceptableInput</a> and <a href="qml-qtquick-textinput.html#inputMask-prop">inputMask</a>.</p>
</div></div><!-- @@@validator -->
<br/>
<!-- $$$verticalAlignment -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="verticalAlignment-prop"><td class="tblQmlPropNode"><p><a name="verticalAlignment-prop"></a><span class="name">verticalAlignment</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>Sets the horizontal alignment of the text within the <a href="qml-qtquick-textinput.html">TextInput</a> item's width and height. By default, the text alignment follows the natural alignment of the text, for example text that is read from left to right will be aligned to the left.</p>
<p><a href="qml-qtquick-textinput.html">TextInput</a> does not have vertical alignment, as the natural height is exactly the height of the single line of text. If you set the height manually to something larger, <a href="qml-qtquick-textinput.html">TextInput</a> will always be top aligned vertically. You can use anchors to align it however you want within another item.</p>
<p>The valid values for <code>horizontalAlignment</code> are <code>TextInput.AlignLeft</code>, <code>TextInput.AlignRight</code> and <code>TextInput.AlignHCenter</code>.</p>
<p>Valid values for <code>verticalAlignment</code> are <code>TextInput.AlignTop</code> (default), <code>TextInput.AlignBottom</code> <code>TextInput.AlignVCenter</code>.</p>
<p>When using the attached property <a href="qml-qtquick-layoutmirroring.html#enabled-prop">LayoutMirroring::enabled</a> to mirror application layouts, the horizontal alignment of text will also be mirrored. However, the property <code>horizontalAlignment</code> will remain unchanged. To query the effective horizontal alignment of <a href="qml-qtquick-textinput.html">TextInput</a>, use the read-only property <code>effectiveHorizontalAlignment</code>.</p>
</div></div><!-- @@@verticalAlignment -->
<br/>
<!-- $$$wrapMode -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="wrapMode-prop"><td class="tblQmlPropNode"><p><a name="wrapMode-prop"></a><span class="name">wrapMode</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>Set this property to wrap the text to the <a href="qml-qtquick-textinput.html">TextInput</a> item's width. The text will only wrap if an explicit width has been set.</p>
<ul>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.NoWrap - no wrapping will be performed. If the text contains insufficient newlines, then implicitWidth will exceed a set width.</li>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.WordWrap - wrapping is done on word boundaries only. If a word is too long, implicitWidth will exceed a set width.</li>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.WrapAnywhere - wrapping is done at any point on a line, even if it occurs in the middle of a word.</li>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.Wrap - if possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.</li>
</ul>
<p>The default is <a href="qml-qtquick-textinput.html">TextInput</a>.NoWrap. If you set a width, consider using <a href="qml-qtquick-textinput.html">TextInput</a>.Wrap.</p>
</div></div><!-- @@@wrapMode -->
<br/>
<h2>Signal Documentation</h2>
<!-- $$$accepted -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="accepted-signal"><td class="tblQmlFuncNode"><p><a name="accepted-signal"></a><span class="name">accepted</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>This signal is emitted when the Return or Enter key is pressed. Note that if there is a <a href="qml-qtquick-textinput.html#validator-prop">validator</a> or <a href="qml-qtquick-textinput.html#inputMask-prop">inputMask</a> set on the text input, the signal will only be emitted if the input is in an acceptable state.</p>
<p>The corresponding handler is <code>onAccepted</code>.</p>
</div></div><!-- @@@accepted -->
<br/>
<!-- $$$editingFinished -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="editingFinished-signal"><td class="tblQmlFuncNode"><p><a name="editingFinished-signal"></a><span class="name">editingFinished</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>This signal is emitted when the Return or Enter key is pressed or the text input loses focus. Note that if there is a validator or <a href="qml-qtquick-textinput.html#inputMask-prop">inputMask</a> set on the text input and enter/return is pressed, this signal will only be emitted if the input follows the <a href="qml-qtquick-textinput.html#inputMask-prop">inputMask</a> and the validator returns an acceptable state.</p>
<p>The corresponding handler is <code>onEditingFinished</code>.</p>
<p>This QML signal was introduced in Qt 5.2.</p>
</div></div><!-- @@@editingFinished -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$copy -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="copy-method"><td class="tblQmlFuncNode"><p><a name="copy-method"></a><span class="name">copy</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>Copies the currently selected text to the system clipboard.</p>
</div></div><!-- @@@copy -->
<br/>
<!-- $$$cut -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="cut-method"><td class="tblQmlFuncNode"><p><a name="cut-method"></a><span class="name">cut</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>Moves the currently selected text to the system clipboard.</p>
</div></div><!-- @@@cut -->
<br/>
<!-- $$$deselect -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="deselect-method"><td class="tblQmlFuncNode"><p><a name="deselect-method"></a><span class="name">deselect</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>Removes active text selection.</p>
</div></div><!-- @@@deselect -->
<br/>
<!-- $$$ensureVisible -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="ensureVisible-method"><td class="tblQmlFuncNode"><p><a name="ensureVisible-method"></a><span class="name">ensureVisible</span>(<span class="type">int</span><i> position</i>)</p></td></tr></table></div></div><div class="qmldoc"><p>Scrolls the contents of the text input so that the specified character <i>position</i> is visible inside the boundaries of the text input.</p>
<p>This QML method was introduced in Qt 5.4.</p>
<p><b>See also </b><a href="qml-qtquick-textinput.html#autoScroll-prop">autoScroll</a>.</p>
</div></div><!-- @@@ensureVisible -->
<br/>
<!-- $$$getText -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="getText-method"><td class="tblQmlFuncNode"><p><a name="getText-method"></a><span class="type">string</span> <span class="name">getText</span>(<span class="type">int</span><i> start</i>, <span class="type">int</span><i> end</i>)</p></td></tr></table></div></div><div class="qmldoc"><p>Returns the section of text that is between the <i>start</i> and <i>end</i> positions.</p>
<p>If the <a href="qml-qtquick-textinput.html">TextInput</a> has an <a href="qml-qtquick-textinput.html#inputMask-prop">inputMask</a> the length will include mask characters.</p>
</div></div><!-- @@@getText -->
<br/>
<!-- $$$insert -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="insert-method"><td class="tblQmlFuncNode"><p><a name="insert-method"></a><span class="name">insert</span>(<span class="type">int</span><i> position</i>, <span class="type">string</span><i> text</i>)</p></td></tr></table></div></div><div class="qmldoc"><p>Inserts <i>text</i> into the <a href="qml-qtquick-textinput.html">TextInput</a> at position.</p>
</div></div><!-- @@@insert -->
<br/>
<!-- $$$isRightToLeft -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="isRightToLeft-method"><td class="tblQmlFuncNode"><p><a name="isRightToLeft-method"></a><span class="name">isRightToLeft</span>(<span class="type">int</span><i> start</i>, <span class="type">int</span><i> end</i>)</p></td></tr></table></div></div><div class="qmldoc"><p>Returns true if the natural reading direction of the editor text found between positions <i>start</i> and <i>end</i> is right to left.</p>
</div></div><!-- @@@isRightToLeft -->
<br/>
<!-- $$$moveCursorSelection -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="moveCursorSelection-method"><td class="tblQmlFuncNode"><p><a name="moveCursorSelection-method"></a><span class="name">moveCursorSelection</span>(<span class="type">int</span><i> position</i>, <span class="type">SelectionMode</span><i> mode</i> = TextInput.SelectCharacters)</p></td></tr></table></div></div><div class="qmldoc"><p>Moves the cursor to <i>position</i> and updates the selection according to the optional <i>mode</i> parameter. (To only move the cursor, set the <a href="qml-qtquick-textinput.html#cursorPosition-prop">cursorPosition</a> property.)</p>
<p>When this method is called it additionally sets either the <a href="qml-qtquick-textinput.html#selectionStart-prop">selectionStart</a> or the <a href="qml-qtquick-textinput.html#selectionEnd-prop">selectionEnd</a> (whichever was at the previous cursor position) to the specified position. This allows you to easily extend and contract the selected text range.</p>
<p>The selection mode specifies whether the selection is updated on a per character or a per word basis. If not specified the selection mode will default to <a href="qml-qtquick-textinput.html">TextInput</a>.SelectCharacters.</p>
<ul>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.SelectCharacters - Sets either the <a href="qml-qtquick-textinput.html#selectionStart-prop">selectionStart</a> or <a href="qml-qtquick-textinput.html#selectionEnd-prop">selectionEnd</a> (whichever was at the previous cursor position) to the specified position.</li>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.SelectWords - Sets the <a href="qml-qtquick-textinput.html#selectionStart-prop">selectionStart</a> and <a href="qml-qtquick-textinput.html#selectionEnd-prop">selectionEnd</a> to include all words between the specified position and the previous cursor position. Words partially in the range are included.</li>
</ul>
<p>For example, take this sequence of calls:</p>
<pre class="cpp">cursorPosition <span class="operator">=</span> <span class="number">5</span>
moveCursorSelection(<span class="number">9</span><span class="operator">,</span> TextInput<span class="operator">.</span>SelectCharacters)
moveCursorSelection(<span class="number">7</span><span class="operator">,</span> TextInput<span class="operator">.</span>SelectCharacters)</pre>
<p>This moves the cursor to position 5, extend the selection end from 5 to 9 and then retract the selection end from 9 to 7, leaving the text from position 5 to 7 selected (the 6th and 7th characters).</p>
<p>The same sequence with <a href="qml-qtquick-textinput.html">TextInput</a>.SelectWords will extend the selection start to a word boundary before or on position 5 and extend the selection end to a word boundary on or past position 9.</p>
</div></div><!-- @@@moveCursorSelection -->
<br/>
<!-- $$$paste -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="paste-method"><td class="tblQmlFuncNode"><p><a name="paste-method"></a><span class="name">paste</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>Replaces the currently selected text by the contents of the system clipboard.</p>
</div></div><!-- @@@paste -->
<br/>
<!-- $$$positionAt -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="positionAt-method"><td class="tblQmlFuncNode"><p><a name="positionAt-method"></a><span class="type">int</span> <span class="name">positionAt</span>(<span class="type">real</span><i> x</i>, <span class="type">real</span><i> y</i>, <span class="type">CursorPosition</span><i> position</i> = CursorBetweenCharacters)</p></td></tr></table></div></div><div class="qmldoc"><p>This function returns the character position at x and y pixels from the top left of the textInput. Position 0 is before the first character, position 1 is after the first character but before the second, and so on until position text.length, which is after all characters.</p>
<p>This means that for all x values before the first character this function returns 0, and for all x values after the last character this function returns text.length. If the y value is above the text the position will be that of the nearest character on the first line and if it is below the text the position of the nearest character on the last line will be returned.</p>
<p>The cursor position type specifies how the cursor position should be resolved.</p>
<ul>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.CursorBetweenCharacters - Returns the position between characters that is nearest x.</li>
<li><a href="qml-qtquick-textinput.html">TextInput</a>.CursorOnCharacter - Returns the position before the character that is nearest x.</li>
</ul>
</div></div><!-- @@@positionAt -->
<br/>
<!-- $$$positionToRectangle -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="positionToRectangle-method"><td class="tblQmlFuncNode"><p><a name="positionToRectangle-method"></a><span class="type">rect</span> <span class="name">positionToRectangle</span>(<span class="type">int</span><i> pos</i>)</p></td></tr></table></div></div><div class="qmldoc"><p>This function takes a character position and returns the rectangle that the cursor would occupy, if it was placed at that character position.</p>
<p>This is similar to setting the <a href="qml-qtquick-textinput.html#cursorPosition-prop">cursorPosition</a>, and then querying the cursor rectangle, but the <a href="qml-qtquick-textinput.html#cursorPosition-prop">cursorPosition</a> is not changed.</p>
</div></div><!-- @@@positionToRectangle -->
<br/>
<!-- $$$redo -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="redo-method"><td class="tblQmlFuncNode"><p><a name="redo-method"></a><span class="name">redo</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>Redoes the last operation if redo is <a href="qml-qtquick-textinput.html#canRedo-prop">available</a>.</p>
</div></div><!-- @@@redo -->
<br/>
<!-- $$$remove -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="remove-method"><td class="tblQmlFuncNode"><p><a name="remove-method"></a><span class="name">remove</span>(<span class="type">int</span><i> start</i>, <span class="type">int</span><i> end</i>)</p></td></tr></table></div></div><div class="qmldoc"><p>Removes the section of text that is between the <i>start</i> and <i>end</i> positions from the <a href="qml-qtquick-textinput.html">TextInput</a>.</p>
</div></div><!-- @@@remove -->
<br/>
<!-- $$$select -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="select-method"><td class="tblQmlFuncNode"><p><a name="select-method"></a><span class="name">select</span>(<span class="type">int</span><i> start</i>, <span class="type">int</span><i> end</i>)</p></td></tr></table></div></div><div class="qmldoc"><p>Causes the text from <i>start</i> to <i>end</i> to be selected.</p>
<p>If either start or end is out of range, the selection is not changed.</p>
<p>After calling this, <a href="qml-qtquick-textinput.html#selectionStart-prop">selectionStart</a> will become the lesser and <a href="qml-qtquick-textinput.html#selectionEnd-prop">selectionEnd</a> will become the greater (regardless of the order passed to this method).</p>
<p><b>See also </b><a href="qml-qtquick-textinput.html#selectionStart-prop">selectionStart</a> and <a href="qml-qtquick-textinput.html#selectionEnd-prop">selectionEnd</a>.</p>
</div></div><!-- @@@select -->
<br/>
<!-- $$$selectAll -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="selectAll-method"><td class="tblQmlFuncNode"><p><a name="selectAll-method"></a><span class="name">selectAll</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>Causes all text to be selected.</p>
</div></div><!-- @@@selectAll -->
<br/>
<!-- $$$selectWord -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="selectWord-method"><td class="tblQmlFuncNode"><p><a name="selectWord-method"></a><span class="name">selectWord</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>Causes the word closest to the current cursor position to be selected.</p>
</div></div><!-- @@@selectWord -->
<br/>
<!-- $$$undo -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="undo-method"><td class="tblQmlFuncNode"><p><a name="undo-method"></a><span class="name">undo</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>Undoes the last operation if undo is <a href="qml-qtquick-textinput.html#canUndo-prop">available</a>. Deselects any current selection, and updates the selection start to the current cursor position.</p>
</div></div><!-- @@@undo -->
<br/>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|