From c943543b84129bd82c17858d5eb91486af78111c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 21 Apr 2016 10:46:55 +0200 Subject: fix example installs this includes renaming the first-level subdir of examples/. Change-Id: Idf14164533c247e5c0cc5acdb405ac97f7c33ac5 Reviewed-by: J-P Nurmi --- .../controls/uiforms/qml/CustomerModel.qml | 144 ++++++++++++ .../quickcontrols/controls/uiforms/qml/History.qml | 76 ++++++ .../controls/uiforms/qml/HistoryForm.ui.qml | 80 +++++++ .../quickcontrols/controls/uiforms/qml/Notes.qml | 76 ++++++ .../controls/uiforms/qml/NotesForm.ui.qml | 85 +++++++ .../controls/uiforms/qml/Settings.qml | 96 ++++++++ .../controls/uiforms/qml/SettingsForm.ui.qml | 259 +++++++++++++++++++++ 7 files changed, 816 insertions(+) create mode 100644 examples/quickcontrols/controls/uiforms/qml/CustomerModel.qml create mode 100644 examples/quickcontrols/controls/uiforms/qml/History.qml create mode 100644 examples/quickcontrols/controls/uiforms/qml/HistoryForm.ui.qml create mode 100644 examples/quickcontrols/controls/uiforms/qml/Notes.qml create mode 100644 examples/quickcontrols/controls/uiforms/qml/NotesForm.ui.qml create mode 100644 examples/quickcontrols/controls/uiforms/qml/Settings.qml create mode 100644 examples/quickcontrols/controls/uiforms/qml/SettingsForm.ui.qml (limited to 'examples/quickcontrols/controls/uiforms/qml') diff --git a/examples/quickcontrols/controls/uiforms/qml/CustomerModel.qml b/examples/quickcontrols/controls/uiforms/qml/CustomerModel.qml new file mode 100644 index 000000000..70a9695dd --- /dev/null +++ b/examples/quickcontrols/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/quickcontrols/controls/uiforms/qml/History.qml b/examples/quickcontrols/controls/uiforms/qml/History.qml new file mode 100644 index 000000000..336d717ff --- /dev/null +++ b/examples/quickcontrols/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/quickcontrols/controls/uiforms/qml/HistoryForm.ui.qml b/examples/quickcontrols/controls/uiforms/qml/HistoryForm.ui.qml new file mode 100644 index 000000000..9445b12fb --- /dev/null +++ b/examples/quickcontrols/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/quickcontrols/controls/uiforms/qml/Notes.qml b/examples/quickcontrols/controls/uiforms/qml/Notes.qml new file mode 100644 index 000000000..af506af31 --- /dev/null +++ b/examples/quickcontrols/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/quickcontrols/controls/uiforms/qml/NotesForm.ui.qml b/examples/quickcontrols/controls/uiforms/qml/NotesForm.ui.qml new file mode 100644 index 000000000..9552afcd0 --- /dev/null +++ b/examples/quickcontrols/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/quickcontrols/controls/uiforms/qml/Settings.qml b/examples/quickcontrols/controls/uiforms/qml/Settings.qml new file mode 100644 index 000000000..658c62d3c --- /dev/null +++ b/examples/quickcontrols/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/quickcontrols/controls/uiforms/qml/SettingsForm.ui.qml b/examples/quickcontrols/controls/uiforms/qml/SettingsForm.ui.qml new file mode 100644 index 000000000..5cafe0e7a --- /dev/null +++ b/examples/quickcontrols/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 + } + } +} -- cgit v1.2.3