aboutsummaryrefslogtreecommitdiffstats
path: root/src/controls
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2015-08-20 16:03:41 +0200
committerMitch Curtis <mitch.curtis@theqtcompany.com>2015-08-21 10:19:30 +0000
commit1182abcb5ab8b38a41630efe205dc4786e7d79d1 (patch)
tree78685a97cee29b040da57aa39bb8f7047626f085 /src/controls
parent99542dc7a50f4abb4b1d4ac5dc205205678b6eac (diff)
Add documentation to module page, and remove overview page.
The overview page doesn't seem necessary; it's one more click that can be avoided by presenting the information that it contains on the index page. I didn't categorise the QML types as was done for Qt Quick Controls, because we don't have enough types to fill most of those categories. Change-Id: I8456fe219eb69983229712b0d9f5eef1f3a83ada Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/controls')
-rw-r--r--src/controls/doc/qtquickcontrols2.qdocconf3
-rw-r--r--src/controls/doc/snippets/basic-example.qml (renamed from src/controls/doc/src/qtquickcontrols2-overview.qdoc)47
-rw-r--r--src/controls/doc/src/qtquickcontrols2-index.qdoc57
-rw-r--r--src/controls/doc/src/qtquickcontrols2.qdoc2
4 files changed, 71 insertions, 38 deletions
diff --git a/src/controls/doc/qtquickcontrols2.qdocconf b/src/controls/doc/qtquickcontrols2.qdocconf
index a6f47a53..923f74bb 100644
--- a/src/controls/doc/qtquickcontrols2.qdocconf
+++ b/src/controls/doc/qtquickcontrols2.qdocconf
@@ -30,7 +30,8 @@ depends = qtcore qtgui qtdoc qtqml qtquick qtquicklayouts qtquickdialogs
# is given as part of \example commands
exampledirs += ../../../examples/quick/controls \
../../imports/controls \
- ../../../tests/auto/snippets/data
+ ../../../tests/auto/snippets/data \
+ snippets
examplesinstallpath = quick/controls
headerdirs += ../
diff --git a/src/controls/doc/src/qtquickcontrols2-overview.qdoc b/src/controls/doc/snippets/basic-example.qml
index 8fe6f455..62ab2466 100644
--- a/src/controls/doc/src/qtquickcontrols2-overview.qdoc
+++ b/src/controls/doc/snippets/basic-example.qml
@@ -25,34 +25,19 @@
**
****************************************************************************/
-/*!
- \page qtquickcontrols2-overview.html
- \title Qt Quick Controls 2 Overview
- \brief A set of UI controls to create user interfaces in Qt Quick
-
- The Qt Quick Controls 2 provide a set of UI controls to create user interfaces
- in Qt Quick.
-
- \section1 Getting Started
-
- TODO
-
- \section1 Setting Up Controls from C++
-
- TODO
-
- \section2 Using C++ Data From QML
-
- TODO
-
- \section2 Deploying Qt Quick Controls 2
-
- TODO
-
- \section1 Related information
-
- \list
- \li \l{Qt Quick}
- \li \l{Qt Quick Controls 2}
- \endlist
-*/
+//! [0]
+import QtQuick 2.6
+import QtQuick.Controls 2.0
+
+ApplicationWindow {
+ title: "My Application"
+ width: 640
+ height: 480
+ visible: true
+
+ Button {
+ text: "Push Me"
+ anchors.centerIn: parent
+ }
+}
+//! [0]
diff --git a/src/controls/doc/src/qtquickcontrols2-index.qdoc b/src/controls/doc/src/qtquickcontrols2-index.qdoc
index 40d18801..b371ab1b 100644
--- a/src/controls/doc/src/qtquickcontrols2-index.qdoc
+++ b/src/controls/doc/src/qtquickcontrols2-index.qdoc
@@ -29,20 +29,65 @@
\page qtquickcontrols2-index.html
\title Qt Quick Controls 2
- \brief The Qt Quick Controls 2 module provides a set of UI controls for Qt Quick.
+ \brief The Qt Quick Controls 2 module provides a set of UI controls for Qt
+ Quick.
- The Qt Quick Controls 2 module provides a set of controls that can be used to
- build complete interfaces in Qt Quick.
+ The Qt Quick Controls 2 module provides a set of controls that can be used
+ to build complete interfaces in Qt Quick.
- The module is new in Qt 5.6.
+ \section1 QML Types
- Visit the \l{Qt Quick Controls 2 Overview} page to get started.
+ \generatelist {qmltypesbymodule QtQuick.Controls}
+
+ \section1 Getting Started
+
+ A basic example of a QML file that makes use of controls is shown here:
+
+ \snippet basic-example.qml 0
+
+ \section1 Setting Up Controls from C++
+
+ Although QQuickView has traditionally been used to display QML files in a
+ C++ application, doing this means you can only set window properties from
+ C++.
+
+ With Qt Quick Controls 2, declare an ApplicationWindow as the root item of
+ your application and launch it by using QQmlApplicationEngine instead.
+ This ensures that you can control top level window properties from QML.
+
+ A basic example of a source file that makes use of controls is shown here:
+
+ \code
+ #include <QApplication>
+ #include <QQmlApplicationEngine>
+
+ int main(int argc, char *argv[])
+ {
+ QGuiApplication app(argc, argv);
+ QQmlApplicationEngine engine("main.qml");
+ return app.exec();
+ }
+ \endcode
+
+ \section2 Using C++ Data From QML
+
+ If you need to register a C++ class to use from QML, you can call
+ qmlRegisterType() before declaring your QQmlApplicationEngine.
+ See \l [QtQml] {Defining QML Types from C++} for more information.
+
+ If you need to expose data to QML components, you need to make them
+ available to the context of the current QML engine. See QQmlContext for
+ more information.
+
+ \section2 Deploying Qt Quick Controls 2
+
+ TODO
\section1 Related information
\list
\li \l{Qt Quick}
- \li \l{Qt Quick Controls 2 Overview}
+ \li \l{Qt Quick Layouts}
\li \l{Qt Quick Controls 2 QML Types}{Qt Quick Controls 2 QML Types}
\endlist
*/
diff --git a/src/controls/doc/src/qtquickcontrols2.qdoc b/src/controls/doc/src/qtquickcontrols2.qdoc
index a33f85f3..9b52b09e 100644
--- a/src/controls/doc/src/qtquickcontrols2.qdoc
+++ b/src/controls/doc/src/qtquickcontrols2.qdoc
@@ -41,4 +41,6 @@
\code
import QtQuick.Controls 2.0
\endcode
+
+ \section1 QML Types
*/