summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-03-17 16:40:37 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-03-17 16:40:37 +0100
commit22272718f2d1d256ed51bc50b5b5d63e781a32fe (patch)
tree1ed0dd6215d91e6de29c59278041a20fc3d28676
parent7b0a7c3ebb367fed26544598cb972f2820c52d50 (diff)
parentfff5ad57fc2ae90a519c4864f7d05968c68d08f4 (diff)
downloadqtquickcontrols-22272718f2d1d256ed51bc50b5b5d63e781a32fe.tar.gz
Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: Ic5cc4de64e4365cfbc5587c28e140d39cdda8a93
-rw-r--r--LGPL_EXCEPTION.txt22
-rw-r--r--examples/quick/controls/controls.pro3
-rw-r--r--examples/quick/controls/uiforms/MainForm.ui.qml98
-rw-r--r--examples/quick/controls/uiforms/main.cpp59
-rw-r--r--examples/quick/controls/uiforms/main.qml131
-rw-r--r--examples/quick/controls/uiforms/qml/CustomerModel.qml144
-rw-r--r--examples/quick/controls/uiforms/qml/History.qml76
-rw-r--r--examples/quick/controls/uiforms/qml/HistoryForm.ui.qml80
-rw-r--r--examples/quick/controls/uiforms/qml/Notes.qml76
-rw-r--r--examples/quick/controls/uiforms/qml/NotesForm.ui.qml85
-rw-r--r--examples/quick/controls/uiforms/qml/Settings.qml96
-rw-r--r--examples/quick/controls/uiforms/qml/SettingsForm.ui.qml259
-rw-r--r--examples/quick/controls/uiforms/uiforms.pro21
-rw-r--r--examples/quick/controls/uiforms/uiforms.qrc13
-rw-r--r--src/controls/Calendar.qml4
-rw-r--r--src/controls/ComboBox.qml8
-rw-r--r--src/controls/Private/qquickcontrolsettings.cpp2
-rw-r--r--src/controls/SplitView.qml6
-rw-r--r--src/controls/StackView.qml30
-rw-r--r--src/controls/StackViewDelegate.qml4
-rw-r--r--src/controls/Styles/Base/CircularGaugeStyle.qml2
-rw-r--r--src/controls/Styles/Base/DialStyle.qml2
-rw-r--r--src/controls/Styles/Base/MenuBarStyle.qml4
-rw-r--r--src/controls/Styles/Base/MenuStyle.qml4
-rw-r--r--src/controls/Styles/Base/PieMenuStyle.qml3
-rw-r--r--src/controls/TabView.qml15
-rw-r--r--src/controls/TableView.qml2
-rw-r--r--src/controls/TableViewColumn.qml3
-rw-r--r--src/controls/TextArea.qml26
-rw-r--r--src/controls/TextField.qml22
-rw-r--r--src/controls/doc/images/qtquickcontrols-example-uiforms.pngbin0 -> 48979 bytes
-rw-r--r--src/controls/doc/src/qtquickcontrols-examples.qdoc61
-rw-r--r--src/controls/qquickaction.cpp2
-rw-r--r--src/controls/qquickmenuitem.cpp2
-rw-r--r--src/extras/Tumbler.qml16
35 files changed, 1300 insertions, 81 deletions
diff --git a/LGPL_EXCEPTION.txt b/LGPL_EXCEPTION.txt
deleted file mode 100644
index 5cdacb9a..00000000
--- a/LGPL_EXCEPTION.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-The Qt Company Qt LGPL Exception version 1.1
-
-As an additional permission to the GNU Lesser General Public License version
-2.1, the object code form of a "work that uses the Library" may incorporate
-material from a header file that is part of the Library. You may distribute
-such object code under terms of your choice, provided that:
- (i) the header files of the Library have not been modified; and
- (ii) the incorporated material is limited to numerical parameters, data
- structure layouts, accessors, macros, inline functions and
- templates; and
- (iii) you comply with the terms of Section 6 of the GNU Lesser General
- Public License version 2.1.
-
-Moreover, you may apply this exception to a modified version of the Library,
-provided that such modification does not involve copying material from the
-Library into the modified Library's header files unless such material is
-limited to (i) numerical parameters; (ii) data structure layouts;
-(iii) accessors; and (iv) small macros, templates and inline functions of
-five lines or less in length.
-
-Furthermore, you are not required to apply this additional permission to a
-modified version of the Library.
diff --git a/examples/quick/controls/controls.pro b/examples/quick/controls/controls.pro
index ea8ce554..52ab8c45 100644
--- a/examples/quick/controls/controls.pro
+++ b/examples/quick/controls/controls.pro
@@ -5,7 +5,8 @@ SUBDIRS += \
tableview \
touch \
basiclayouts \
- styles
+ styles \
+ uiforms
qtHaveModule(widgets) {
SUBDIRS += texteditor filesystembrowser
diff --git a/examples/quick/controls/uiforms/MainForm.ui.qml b/examples/quick/controls/uiforms/MainForm.ui.qml
new file mode 100644
index 00000000..4649209f
--- /dev/null
+++ b/examples/quick/controls/uiforms/MainForm.ui.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Dialogs 1.1
+import QtQuick.Controls 1.2
+
+Item {
+ width: 800
+ height: 480
+ property alias tableView: tableView
+
+ SplitView {
+ id: splitView
+ anchors.fill: parent
+
+ TableView {
+ id: tableView
+
+ property int columnWidth: width / 3
+ Layout.minimumWidth: splitView.width / 3
+
+ TableViewColumn {
+ role: "customerId"
+ title: qsTr("Customer Id")
+ width: tableView.columnWidth
+ }
+
+ TableViewColumn {
+ role: "firstName"
+ title: qsTr("First Name")
+ width: tableView.columnWidth
+ }
+ TableViewColumn {
+ role: "lastName"
+ title: qsTr("Last Name")
+ width: tableView.columnWidth
+ }
+ }
+
+ TabView {
+ id: tabView
+
+ Layout.minimumWidth: 480
+
+ Tab {
+ title: qsTr("Customer Settings")
+ source: "qml/Settings.qml"
+ }
+ Tab {
+ title: qsTr("Customer Notes")
+ source: "qml/Notes.qml"
+ }
+ Tab {
+ title: qsTr("Customer History")
+ source: "qml/History.qml"
+ }
+ }
+ }
+}
diff --git a/examples/quick/controls/uiforms/main.cpp b/examples/quick/controls/uiforms/main.cpp
new file mode 100644
index 00000000..de92dd70
--- /dev/null
+++ b/examples/quick/controls/uiforms/main.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtquickcontrolsapplication.h"
+#include <QtQml>
+#include <QtGui/QSurfaceFormat>
+
+int main(int argc, char *argv[])
+{
+ QtQuickControlsApplication app(argc, argv);
+ if (QCoreApplication::arguments().contains(QLatin1String("--coreprofile"))) {
+ QSurfaceFormat fmt;
+ fmt.setVersion(4, 4);
+ fmt.setProfile(QSurfaceFormat::CoreProfile);
+ QSurfaceFormat::setDefaultFormat(fmt);
+ }
+
+ qmlRegisterSingletonType(QUrl(QStringLiteral("qrc:/qml/CustomerModel.qml")), "io.qt.example", 1, 0, "CustomerModel");
+
+ QQmlApplicationEngine engine(QUrl("qrc:/main.qml"));
+ return app.exec();
+}
diff --git a/examples/quick/controls/uiforms/main.qml b/examples/quick/controls/uiforms/main.qml
new file mode 100644
index 00000000..da258022
--- /dev/null
+++ b/examples/quick/controls/uiforms/main.qml
@@ -0,0 +1,131 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Dialogs 1.1
+import QtQuick.Controls 1.2
+import io.qt.example 1.0
+import "qml"
+
+ApplicationWindow {
+ visible: true
+ title: "Qt Quick UI Forms"
+
+ MessageDialog {
+ id: aboutDialog
+ icon: StandardIcon.Information
+ title: qsTr("About")
+ text: "Qt Quick UI Forms"
+ informativeText: qsTr("This example demonstrates how to separate the implementation of an application from the UI using ui.qml files.")
+ }
+
+ Action {
+ id: copyAction
+ text: qsTr("&Copy")
+ shortcut: StandardKey.Copy
+ iconName: "edit-copy"
+ enabled: (!!activeFocusItem && !!activeFocusItem["copy"])
+ onTriggered: activeFocusItem.copy()
+ }
+
+ Action {
+ id: cutAction
+ text: qsTr("Cu&t")
+ shortcut: StandardKey.Cut
+ iconName: "edit-cut"
+ enabled: (!!activeFocusItem && !!activeFocusItem["cut"])
+ onTriggered: activeFocusItem.cut()
+ }
+
+ Action {
+ id: pasteAction
+ text: qsTr("&Paste")
+ shortcut: StandardKey.Paste
+ iconName: "edit-paste"
+ enabled: (!!activeFocusItem && !!activeFocusItem["paste"])
+ onTriggered: activeFocusItem.paste()
+ }
+
+ menuBar: MenuBar {
+ Menu {
+ title: qsTr("&File")
+ MenuItem {
+ text: qsTr("E&xit")
+ shortcut: StandardKey.Quit
+ onTriggered: Qt.quit()
+ }
+ }
+ Menu {
+ title: qsTr("&Edit")
+ MenuItem {
+ action: cutAction
+ }
+ MenuItem {
+ action: copyAction
+ }
+ MenuItem {
+ action: pasteAction
+ }
+ }
+ Menu {
+ title: qsTr("&Help")
+ MenuItem {
+ text: qsTr("About...")
+ onTriggered: aboutDialog.open()
+ }
+ }
+ }
+
+ MainForm {
+ id: mainForm
+
+ anchors.fill: parent
+
+ Layout.minimumWidth: 800
+ Layout.minimumHeight: 480
+ Layout.preferredWidth: 768
+ Layout.preferredHeight: 480
+
+ tableView.model: CustomerModel
+
+ Component.onCompleted: CustomerModel.selection = tableView.selection
+ }
+}
diff --git a/examples/quick/controls/uiforms/qml/CustomerModel.qml b/examples/quick/controls/uiforms/qml/CustomerModel.qml
new file mode 100644
index 00000000..70a9695d
--- /dev/null
+++ b/examples/quick/controls/uiforms/qml/CustomerModel.qml
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+pragma Singleton
+
+import QtQuick 2.0
+
+ListModel {
+ property QtObject selection
+ ListElement {
+ customerId: "15881123"
+ firstName: "Julia"
+ title: "Ms."
+ lastName: "Jefferson"
+ email: "Julia@example.com"
+ address: "Spandia Avenue, Suite 610"
+ city: "Toronto"
+ zipCode: "92334"
+ phoneNumber: "0803-033330"
+ notes: "Very demanding customer."
+ history: "21.4.2014|Order|coffee~23.4.2014|Order|poster~29.4.2014|Invoice|poster 40$~05.5.2014|Overdue Notice|poster 40$"
+ }
+
+ ListElement {
+ customerId: "29993496"
+ firstName: "Tim"
+ lastName: "Northington"
+ title: "Mr."
+ email: "Northington@example.com"
+ address: "North Fifth Street 55"
+ city: "San Jose"
+ zipCode: "95112"
+ phoneNumber: "09000-3330"
+ notes: "Very good customer."
+ history: "18.4.2014|Order|orange juice~23.4.2014|Order|chair~24.4.2014|Complaint|Chair is broken."
+ }
+
+ ListElement {
+ customerId: "37713567"
+ firstName: "Daniel"
+ lastName: "Krumm"
+ title: "Mr."
+ email: "Krumm@example.com"
+ address: "Waterfront 14"
+ city: "Berlin"
+ zipCode: "12334"
+ phoneNumber: "0708093330"
+ notes: "This customer has a lot of Complaintts."
+ history: "15.4.2014|Order|table~25.4.2014|Return|table~28.4.2014|Complaint|Table had wrong color."
+ }
+
+ ListElement {
+ customerId: "45817387"
+ firstName: "Sandra"
+ lastName: "Booth"
+ title: "Ms."
+ email: "Sandrab@example.com"
+ address: "Folsom Street 23"
+ city: "San Francisco"
+ zipCode: "94103"
+ phoneNumber: "0103436370"
+ notes: "This customer is not paying."
+ history: "22.4.2014|Order|coffee~23.4.2014|Order|smartphone~29.4.2014|Invoice|smartphone 200$~05.5.2014|Overdue Notice|smartphone 200$"
+ }
+
+ ListElement {
+ customerId: "588902396"
+ firstName: "Lora"
+ lastName: "Beckner"
+ title: "Ms."
+ email: "LoraB@example.com"
+ address: " W Wilson Apt 3"
+ city: "Los Angeles"
+ zipCode: "90086"
+ phoneNumber: "0903436360"
+ notes: "This customer usually pays late."
+ history: "17.4.2014|Order|soft drink~23.4.2014|Order|computer~29.4.2014|Invoice|computer 1200$~07.5.2014|Overdue Notice|computer 1200$"
+ }
+
+ ListElement {
+ customerId: "67873693"
+ firstName: "Daniel"
+ lastName: "Krumm"
+ title: "Mr."
+ email: "Krumm@example.com"
+ address: "Waterfront 14"
+ city: "Berlin"
+ zipCode: "12334"
+ phoneNumber: "0303033330"
+ notes: "This customer has a lot of Complaints."
+ history: "23.4.2014|Order|jacket~25.4.2014|Return|jacket~28.4.2014|Complaint|Jacket had wrong color."
+ }
+
+ ListElement {
+ customerId: "78885693"
+ firstName: "Vanessa"
+ lastName: "Newbury"
+ title: "Ms."
+ email: "VanessaN@example.com"
+ address: "Madison Ave. 277"
+ city: "New York"
+ zipCode: "10016"
+ phoneNumber: "0503053530"
+ notes: "Deliveries sometime do not arrive on time."
+ history: "19.4.2014|Order|coffee~23.4.2014|Order|bicycle~29.4.2014|Invoice|bicycle 500$~06.5.2014|Overdue Notice|bicycle 500$"
+ }
+}
diff --git a/examples/quick/controls/uiforms/qml/History.qml b/examples/quick/controls/uiforms/qml/History.qml
new file mode 100644
index 00000000..336d717f
--- /dev/null
+++ b/examples/quick/controls/uiforms/qml/History.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 1.2
+import io.qt.example 1.0
+
+HistoryForm {
+ id: form
+
+ function readData() {
+ CustomerModel.selection.forEach(function (rowIndex) {
+
+ var history = CustomerModel.get(rowIndex).history
+ var entries = history.split("~")
+
+ form.tableView.model.clear()
+
+ var index
+ for (index = 0; index < entries.length; index++) {
+ var entry = entries[index]
+ var data = entry.split("|")
+ form.tableView.model.append({
+ date: data[0],
+ type: data[1],
+ text: data[2]
+ })
+ }
+ })
+ }
+
+ Connections {
+ target: CustomerModel.selection
+ onSelectionChanged: form.readData()
+ }
+
+ Component.onCompleted: readData()
+}
diff --git a/examples/quick/controls/uiforms/qml/HistoryForm.ui.qml b/examples/quick/controls/uiforms/qml/HistoryForm.ui.qml
new file mode 100644
index 00000000..9445b12f
--- /dev/null
+++ b/examples/quick/controls/uiforms/qml/HistoryForm.ui.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 1.2
+
+Item {
+ id: content
+
+ width: 640
+ height: 480
+ property alias tableView: tableView
+
+ TableView {
+ id: tableView
+
+ property int columnWidth: width / 3
+
+ anchors.fill: parent
+
+ TableViewColumn {
+ role: "date"
+ title: qsTr("Date")
+ width: tableView.columnWidth
+ }
+
+ TableViewColumn {
+ role: "type"
+ title: qsTr("Type")
+ width: tableView.columnWidth
+ }
+
+ TableViewColumn {
+ role: "text"
+ title: qsTr("Description")
+ width: tableView.columnWidth
+ }
+
+ model: ListModel {
+ }
+ }
+}
diff --git a/examples/quick/controls/uiforms/qml/Notes.qml b/examples/quick/controls/uiforms/qml/Notes.qml
new file mode 100644
index 00000000..af506af3
--- /dev/null
+++ b/examples/quick/controls/uiforms/qml/Notes.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 1.2
+import io.qt.example 1.0
+
+NotesForm {
+ id: form
+
+ function readData() {
+ CustomerModel.selection.forEach(function (rowIndex) {
+ form.textArea.text = CustomerModel.get(rowIndex).notes
+ })
+
+ save.enabled = true
+ cancel.enabled = true
+ form.textArea.enabled = true
+ }
+
+ function writeData() {
+ CustomerModel.selection.forEach(function (rowIndex) {
+ var data = CustomerModel.get(rowIndex)
+ data.notes = form.textArea.text
+ CustomerModel.set(rowIndex, data)
+ })
+ }
+
+ cancel.onClicked: readData()
+ save.onClicked: writeData()
+
+ Connections {
+ target: CustomerModel.selection
+ onSelectionChanged: form.readData()
+ }
+
+ Component.onCompleted: readData()
+}
diff --git a/examples/quick/controls/uiforms/qml/NotesForm.ui.qml b/examples/quick/controls/uiforms/qml/NotesForm.ui.qml
new file mode 100644
index 00000000..9552afcd
--- /dev/null
+++ b/examples/quick/controls/uiforms/qml/NotesForm.ui.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 1.2
+
+Item {
+ id: content
+
+ property alias cancel: cancel
+ property alias save: save
+ property alias textArea: textArea
+
+ width: 640
+ height: 480
+
+ ColumnLayout {
+ anchors.rightMargin: 12
+ anchors.leftMargin: 12
+ anchors.bottomMargin: 12
+ anchors.topMargin: 12
+ anchors.fill: parent
+
+ TextArea {
+ id: textArea
+ x: 8
+ y: 8
+ width: 624
+ height: 320
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ }
+ RowLayout {
+ Layout.alignment: Qt.AlignTop | Qt.AlignRight
+ Button {
+ id: save
+ text: qsTr("Save")
+ enabled: false
+ }
+ Button {
+ id: cancel
+ text: qsTr("Cancel")
+ enabled: false
+ }
+ }
+ }
+}
diff --git a/examples/quick/controls/uiforms/qml/Settings.qml b/examples/quick/controls/uiforms/qml/Settings.qml
new file mode 100644
index 00000000..658c62d3
--- /dev/null
+++ b/examples/quick/controls/uiforms/qml/Settings.qml
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 1.2
+import QtQuick.Dialogs 1.2
+import io.qt.example 1.0
+
+SettingsForm {
+ id: form
+ anchors.fill: parent
+
+ function readData() {
+ CustomerModel.selection.forEach(function (rowIndex) {
+ form.firstName.text = CustomerModel.get(rowIndex).firstName
+ form.lastName.text = CustomerModel.get(rowIndex).lastName
+ form.customerId.text = CustomerModel.get(rowIndex).customerId
+ form.email.text = CustomerModel.get(rowIndex).email
+ form.address.text = CustomerModel.get(rowIndex).address
+ form.phoneNumber.text = CustomerModel.get(rowIndex).phoneNumber
+ form.zipCode.text = CustomerModel.get(rowIndex).zipCode
+ form.city.text = CustomerModel.get(rowIndex).city
+ form.title.currentIndex = form.title.find(CustomerModel.get(rowIndex).title)
+ })
+
+ save.enabled = true
+ cancel.enabled = true
+ gridLayout.enabled = true
+ }
+
+ function writeData() {
+ CustomerModel.selection.forEach(function (rowIndex) {
+ var notes = CustomerModel.get(rowIndex).notes
+ CustomerModel.set(rowIndex, {
+ firstName: form.firstName.text,
+ lastName: form.lastName.text,
+ customerId: form.customerId.text,
+ email: form.firstName.email,
+ address: form.lastName.address,
+ phoneNumber: form.customerId.phoneNumber,
+ zipCode: form.customerId.zipCode,
+ city: form.customerId.city,
+ title: form.title.currentText,
+ notes: notes
+ })
+ })
+ }
+
+ cancel.onClicked: readData()
+ save.onClicked: writeData()
+
+ Connections {
+ target: CustomerModel.selection
+ onSelectionChanged: form.readData()
+ }
+
+ Component.onCompleted: readData()
+}
diff --git a/examples/quick/controls/uiforms/qml/SettingsForm.ui.qml b/examples/quick/controls/uiforms/qml/SettingsForm.ui.qml
new file mode 100644
index 00000000..5cafe0e7
--- /dev/null
+++ b/examples/quick/controls/uiforms/qml/SettingsForm.ui.qml
@@ -0,0 +1,259 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 1.2
+
+Item {
+ id: content
+
+ width: 480
+ height: 480
+
+ property alias address: address
+ property alias gridLayout: gridLayout
+ property alias cancel: cancel
+ property alias save: save
+
+ property alias title: title
+ property alias zipCode: zipCode
+ property alias city: city
+ property alias phoneNumber: phoneNumber
+ property alias customerId: customerId
+ property alias email: email
+ property alias lastName: lastName
+ property alias firstName: firstName
+
+ GridLayout {
+ id: gridLayout
+
+ anchors.right: parent.right
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.rightMargin: 12
+ anchors.leftMargin: 12
+ anchors.topMargin: 12
+ columnSpacing: 8
+ rowSpacing: 8
+ rows: 8
+ columns: 7
+ enabled: false
+
+ Label {
+ id: label1
+ text: qsTr("Title")
+ Layout.columnSpan: 2
+ }
+
+ Label {
+ id: label2
+ text: qsTr("First Name")
+ Layout.columnSpan: 2
+ }
+
+ Item {
+ id: spacer10
+ Layout.preferredHeight: 14
+ Layout.preferredWidth: 14
+ }
+
+ Label {
+ id: label3
+ text: qsTr("Last Name")
+ }
+
+ Item {
+ id: spacer15
+ Layout.preferredHeight: 14
+ Layout.preferredWidth: 14
+ }
+
+ ComboBox {
+ id: title
+ Layout.columnSpan: 2
+ Layout.fillWidth: true
+ model: ["Mr.", "Ms."]
+ }
+
+ TextField {
+ id: firstName
+ Layout.minimumWidth: 140
+ Layout.fillWidth: true
+ Layout.columnSpan: 3
+ placeholderText: qsTr("first name")
+ }
+
+ TextField {
+ id: lastName
+ Layout.minimumWidth: 140
+ Layout.fillWidth: true
+ Layout.columnSpan: 2
+ placeholderText: qsTr("last name")
+ }
+
+ Label {
+ id: label4
+ text: qsTr("Phone Number")
+ Layout.columnSpan: 5
+ }
+
+ Label {
+ id: label5
+ text: qsTr("Email")
+ Layout.preferredHeight: 13
+ Layout.preferredWidth: 24
+ }
+
+ Item {
+ id: spacer16
+ Layout.preferredHeight: 14
+ Layout.preferredWidth: 14
+ }
+
+ TextField {
+ id: phoneNumber
+ Layout.fillWidth: true
+ Layout.columnSpan: 5
+ placeholderText: qsTr("phone number")
+ }
+
+ TextField {
+ id: email
+ Layout.fillWidth: true
+ Layout.columnSpan: 2
+ placeholderText: qsTr("email")
+ }
+
+ Label {
+ id: label6
+ text: qsTr("Address")
+ }
+
+ Item {
+ id: spacer3
+ Layout.columnSpan: 6
+ Layout.preferredHeight: 14
+ Layout.preferredWidth: 14
+ }
+
+ TextField {
+ id: address
+ Layout.fillWidth: true
+ Layout.columnSpan: 7
+ placeholderText: qsTr("address")
+ }
+
+ Label {
+ id: label7
+ text: qsTr("City")
+ }
+
+ Item {
+ id: spacer4
+ Layout.columnSpan: 4
+ Layout.preferredHeight: 14
+ Layout.preferredWidth: 14
+ }
+
+ Label {
+ id: label8
+ text: qsTr("Zip Code")
+ }
+
+ Item {
+ id: spacer18
+ Layout.preferredHeight: 14
+ Layout.preferredWidth: 14
+ }
+
+ TextField {
+ id: city
+ Layout.fillWidth: true
+ Layout.columnSpan: 5
+ placeholderText: qsTr("city")
+ }
+
+ TextField {
+ id: zipCode
+ Layout.fillWidth: true
+ Layout.columnSpan: 2
+ placeholderText: qsTr("zip code")
+ }
+
+ Label {
+ id: label9
+ text: qsTr("Customer Id")
+ }
+
+ Item {
+ id: spacer19
+ Layout.columnSpan: 6
+ Layout.preferredHeight: 14
+ Layout.preferredWidth: 14
+ }
+
+ TextField {
+ id: customerId
+ Layout.columnSpan: 7
+ Layout.fillWidth: true
+ placeholderText: qsTr("id")
+ }
+ }
+
+ RowLayout {
+ anchors.topMargin: 12
+ anchors.right: parent.right
+ anchors.rightMargin: 12
+ anchors.top: gridLayout.bottom
+
+ Button {
+ id: save
+ text: qsTr("Save")
+ enabled: false
+ }
+
+ Button {
+ id: cancel
+ text: qsTr("Cancel")
+ enabled: false
+ }
+ }
+}
diff --git a/examples/quick/controls/uiforms/uiforms.pro b/examples/quick/controls/uiforms/uiforms.pro
new file mode 100644
index 00000000..08b3d0c4
--- /dev/null
+++ b/examples/quick/controls/uiforms/uiforms.pro
@@ -0,0 +1,21 @@
+TEMPLATE = app
+TARGET = uiforms
+
+SOURCES += \
+ main.cpp
+
+RESOURCES += \
+ uiforms.qrc
+
+OTHER_FILES += \
+ main.qml \
+ MainForm.ui.qml \
+ qml/Settings.qml \
+ qml/History.qml \
+ qml/Notes.qml \
+ qml/SettingsForm.ui.qml \
+ qml/HistoryForm.ui.qml \
+ qml/NotesForm.ui.qml \
+ qml/CustomerModel.qml
+
+include(../shared/shared.pri)
diff --git a/examples/quick/controls/uiforms/uiforms.qrc b/examples/quick/controls/uiforms/uiforms.qrc
new file mode 100644
index 00000000..447bb039
--- /dev/null
+++ b/examples/quick/controls/uiforms/uiforms.qrc
@@ -0,0 +1,13 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ <file>MainForm.ui.qml</file>
+ <file>qml/Settings.qml</file>
+ <file>qml/History.qml</file>
+ <file>qml/Notes.qml</file>
+ <file>qml/SettingsForm.ui.qml</file>
+ <file>qml/HistoryForm.ui.qml</file>
+ <file>qml/NotesForm.ui.qml</file>
+ <file>qml/CustomerModel.qml</file>
+ </qresource>
+</RCC>
diff --git a/src/controls/Calendar.qml b/src/controls/Calendar.qml
index 9958068a..b5dadc0b 100644
--- a/src/controls/Calendar.qml
+++ b/src/controls/Calendar.qml
@@ -290,6 +290,7 @@ Control {
signal pressAndHold(date date)
/*!
+ \qmlmethod void Calendar::showPreviousMonth()
Sets visibleMonth to the previous month.
*/
function showPreviousMonth() {
@@ -302,6 +303,7 @@ Control {
}
/*!
+ \qmlmethod void Calendar::showNextMonth()
Sets visibleMonth to the next month.
*/
function showNextMonth() {
@@ -314,6 +316,7 @@ Control {
}
/*!
+ \qmlmethod void Calendar::showPreviousYear()
Sets visibleYear to the previous year.
*/
function showPreviousYear() {
@@ -323,6 +326,7 @@ Control {
}
/*!
+ \qmlmethod void Calendar::showNextYear()
Sets visibleYear to the next year.
*/
function showNextYear() {
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml
index 9eb63fe7..7de1b738 100644
--- a/src/controls/ComboBox.qml
+++ b/src/controls/ComboBox.qml
@@ -166,7 +166,8 @@ Control {
*/
readonly property alias count: popupItems.count
- /*! Returns the text for a given \a index.
+ /*! \qmlmethod string ComboBox::textAt(int index)
+ Returns the text for a given \a index.
If an invalid index is provided, \c null is returned
\since QtQuick.Controls 1.1
*/
@@ -176,7 +177,8 @@ Control {
return popupItems.objectAt(index).text;
}
- /*! Finds and returns the index of a given \a text
+ /*! \qmlmethod int ComboBox::find(string text)
+ Finds and returns the index of a given \a text
If no match is found, \c -1 is returned. The search is case sensitive.
\since QtQuick.Controls 1.1
*/
@@ -298,7 +300,7 @@ Control {
signal activated(int index)
/*!
- \qmlmethod ComboBox::selectAll()
+ \qmlmethod void ComboBox::selectAll()
\since QtQuick.Controls 1.1
Causes all \l editText to be selected.
diff --git a/src/controls/Private/qquickcontrolsettings.cpp b/src/controls/Private/qquickcontrolsettings.cpp
index c60e77d9..0c76d8c4 100644
--- a/src/controls/Private/qquickcontrolsettings.cpp
+++ b/src/controls/Private/qquickcontrolsettings.cpp
@@ -60,7 +60,7 @@ static QString defaultStyleName()
return QLatin1String("Android");
#elif defined(Q_OS_IOS)
return QLatin1String("iOS");
-#elif defined(Q_OS_WINRT)
+#elif defined(Q_OS_WINRT) && 0 // Enable once style is ready
return QLatin1String("WinRT");
#endif
return QLatin1String("Base");
diff --git a/src/controls/SplitView.qml b/src/controls/SplitView.qml
index be1a9e92..41c50329 100644
--- a/src/controls/SplitView.qml
+++ b/src/controls/SplitView.qml
@@ -177,7 +177,8 @@ Item {
onHeightChanged: d.updateLayout()
onOrientationChanged: d.changeOrientation()
- /*! Add an item to the end of the view.
+ /*! \qmlmethod void SplitView::addItem(Item item)
+ Add an item to the end of the view.
\since QtQuick.Controls 1.3 */
function addItem(item) {
d.updateLayoutGuard = true
@@ -187,7 +188,8 @@ Item {
d.updateFillIndex()
}
- /*! Remove \a item from the view.
+ /*! \qmlmethod void SplitView::removeItem(Item item)
+ Remove \a item from the view.
\since QtQuick.Controls 1.4 */
function removeItem(item) {
d.updateLayoutGuard = true
diff --git a/src/controls/StackView.qml b/src/controls/StackView.qml
index 77dc4ea7..5f774969 100644
--- a/src/controls/StackView.qml
+++ b/src/controls/StackView.qml
@@ -117,7 +117,7 @@ import QtQuick.Controls.Private 1.0
\li \l{pop()}{pop(A)} => [A] - "pop" transition between C and A
\endlist
- \note Note that when the stack is empty, a push() will not perform a
+ \note When the stack is empty, a push() will not perform a
transition animation because there is nothing to transition from (typically during
application start-up). A pop() on a stack with depth 1 or 0 is a no-operation.
If removing all items from the stack is needed, a separate function clear() is
@@ -217,7 +217,7 @@ import QtQuick.Controls.Private 1.0
\endcode
- \note Note that if an item is declared inside another item, and if that parent gets destroyed,
+ \note If an item is declared inside another item, and if that parent gets destroyed,
(even if a component was used), that child item will also be destroyed.
This follows normal Qt parent-child destruction rules, but sometimes comes as a surprise
for developers.
@@ -509,7 +509,10 @@ FocusScope {
\sa {Transitions} */
property StackViewDelegate delegate: StackViewSlideDelegate {}
- /*! Pushes an item onto the stack. The function takes a property list as argument, which
+ /*! \qmlmethod Item StackView::push(Item item)
+ Pushes an item onto the stack.
+
+ The function can also take a property list as argument - \c {Item StackView::push(jsobject dict)}, which
should contain one or more of the following properties:
\list
\li \c item: this property is required, and holds the item you want to push.
@@ -545,7 +548,7 @@ FocusScope {
\li stackView.push([{item:anitem, immediate:true}, {item:aURL}])
\endlist
- \note Note: if the only argument needed is "item", you can apply the following short-
+ \note If the only argument needed is "item", you can apply the following short-
hand notation: \c{stackView.push(anItem)}.
Returns the item that became current.
@@ -599,7 +602,10 @@ FocusScope {
return __currentItem
}
- /*! Pops one or more items off the stack. The function takes a property list as argument
+ /*! \qmlmethod Item StackView::pop(Item item = undefined)
+ Pops one or more items off the stack.
+
+ The function can also take a property list as argument - \c {Item StackView::pop(jsobject dict)},
which can contain one or more of the following properties:
\list
\li \c item: if specified, all items down to (but not including) \a item will be
@@ -617,7 +623,7 @@ FocusScope {
\li stackView.pop(null)
\endlist
- \note Note: If the only argument needed is "item", you can apply the following short-
+ \note If the only argument needed is "item", you can apply the following short-
hand notation: \c{stackView.pop(anItem)}.
Returns the item that was popped off
@@ -671,7 +677,8 @@ FocusScope {
return outElement.item;
}
- /*! Remove all items from the stack. No animations will be applied. */
+ /*! \qmlmethod void StackView::clear()
+ Remove all items from the stack. No animations will be applied. */
function clear() {
if (__recursionGuard(true))
return
@@ -687,7 +694,8 @@ FocusScope {
__recursionGuard(false)
}
- /*! Search for a specific item inside the stack. \a func will
+ /*! \qmlmethod Item StackView::find(function, bool onlySearchLoadedItems = false)
+ Search for a specific item inside the stack. \a func will
be called for each item in the stack (with the item as argument)
until the function returns true. Return value will be the item found. For
example:
@@ -707,7 +715,8 @@ FocusScope {
return null;
}
- /*! Returns the item at position \a index in
+ /*! \qmlmethod Item StackView::get(int index, bool dontLoad = false)
+ Returns the item at position \a index in
the stack. If \a dontLoad is true, the
item will not be forced to load (and \c null
will be returned if not yet loaded) */
@@ -726,7 +735,8 @@ FocusScope {
}
}
- /*! Immediately completes any ongoing transition.
+ /*! \qmlmethod void StackView::completeTransition()
+ Immediately completes any ongoing transition.
/sa Animation.complete
*/
function completeTransition()
diff --git a/src/controls/StackViewDelegate.qml b/src/controls/StackViewDelegate.qml
index 1d4c2969..c837c281 100644
--- a/src/controls/StackViewDelegate.qml
+++ b/src/controls/StackViewDelegate.qml
@@ -50,7 +50,7 @@ QtObject {
id: root
/*!
- \qmlmethod StackViewDelegate::getTransition(properties)
+ \qmlmethod Transition StackViewDelegate::getTransition(properties)
The base implementation of this function just looks for a property named properties.name inside itself.
\sa {Transitions}
@@ -61,7 +61,7 @@ QtObject {
}
/*!
- \qmlmethod StackViewDelegate::transitionFinished(properties)
+ \qmlmethod void StackViewDelegate::transitionFinished(properties)
The base implementation of this function is empty.
\sa {Transitions}
diff --git a/src/controls/Styles/Base/CircularGaugeStyle.qml b/src/controls/Styles/Base/CircularGaugeStyle.qml
index 99b0091b..5abe1469 100644
--- a/src/controls/Styles/Base/CircularGaugeStyle.qml
+++ b/src/controls/Styles/Base/CircularGaugeStyle.qml
@@ -238,7 +238,7 @@ Style {
*/
readonly property int labelCount: control.__panel.circularTickmarkLabel.labelCount
- /*!
+ /*! \qmlmethod real CircularGaugeStyle::valueToAngle(real value)
Returns \a value as an angle in degrees.
This function is useful for custom drawing or positioning of items in
diff --git a/src/controls/Styles/Base/DialStyle.qml b/src/controls/Styles/Base/DialStyle.qml
index dc4f370d..6c9a68d3 100644
--- a/src/controls/Styles/Base/DialStyle.qml
+++ b/src/controls/Styles/Base/DialStyle.qml
@@ -144,7 +144,7 @@ Style {
*/
readonly property int labelCount: control.__panel.circularTickmarkLabel.labelCount
- /*!
+ /*! \qmlmethod real DialStyle::valueToAngle(real value)
Returns \a value as an angle in degrees.
This function is useful for custom drawing or positioning of items in
diff --git a/src/controls/Styles/Base/MenuBarStyle.qml b/src/controls/Styles/Base/MenuBarStyle.qml
index aaad65e8..541dd7f9 100644
--- a/src/controls/Styles/Base/MenuBarStyle.qml
+++ b/src/controls/Styles/Base/MenuBarStyle.qml
@@ -52,7 +52,9 @@ import QtQuick.Controls.Private 1.0
Style {
id: root
- /*! Returns a formatted string to render mnemonics for a given menu item.
+ /*!
+ \qmlmethod string MenuBarStyle::formatMnemonic(string text, bool underline = false)
+ Returns a formatted string to render mnemonics for a given menu item.
The mnemonic character is prefixed by an ampersand in the original string.
diff --git a/src/controls/Styles/Base/MenuStyle.qml b/src/controls/Styles/Base/MenuStyle.qml
index 6e9f8b0e..a2a3862f 100644
--- a/src/controls/Styles/Base/MenuStyle.qml
+++ b/src/controls/Styles/Base/MenuStyle.qml
@@ -93,7 +93,9 @@ Style {
/*! The number of milliseconds to wait before opening a submenu. */
property int submenuPopupDelay: 200
- /*! Returns a rich-text string to render mnemonics for a given menu item.
+ /*!
+ \qmlmethod string MenuStyle::formatMnemonic(string text, bool underline = false)
+ Returns a rich-text string to render mnemonics for a given menu item.
The mnemonic character is prefixed by an ampersand in the original string.
diff --git a/src/controls/Styles/Base/PieMenuStyle.qml b/src/controls/Styles/Base/PieMenuStyle.qml
index 916a0c9e..fdfa92e7 100644
--- a/src/controls/Styles/Base/PieMenuStyle.qml
+++ b/src/controls/Styles/Base/PieMenuStyle.qml
@@ -165,6 +165,7 @@ Style {
property real endAngle: 90
/*!
+ \qmlmethod real PieMenuStyle::sectionStartAngle(int itemIndex)
Returns the start of the section at \a itemIndex as an angle in degrees.
*/
function sectionStartAngle(itemIndex) {
@@ -172,6 +173,7 @@ Style {
}
/*!
+ \qmlmethod real PieMenuStyle::sectionCenterAngle(int itemIndex)
Returns the center of the section at \a itemIndex as an angle in
degrees.
*/
@@ -180,6 +182,7 @@ Style {
}
/*!
+ \qmlmethod real PieMenuStyle::sectionEndAngle(int itemIndex)
Returns the end of the section at \a itemIndex as an angle in degrees.
*/
function sectionEndAngle(itemIndex) {
diff --git a/src/controls/TabView.qml b/src/controls/TabView.qml
index 84e5331b..bd043be9 100644
--- a/src/controls/TabView.qml
+++ b/src/controls/TabView.qml
@@ -115,14 +115,16 @@ FocusScope {
/*! \internal */
default property alias data: stack.data
- /*! Adds a new tab page with title with and optional Component.
+ /*! \qmlmethod Tab TabView::addTab(string title, Component component)
+ Adds a new tab page with title with and optional Component.
Returns the newly added tab.
*/
function addTab(title, component) {
return insertTab(__tabs.count, title, component)
}
- /*! Inserts a new tab with title at index, with an optional Component.
+ /*! \qmlmethod Tab TabView::insertTab(int index, string title, Component component)
+ Inserts a new tab with title at index, with an optional Component.
Returns the newly added tab.
*/
function insertTab(index, title, component) {
@@ -139,7 +141,8 @@ FocusScope {
return tab
}
- /*! Removes and destroys a tab at the given \a index. */
+ /*! \qmlmethod void TabView::removeTab(int index)
+ Removes and destroys a tab at the given \a index. */
function removeTab(index) {
var tab = __tabs.get(index).tab
__willRemoveIndex(index)
@@ -148,7 +151,8 @@ FocusScope {
__setOpacities()
}
- /*! Moves a tab \a from index \a to another. */
+ /*! \qmlmethod void TabView::moveTab(int from, int to)
+ Moves a tab \a from index \a to another. */
function moveTab(from, to) {
__tabs.move(from, to, 1)
@@ -166,7 +170,8 @@ FocusScope {
}
}
- /*! Returns the \l Tab item at \a index. */
+ /*! \qmlmethod Tab TabView::getTab(int index)
+ Returns the \l Tab item at \a index. */
function getTab(index) {
var data = __tabs.get(index)
return data && data.tab
diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml
index e35f4187..a5d67faf 100644
--- a/src/controls/TableView.qml
+++ b/src/controls/TableView.qml
@@ -199,7 +199,7 @@ BasicTableView {
signal pressAndHold(int row)
/*!
- \qmlmethod TableView::positionViewAtRow( int row, PositionMode mode )
+ \qmlmethod void TableView::positionViewAtRow( int row, PositionMode mode )
Positions the view such that the specified \a row is at the position defined by \a mode:
\list
diff --git a/src/controls/TableViewColumn.qml b/src/controls/TableViewColumn.qml
index 53b9ed77..9bcdfe6d 100644
--- a/src/controls/TableViewColumn.qml
+++ b/src/controls/TableViewColumn.qml
@@ -134,7 +134,8 @@ QtObject {
Accessible.role: Accessible.ColumnHeader
- /*! Resizes the column so that the implicitWidth of the contents on every row will fit.
+ /*! \qmlmethod void TableViewColumn::resizeToContents()
+ Resizes the column so that the implicitWidth of the contents on every row will fit.
\since QtQuick.Controls 1.2 */
function resizeToContents() {
var minWidth = 0
diff --git a/src/controls/TextArea.qml b/src/controls/TextArea.qml
index ce4b7ded..375d195d 100644
--- a/src/controls/TextArea.qml
+++ b/src/controls/TextArea.qml
@@ -453,7 +453,7 @@ ScrollView {
property Component menu: editMenu.defaultMenu
/*!
- \qmlmethod TextArea::append(string)
+ \qmlmethod void TextArea::append(string text)
Appends \a string as a new line to the end of the text area.
*/
@@ -463,7 +463,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::copy()
+ \qmlmethod void TextArea::copy()
Copies the currently selected text to the system clipboard.
*/
@@ -472,7 +472,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::cut()
+ \qmlmethod void TextArea::cut()
Moves the currently selected text to the system clipboard.
*/
@@ -481,7 +481,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::deselect()
+ \qmlmethod void TextArea::deselect()
Removes active text selection.
*/
@@ -512,7 +512,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::insert(int position, string text)
+ \qmlmethod void TextArea::insert(int position, string text)
Inserts \a text into the TextArea at position.
*/
@@ -521,7 +521,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::isRightToLeft(int start, int end)
+ \qmlmethod bool TextArea::isRightToLeft(int start, int end)
Returns true if the natural reading direction of the editor text
found between positions \a start and \a end is right to left.
@@ -531,7 +531,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::moveCursorSelection(int position, SelectionMode mode = TextEdit.SelectCharacters)
+ \qmlmethod void TextArea::moveCursorSelection(int position, SelectionMode mode = TextEdit.SelectCharacters)
Moves the cursor to \a position and updates the selection according to the optional \a mode
parameter. (To only move the cursor, set the \l cursorPosition property.)
@@ -572,7 +572,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::paste()
+ \qmlmethod void TextArea::paste()
Replaces the currently selected text by the contents of the system clipboard.
*/
@@ -604,7 +604,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::redo()
+ \qmlmethod void TextArea::redo()
Redoes the last operation if redo is \l {canRedo}{available}.
*/
@@ -622,7 +622,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::select(int start, int end)
+ \qmlmethod void TextArea::select(int start, int end)
Causes the text from \a start to \a end to be selected.
@@ -639,7 +639,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::selectAll()
+ \qmlmethod void TextArea::selectAll()
Causes all text to be selected.
*/
@@ -648,7 +648,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::selectWord()
+ \qmlmethod void TextArea::selectWord()
Causes the word closest to the current cursor position to be selected.
*/
@@ -657,7 +657,7 @@ ScrollView {
}
/*!
- \qmlmethod TextArea::undo()
+ \qmlmethod void TextArea::undo()
Undoes the last operation if undo is \l {canUndo}{available}. Deselects any
current selection, and updates the selection start to the current cursor
diff --git a/src/controls/TextField.qml b/src/controls/TextField.qml
index 010561d3..589869d3 100644
--- a/src/controls/TextField.qml
+++ b/src/controls/TextField.qml
@@ -466,7 +466,7 @@ Control {
signal editingFinished()
/*!
- \qmlmethod TextField::copy()
+ \qmlmethod void TextField::copy()
Copies the currently selected text to the system clipboard.
*/
@@ -475,7 +475,7 @@ Control {
}
/*!
- \qmlmethod TextField::cut()
+ \qmlmethod void TextField::cut()
Moves the currently selected text to the system clipboard.
*/
@@ -484,7 +484,7 @@ Control {
}
/*!
- \qmlmethod TextField::deselect()
+ \qmlmethod void TextField::deselect()
Removes active text selection.
*/
@@ -503,7 +503,7 @@ Control {
}
/*!
- \qmlmethod TextField::insert(int position, string text)
+ \qmlmethod void TextField::insert(int position, string text)
Inserts \a text into the TextField at \a position.
*/
@@ -522,7 +522,7 @@ Control {
}
/*!
- \qmlmethod TextField::paste()
+ \qmlmethod void TextField::paste()
Replaces the currently selected text by the contents of the system
clipboard.
@@ -532,7 +532,7 @@ Control {
}
/*!
- \qmlmethod TextField::redo()
+ \qmlmethod void TextField::redo()
Performs the last operation if redo is \l {canRedo}{available}.
*/
@@ -541,7 +541,7 @@ Control {
}
/*!
- \qmlmethod TextField::remove(int start, int end)
+ \qmlmethod void TextField::remove(int start, int end)
\since QtQuick.Controls 1.4
Removes the section of text that is between the start and end positions.
@@ -551,7 +551,7 @@ Control {
}
/*!
- \qmlmethod TextField::select(int start, int end)
+ \qmlmethod void TextField::select(int start, int end)
Causes the text from \a start to \a end to be selected.
@@ -568,7 +568,7 @@ Control {
}
/*!
- \qmlmethod TextField::selectAll()
+ \qmlmethod void TextField::selectAll()
Causes all text to be selected.
*/
@@ -577,7 +577,7 @@ Control {
}
/*!
- \qmlmethod TextField::selectWord()
+ \qmlmethod void TextField::selectWord()
Causes the word closest to the current cursor position to be selected.
*/
@@ -586,7 +586,7 @@ Control {
}
/*!
- \qmlmethod TextField::undo()
+ \qmlmethod void TextField::undo()
Reverts the last operation if undo is \l {canUndo}{available}. undo()
deselects any current selection and updates the selection start to the
diff --git a/src/controls/doc/images/qtquickcontrols-example-uiforms.png b/src/controls/doc/images/qtquickcontrols-example-uiforms.png
new file mode 100644
index 00000000..c883d98d
--- /dev/null
+++ b/src/controls/doc/images/qtquickcontrols-example-uiforms.png
Binary files differ
diff --git a/src/controls/doc/src/qtquickcontrols-examples.qdoc b/src/controls/doc/src/qtquickcontrols-examples.qdoc
index 5cb56490..bc82349e 100644
--- a/src/controls/doc/src/qtquickcontrols-examples.qdoc
+++ b/src/controls/doc/src/qtquickcontrols-examples.qdoc
@@ -64,6 +64,67 @@
*/
/*!
+ \example uiforms
+ \title Qt Quick Controls - UI Forms
+ \ingroup qtquickcontrols_examples
+ \brief Demonstrates how to separate the application logic from the UI.
+
+ \image qtquickcontrols-example-uiforms.png
+
+ \e{UI Forms} demonstrates how to separate the application logic
+ from the UI using \e ui.qml files. The example is a simple interface to a customer
+ database, purely written in QML and JavaScript.
+
+ UI Forms are rigorously split into \e .qml and \e .js files that contain the business logic, and \e .ui.qml
+ files that only contain the purely declarative description of the UI.
+ The \e .ui.qml files act as forms and they should be only edited in the Design mode of Qt Creator.
+
+ \section1 Exporting Items from Forms
+
+ In all forms, items that are supposed to interact with the application logic are exported:
+
+ \qml
+ property alias cancel: cancel
+ property alias save: save
+ property alias textArea: textArea
+ \endqml
+
+ This is the way the items are exported in \e NotesForm.ui.qml, so they can be used in
+ \e Notes.ui.qml to implement the logic as follows:
+
+ \qml
+ function readData() {
+ CustomerModel.selection.forEach(function (rowIndex) {
+ form.textArea.text = CustomerModel.model.get(rowIndex).notes
+ })
+
+ save.enabled = true
+ cancel.enabled = true
+ form.textArea.enabled = true
+ }
+
+ function writeData() {
+ CustomerModel.selection.forEach(function (rowIndex) {
+ var data = CustomerModel.model.get(rowIndex)
+ data.notes = form.textArea.text
+ CustomerModel.model.set(rowIndex, data)
+ })
+ }
+
+ cancel.onClicked: readData()
+ save.onClicked: writeData()
+ \endqml
+
+ \section1 Implementing the Backend in a Singleton
+
+ Because the ListModel is accessed from several different \e .qml files, we access the
+ ListModel through a singleton defined in \e CustomerModel.qml and registered in \e main.ccp.
+ This way we do not have to rely on the QML context scoping rules to access the ListModel.
+
+ \include examples-run.qdocinc
+*/
+
+/*!
\example basiclayouts
\title Qt Quick Controls - Basic Layouts Example
\ingroup qtquickcontrols_examples
diff --git a/src/controls/qquickaction.cpp b/src/controls/qquickaction.cpp
index e3512baf..6dc07f87 100644
--- a/src/controls/qquickaction.cpp
+++ b/src/controls/qquickaction.cpp
@@ -172,7 +172,7 @@ QT_BEGIN_NAMESPACE
The corresponding handler is \c onTriggered.
*/
-/*! \qmlmethod Action::trigger(QObject *source)
+/*! \qmlmethod void Action::trigger(QObject *source)
Will emit the \l triggered signal if the action is enabled. You may provide a source
object if the Action would benefit from knowing the origin of the triggering (e.g.
diff --git a/src/controls/qquickmenuitem.cpp b/src/controls/qquickmenuitem.cpp
index 83577d41..8093c5fe 100644
--- a/src/controls/qquickmenuitem.cpp
+++ b/src/controls/qquickmenuitem.cpp
@@ -377,7 +377,7 @@ void QQuickMenuText::updateIcon()
The corresponding handler is \c onTriggered.
*/
-/*! \qmlmethod MenuItem::trigger()
+/*! \qmlmethod void MenuItem::trigger()
Manually trigger a menu item. Will also trigger the item's bound action.
diff --git a/src/extras/Tumbler.qml b/src/extras/Tumbler.qml
index 4743322b..7cba6ed0 100644
--- a/src/extras/Tumbler.qml
+++ b/src/extras/Tumbler.qml
@@ -136,6 +136,11 @@ import QtQuick.Layouts 1.0
Control {
id: tumbler
+ /*
+ \qmlproperty Component Tumbler::style
+
+ The style Component for this control.
+ */
style: Settings.styleComponent(Settings.style, "TumblerStyle.qml", tumbler)
ListModel {
@@ -160,6 +165,7 @@ Control {
}
/*!
+ \qmlmethod int Tumbler::currentIndexAt(int columnIndex)
Returns the current index of the column at \a columnIndex, or \c null
if the \a index is invalid.
*/
@@ -171,6 +177,7 @@ Control {
}
/*!
+ \qmlmethod void Tumbler::setCurrentIndexAt(int columnIndex, int itemIndex)
Sets the current index of the column at \a columnIndex to \a itemIndex.
Does nothing if \a columnIndex or \a itemIndex are invalid.
@@ -190,7 +197,8 @@ Control {
}
/*!
- Returns the column at \a columnIndex or \c null if the \a index is
+ \qmlmethod TumblerColumn Tumbler::getColumn(int columnIndex)
+ Returns the column at \a columnIndex or \c null if the index is
invalid.
*/
function getColumn(columnIndex) {
@@ -201,10 +209,11 @@ Control {
}
/*!
+ \qmlmethod TumblerColumn Tumbler::addColumn(TumblerColumn column)
Adds a \a column and returns the added column.
The \a column argument can be an instance of TumblerColumn,
- or a Component. The component has to contain a TumblerColumn.
+ or a \l Component. The component has to contain a TumblerColumn.
Otherwise \c null is returned.
*/
function addColumn(column) {
@@ -212,10 +221,11 @@ Control {
}
/*!
+ \qmlmethod TumblerColumn Tumbler::insertColumn(int index, TumblerColumn column)
Inserts a \a column at the given \a index and returns the inserted column.
The \a column argument can be an instance of TumblerColumn,
- or a Component. The component has to contain a TumblerColumn.
+ or a \l Component. The component has to contain a TumblerColumn.
Otherwise, \c null is returned.
*/
function insertColumn(index, column) {