diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-07-06 13:04:07 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-08-11 16:47:48 +0000 |
commit | fcf4a1ed81c547f24384e005e9776f478161c616 (patch) | |
tree | 373907ca5fc1f87d0780fb7e2e4a4e9c5c6109fa /examples/quickcontrols2/texteditor/doc | |
parent | 4092df376916ad9477547ecd4ef4679dc59e0fdf (diff) |
Add Text Editor example
A follow up commit will contain the touch UI.
Change-Id: I26275fdd31294506821fa3e3e4a4bb63329665b9
Task-number: QTBUG-54952
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'examples/quickcontrols2/texteditor/doc')
-rw-r--r-- | examples/quickcontrols2/texteditor/doc/images/qtquickcontrols2-texteditor-desktop.png | bin | 0 -> 88813 bytes | |||
-rw-r--r-- | examples/quickcontrols2/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc | 67 |
2 files changed, 67 insertions, 0 deletions
diff --git a/examples/quickcontrols2/texteditor/doc/images/qtquickcontrols2-texteditor-desktop.png b/examples/quickcontrols2/texteditor/doc/images/qtquickcontrols2-texteditor-desktop.png Binary files differnew file mode 100644 index 00000000..4b4d7f79 --- /dev/null +++ b/examples/quickcontrols2/texteditor/doc/images/qtquickcontrols2-texteditor-desktop.png diff --git a/examples/quickcontrols2/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc b/examples/quickcontrols2/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc new file mode 100644 index 00000000..60ff0567 --- /dev/null +++ b/examples/quickcontrols2/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example texteditor + \title Qt Quick Controls 2 - Text Editor + \ingroup qtquickcontrols2-examples + \brief A QML app using Qt Quick Controls 2 and a C++ class to + provide a fully-functional rich-text editor application. + + \image qtquickcontrols2-texteditor-desktop.png + + The \e {Text Editor Example} presents a sample HTML file using the TextArea + control, preserving the HTML formatting. It uses a C++ class to handle the + document by providing options to open, format, and edit. The application + also lets you open and edit plain text files. + + The C++ class, DocumentHandler, extends QObject and is registered + as a QML type under the namespace \c {io.qt.examples.texteditor 1.0}. + + The following snippets show how the type is registered under + a namespace and later imported by \e main.qml. + + QML type registration: + + \code + #include <QtQml/qqml.h> + ... + qmlRegisterType<DocumentHandler>("io.qt.examples.texteditor", 1, 0, "DocumentHandler"); + ... + \endcode + + QML namespace import: + + \code + import io.qt.examples.texteditor 1.0 + \endcode + + For more information about registering C++ classes as QML types, see + \l {Defining QML Types from C++}. + + \include examples-run.qdocinc +*/ |