diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-25 11:02:44 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-25 11:03:53 +0100 |
commit | 5ada1525e03116326a480fb05611904d3484c296 (patch) | |
tree | f23822e6b0482012065b9586d95cb8ab5d70c4bf /src/imports/controls/doc/src | |
parent | f4f5e857447d42738b1b60b5c4184f39df2f1593 (diff) | |
parent | 4f1fb09ed70c69e73f2e19f28f4299f4cfbc90dc (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
.gitignore
src/templates/qquickcombobox_p.h
src/templates/qquickmenu_p.h
src/templates/qquickmenu_p_p.h
src/templates/qquickoverlay_p.h
src/templates/qquickpopup.cpp
src/templates/qquickpopup_p.h
src/templates/qquickstackview_p.cpp
Change-Id: I89c7d518697beec0b81ef3a12205286a4f3ccf89
Diffstat (limited to 'src/imports/controls/doc/src')
6 files changed, 114 insertions, 54 deletions
diff --git a/src/imports/controls/doc/src/qtlabscontrols-gettingstarted.qdoc b/src/imports/controls/doc/src/qtlabscontrols-gettingstarted.qdoc new file mode 100644 index 00000000..3f6d2898 --- /dev/null +++ b/src/imports/controls/doc/src/qtlabscontrols-gettingstarted.qdoc @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2015 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$ +** +****************************************************************************/ + +/*! + \page qtlabscontrols-gettingstarted.html + \title Getting Started with Qt Labs Controls + + 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 Labs Controls, 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 <QGuiApplication> + #include <QQmlApplicationEngine> + + int main(int argc, char *argv[]) + { + QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + 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. +*/ diff --git a/src/imports/controls/doc/src/qtlabscontrols-index.qdoc b/src/imports/controls/doc/src/qtlabscontrols-index.qdoc index dc198135..93040e3f 100644 --- a/src/imports/controls/doc/src/qtlabscontrols-index.qdoc +++ b/src/imports/controls/doc/src/qtlabscontrols-index.qdoc @@ -42,50 +42,10 @@ \section2 Qt.labs.calendar Module \generatelist {qmltypesbymodule Qt.labs.calendar} - \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 Labs Controls, 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 <QGuiApplication> - #include <QQmlApplicationEngine> - - int main(int argc, char *argv[]) - { - QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - 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. - \section1 Important Concepts in Qt Labs Controls \list + \li \l{Getting Started with Qt Labs Controls} \li \l{Styling Qt Labs Controls} \li \l{High-DPI Support in Qt Labs Controls} \li \l{Differences between Qt Quick Controls} diff --git a/src/imports/controls/doc/src/qtlabscontrols-material.qdoc b/src/imports/controls/doc/src/qtlabscontrols-material.qdoc index f9b6a008..e2cadbda 100644 --- a/src/imports/controls/doc/src/qtlabscontrols-material.qdoc +++ b/src/imports/controls/doc/src/qtlabscontrols-material.qdoc @@ -38,6 +38,7 @@ \list \li \l {accent-attached-prop}{\b accent} : color + \li \l {primary-attached-prop}{\b primary} : color \li \l {theme-attached-prop}{\b theme} : enumeration \endlist @@ -59,9 +60,9 @@ \section2 Customization - The Material style allows customizing two attributes, \l {theme-attached-prop}{theme} - and \l {accent-attached-prop}{accent}. The following example illustrates how to create - a red \e stop button with light text: + The Material style allows customizing three attributes, \l {theme-attached-prop}{theme}, + \l {primary-attached-prop}{primary} and \l {accent-attached-prop}{accent}. The following + example illustrates how to create a red \e stop button with light text: \table \row @@ -123,18 +124,13 @@ of explicit Material style-specific references, the Material style must be deployed with the application. - \section1 Attached Property Documentation - - \styleproperty {Material.accent} {color} {accent-attached-prop} - \target accent-attached-prop - This attached property holds the accent color of the theme. The property - can be attached to any window or item. The value is propagated to children. + \section2 Pre-defined Colors - Even though the accent can be any \l {colorbasictypedocs}{color}, it is - recommended to use one of the pre-defined accents that have been designed + Even though primary and accent can be any \l {colorbasictypedocs}{color}, it + is recommended to use one of the pre-defined colors that have been designed to work well with the rest of the Material style palette: - Available accents: + Available pre-defined colors: \value Material.Red Red (#F44336) \value Material.Pink Pink (#E91E63) \value Material.Purple Purple (#9C27B0) @@ -143,7 +139,7 @@ \value Material.Blue Blue (#2196F3) \value Material.LightBlue Light Blue (#03A9F4) \value Material.Cyan Cyan (#00BCD4) - \value Material.Teal Teal (#009688, default) + \value Material.Teal Teal (#009688) \value Material.Green Green (#4CAF50) \value Material.LightGreen Light Green (#8BC34A) \value Material.Lime Lime (#CDDC39) @@ -155,6 +151,34 @@ \value Material.Grey Grey (#9E9E9E) \value Material.BlueGrey Blue Grey (#607D8B) + \labs + + \section1 Attached Property Documentation + + \styleproperty {Material.accent} {color} {accent-attached-prop} + \target accent-attached-prop + This attached property holds the accent color of the theme. The property + can be attached to any window or item. The value is propagated to children. + + The default value is \c Material.Teal. + + \note Even though the accent can be any \l {colorbasictypedocs}{color}, it is + recommended to use one of the \l {pre-defined colors} that have been designed + to work well with the rest of the Material style palette. + + \endstyleproperty + + \styleproperty {Material.primary} {color} {primary-attached-prop} + \target primary-attached-prop + This attached property holds the primary color of the theme. The property + can be attached to any window or item. The value is propagated to children. + + The default value is \c Material.BlueGray. + + \note Even though the primary can be any \l {colorbasictypedocs}{color}, it is + recommended to use one of the \l {pre-defined colors} that have been designed + to work well with the rest of the Material style palette. + \endstyleproperty \styleproperty {Material.theme} {enumeration} {theme-attached-prop} diff --git a/src/imports/controls/doc/src/qtlabscontrols-universal.qdoc b/src/imports/controls/doc/src/qtlabscontrols-universal.qdoc index 3c616d84..bf3dcfdc 100644 --- a/src/imports/controls/doc/src/qtlabscontrols-universal.qdoc +++ b/src/imports/controls/doc/src/qtlabscontrols-universal.qdoc @@ -124,6 +124,8 @@ of explicit Universal style-specific references, the Universal style must be deployed with the application. + \labs + \section1 Attached Property Documentation \styleproperty {Universal.accent} {color} {accent-attached-prop} diff --git a/src/imports/controls/doc/src/qtlabscontrols.qdoc b/src/imports/controls/doc/src/qtlabscontrols.qdoc index 10476f08..17e93a44 100644 --- a/src/imports/controls/doc/src/qtlabscontrols.qdoc +++ b/src/imports/controls/doc/src/qtlabscontrols.qdoc @@ -49,6 +49,8 @@ import Qt.labs.calendar 1.0 \endcode + \labs + \section1 QML Types \section2 Qt.labs.controls Module diff --git a/src/imports/controls/doc/src/templates/qtlabstemplates.qdoc b/src/imports/controls/doc/src/templates/qtlabstemplates.qdoc index 84eabe44..0f7f7d86 100644 --- a/src/imports/controls/doc/src/templates/qtlabstemplates.qdoc +++ b/src/imports/controls/doc/src/templates/qtlabstemplates.qdoc @@ -41,6 +41,8 @@ import Qt.labs.templates 1.0 as T \endcode + \labs + For the sake of clarity, there is a one-to-one mapping between the types provided by the \c Qt.labs.templates and \c Qt.labs.controls imports. For every type available in the \c Qt.labs.controls import, a non-visual template |