Doc: Moving Qt Quick docs for new doc structure
[profile/ivi/qtdeclarative.git] / src / quick / doc / src / 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 \title Text Handling and Validators
31 \brief elements that accept and handle text input
32
33 \tableofcontents
34
35 \section1 Text Elements
36
37 \list
38 \li \l{Text}
39 \li \l{TextInput}
40 \li \l{TextEdit}
41 \endlist
42
43 \section1 Validators
44 \list
45 \li \l{IntValidator}
46 \li \l{DoubleValidator}
47 \li \l{RegExpValidator}
48 \endlist
49
50 \section1 Displaying Text in QML
51 QML provides several elements to display text onto the screen. The \l Text
52 element will display formatted text onto the screen, the \l TextEdit element
53 will place a multiline line edit onto the screen, and the \l TextInput will
54 place a single editable line field onto the screen.
55
56 To learn more about their specific features and properties, visit their
57 respective element documentation.
58
59 \section1 Validating Input Text
60 The \l {Validators}{validator} elements enforce the type and format of
61 \l TextInput objects.
62
63 \snippet doc/snippets/qml/texthandling.qml int validator
64 The validator elements bind to \c {TextInput}'s \c validator property.
65
66 \snippet doc/snippets/qml/texthandling.qml regexp validator
67 The regular expression in the snippet will only allow the inputted text to be
68 \c {fruit basket}.
69
70 Note that QML parses JavaScript regular expressions, while Qt's
71 \l {QRegExp} class' regular expressions are based on Perl regular expressions.
72
73 */