aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/src/concepts/input/textinput.qdoc
blob: a1491236d08ce1e8b4c5e45a2175064ec84c1f92 (plain)
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
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page qtquick-input-textinput.html
\title Qt Quick Text Input Handling and Validators
\brief Text input and validation

\section1 Text Visual Types

Qt Quick provides several types to display text onto the screen. The \l Text
type will display formatted text onto the screen, the \l TextEdit type
will place a multiline line edit onto the screen, and the \l TextInput will
place a single editable line field onto the screen.

To learn more about their specific features and properties, visit their
respective documentation.

\section1 Validating Input Text

The \e validator types enforce the type and format of
\l TextInput objects.

\annotatedlist qtquick-text-validators

\snippet qml/texthandling.qml int validator
The validator types bind to \c {TextInput}'s \c validator property.

\snippet qml/texthandling.qml regexp validator
The regular expression in the snippet will only allow the inputted text to be
\c {fruit basket}.

Note that QML parses JavaScript regular expressions, while Qt's
\l {QRegularExpression} class' regular expressions are based on Perl regular expressions.

*/