summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenu <venugopal.shivashankar@digia.com>2014-07-03 16:14:27 +0200
committerVenugopal Shivashankar <venugopal.shivashankar@digia.com>2014-07-11 15:39:33 +0200
commitde8d57dd8b7815e2719186900cd5f65085d8c452 (patch)
treeb64a230045b9e8478f4687b7f6ca3154ad7b6006
parenta312fc13d99c20f78d5950a69f4b8b65828bd6c2 (diff)
downloadqtquickcontrols-de8d57dd8b7815e2719186900cd5f65085d8c452.tar.gz
Doc: Updated the example documentation
Task-number: QTBUG-37203 Change-Id: I8a3d48ea8163787cd7f41d43ea201be067d310f0 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
-rw-r--r--src/controls/doc/src/qtquickcontrols-examples.qdoc34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/controls/doc/src/qtquickcontrols-examples.qdoc b/src/controls/doc/src/qtquickcontrols-examples.qdoc
index 205720c8..7c971fa6 100644
--- a/src/controls/doc/src/qtquickcontrols-examples.qdoc
+++ b/src/controls/doc/src/qtquickcontrols-examples.qdoc
@@ -95,11 +95,39 @@
\example texteditor
\title Qt Quick Controls - Text Editor Example
\ingroup qtquickcontrols_examples
- \brief A text editor application.
+ \brief A QML app using Qt Quick Controls and a C++ class to
+ provide a fully-functional rich-text editor application.
+
\image qtquickcontrols-example-text.png
- This example implements a text editor using \l{Qt Quick Controls},
- complete with text formatting options, copy-paste and undo/redo.
+ 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 app also lets
+ you open and edit a plain text files.
+
+ The C++ class, DocumentHandler, extends QObject and is registered
+ as a QML type under the namespace, "\c{org.qtproject.example 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>("org.qtproject.example", 1, 0, "DocumentHandler");
+ ...
+ \endcode
+
+ QML namespace import:
+
+ \qml
+ import org.qtproject.example 1.0
+ \endqml
+
+ For more information about registering C++ classses as QML types, see
+ \l {Defining QML Types from C++}.
\include examples-run.qdocinc
*/