Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
textinput.qdoc
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page qtquick-input-textinput.html
6\title Qt Quick Text Input Handling and Validators
7\brief Text input and validation
8
9\section1 Text Visual Types
10
11Qt Quick provides several types to display text onto the screen. The \l Text
12type will display formatted text onto the screen, the \l TextEdit type
13will place a multiline line edit onto the screen, and the \l TextInput will
14place a single editable line field onto the screen.
15
16To learn more about their specific features and properties, visit their
17respective documentation.
18
19\section1 Validating Input Text
20
21The \e validator types enforce the type and format of
22\l TextInput objects.
23
24\annotatedlist qtquick-text-validators
25
26\snippet qml/texthandling.qml int validator
27The validator types bind to \c {TextInput}'s \c validator property.
28
29\snippet qml/texthandling.qml regexp validator
30The regular expression in the snippet will only allow the inputted text to be
31\c {fruit basket}.
32
33Note that QML parses JavaScript regular expressions, while Qt's
34\l {QRegularExpression} class' regular expressions are based on Perl regular expressions.
35
36*/