Rename QDeclarative symbols to QQuick and QQml
[profile/ivi/qtdeclarative.git] / doc / src / qtquick2 / qmltexthandling.qdoc
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the documentation of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:FDL$
9 ** GNU Free Documentation License
10 ** Alternatively, this file may be used under the terms of the GNU Free
11 ** Documentation License version 1.3 as published by the Free Software
12 ** Foundation and appearing in the file included in the packaging of
13 ** this file.
14 **
15 ** Other Usage
16 ** Alternatively, this file may be used in accordance with the terms
17 ** and conditions contained in a signed written agreement between you
18 ** and Nokia.
19 **
20 **
21 **
22 **
23 **
24 ** $QT_END_LICENSE$
25 **
26 ****************************************************************************/
27
28 /*!
29 \page qtquick-texthandling.html
30 \ingroup QML Features
31
32 \title QML Text Handling and Validators
33 \brief elements that accept and handle text input
34
35 \tableofcontents
36
37 \section1 Text Elements
38
39 \list
40 \o \l{Text}
41 \o \l{TextInput}
42 \o \l{TextEdit}
43 \endlist
44
45 \section1 Validators
46 \list
47 \o \l{IntValidator}
48 \o \l{DoubleValidator}
49 \o \l{RegExpValidator}
50 \endlist
51
52 \section1 Displaying Text in QML
53 QML provides several elements to display text onto the screen. The \l Text
54 element will display formatted text onto the screen, the \l TextEdit element
55 will place a multiline line edit onto the screen, and the \l TextInput will
56 place a single editable line field onto the screen.
57
58 To learn more about their specific features and properties, visit their
59 respective element documentation.
60
61 \section1 Validating Input Text
62 The \l {Validators}{validator} elements enforce the type and format of
63 \l TextInput objects.
64
65 \snippet doc/src/snippets/qml/texthandling.qml int validator
66 The validator elements bind to \c {TextInput}'s \c validator property.
67
68 \snippet doc/src/snippets/qml/texthandling.qml regexp validator
69 The regular expression in the snippet will only allow the inputted text to be
70 \c {fruit basket}.
71
72 Note that QML parses JavaScript regular expressions, while Qt's
73 \l {QRegExp} class' regular expressions are based on Perl regular expressions.
74
75 */