diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2022-11-18 15:15:16 +0800 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2022-12-01 10:26:20 +0800 |
commit | 4bd87b903b355b53e3105ba1ae7c154c4e55cdaf (patch) | |
tree | cc2edb597f0d5871302eb86e9dda78217384a5aa /examples/quickcontrols/texteditor/doc | |
parent | 786e1748d4469c135a922a221024f3f9c421c0de (diff) |
Remove "2" from Qt Quick Controls directories
Qt Quick Controls 2 was named that way because it was a follow-up to
Qt Quick Controls 1.x. Now that Qt Quick Controls 1 is no longer
supported, we don't need to have "2" in the name. Work on this was
already started for the documentation in
1abdfe5d5a052f2298b7bf657513dfa7e0c66a56.
By doing this renaming a few weeks before feature freeze, it won't
affect the release but still results in as little time possible spent
manually fixing conflicts in cherry-picks from non-LTS releases as a
result of the renaming.
This patch does the following:
- Renames directories.
- Adapts CMakeLists.txt and other files to account for the new paths.
A follow-up patch will handle documentation.
It does not touch library names or other user-facing stuff, as that
will have to be done in Qt 7.
Task-number: QTBUG-95413
Change-Id: I170d8db19033ee71e495ff0c5c1a517a41ed7634
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples/quickcontrols/texteditor/doc')
-rw-r--r-- | examples/quickcontrols/texteditor/doc/images/qtquickcontrols2-texteditor-desktop.jpg | bin | 0 -> 76304 bytes | |||
-rw-r--r-- | examples/quickcontrols/texteditor/doc/images/qtquickcontrols2-texteditor-touch.jpg | bin | 0 -> 31203 bytes | |||
-rw-r--r-- | examples/quickcontrols/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc | 100 |
3 files changed, 100 insertions, 0 deletions
diff --git a/examples/quickcontrols/texteditor/doc/images/qtquickcontrols2-texteditor-desktop.jpg b/examples/quickcontrols/texteditor/doc/images/qtquickcontrols2-texteditor-desktop.jpg Binary files differnew file mode 100644 index 0000000000..259e0e8b07 --- /dev/null +++ b/examples/quickcontrols/texteditor/doc/images/qtquickcontrols2-texteditor-desktop.jpg diff --git a/examples/quickcontrols/texteditor/doc/images/qtquickcontrols2-texteditor-touch.jpg b/examples/quickcontrols/texteditor/doc/images/qtquickcontrols2-texteditor-touch.jpg Binary files differnew file mode 100644 index 0000000000..6a924cdf52 --- /dev/null +++ b/examples/quickcontrols/texteditor/doc/images/qtquickcontrols2-texteditor-touch.jpg diff --git a/examples/quickcontrols/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc b/examples/quickcontrols/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc new file mode 100644 index 0000000000..d626a6a04e --- /dev/null +++ b/examples/quickcontrols/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc @@ -0,0 +1,100 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only +/*! + \example texteditor + \keyword Qt Quick Controls - Text Editor + \title Qt Quick Controls - Text Editor + \keyword Qt Quick Controls 2 - Text Editor + \ingroup qtquickcontrols2-examples + \brief A QML app using Qt Quick Controls and a C++ class to + provide a fully-functional rich-text editor application. + + The \e {Text Editor Example} presents a sample HTML file using the TextArea + control, preserving the HTML formatting. The application comes with two user + interfaces; one for traditional desktop platforms with a mouse pointer, and + another simpler, touch-oriented version. + + \section1 Desktop User Interface + + \image qtquickcontrols2-texteditor-desktop.jpg + + The desktop version is a complete text editor with capabilities for formatting + text, and opening and saving HTML and plain text files. It demonstrates the + native-looking dialogs and menus using the \l{Qt Labs Platform} module. These + types are mostly suitable for desktop platforms with support for multiple + top-level windows, a mouse pointer, and moderate screen size. + + The desktop UI uses FileDialog for opening and saving files: + + \quotefromfile texteditor/qml/texteditor.qml + \skipto FileDialog + \printuntil /\bsaveAs\b/ + \printline } + + It uses FontDialog and ColorDialog for choosing fonts and colors: + + \skipto FontDialog + \printuntil /.*colorDialog$/ + \printuntil /^\s{4}\}$/ + + It also uses \l[QML QtLabsPlatform]{Menu} and + \l[QML QtLabsPlatform]{MenuItem} that provide a context menu to format text + within: + + \skipto /\bMenu\b/ + \printuntil /^\s{4}\}$/ + + \note There is also a standard menubar with more options than the + context menu. + + \section1 Touch User Interface + + \image qtquickcontrols2-texteditor-touch.jpg + + The touch user interface is a simplified version of the text editor. It is + suitable for touch devices with limited screen size. The example uses + \l{Using File Selectors with Qt Quick Controls}{file selectors} to load + the appropriate user interface automatically. + + Unlike the desktop version, which uses top-level dialogs, the touch version + uses the QML \l Dialog type, which is not a top-level window. This type of + dialog is fully supported on mobile and embedded platforms that do not support + multiple top-level windows. + + \quotefromfile texteditor/qml/+touch/texteditor.qml + \skipto /\bDialog\b/ + \printuntil /^\s{4}\}$/ + + \section1 C++ Backend + + Both user interfaces use the same C++ backend, which supports opening, formatting, + and editing a document. The C++ class, \c 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 and instantiated by \e main.qml. For more information about registering C++ + classes as QML types, see \l {Defining QML Types from C++}. + + 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 + + QML instance: + + \quotefromfile texteditor/qml/texteditor.qml + \skipto DocumentHandler + \printuntil /^\s{4}\}$/ + + \include examples-run.qdocinc +*/ |