diff options
Diffstat (limited to 'examples/quick/controls')
117 files changed, 0 insertions, 6287 deletions
diff --git a/examples/quick/controls/basiclayouts/basiclayouts.pro b/examples/quick/controls/basiclayouts/basiclayouts.pro deleted file mode 100644 index 54e609920..000000000 --- a/examples/quick/controls/basiclayouts/basiclayouts.pro +++ /dev/null @@ -1,12 +0,0 @@ -QT += qml quick -TARGET = basiclayouts -!no_desktop: QT += widgets - -include(src/src.pri) -include(../shared/shared.pri) - -OTHER_FILES += \ - main.qml - -RESOURCES += \ - resources.qrc diff --git a/examples/quick/controls/basiclayouts/basiclayouts.qmlproject b/examples/quick/controls/basiclayouts/basiclayouts.qmlproject deleted file mode 100644 index e5a8bf02c..000000000 --- a/examples/quick/controls/basiclayouts/basiclayouts.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/controls/basiclayouts/main.qml b/examples/quick/controls/basiclayouts/main.qml deleted file mode 100644 index b6694b454..000000000 --- a/examples/quick/controls/basiclayouts/main.qml +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** 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.Controls 1.2 -import QtQuick.Layouts 1.3 - -ApplicationWindow { - visible: true - title: "Basic layouts" - property int margin: 11 - width: mainLayout.implicitWidth + 2 * margin - height: mainLayout.implicitHeight + 2 * margin - minimumWidth: mainLayout.Layout.minimumWidth + 2 * margin - minimumHeight: mainLayout.Layout.minimumHeight + 2 * margin - - ColumnLayout { - id: mainLayout - anchors.fill: parent - anchors.margins: margin - GroupBox { - id: rowBox - title: "Row layout" - Layout.fillWidth: true - - RowLayout { - id: rowLayout - anchors.fill: parent - TextField { - placeholderText: "This wants to grow horizontally" - Layout.fillWidth: true - } - Button { - text: "Button" - } - } - } - - GroupBox { - id: gridBox - title: "Grid layout" - Layout.fillWidth: true - - GridLayout { - id: gridLayout - rows: 3 - flow: GridLayout.TopToBottom - anchors.fill: parent - - Label { text: "Line 1" } - Label { text: "Line 2" } - Label { text: "Line 3" } - - TextField { } - TextField { } - TextField { } - - TextArea { - text: "This widget spans over three rows in the GridLayout.\n" - + "All items in the GridLayout are implicitly positioned from top to bottom." - Layout.rowSpan: 3 - Layout.fillHeight: true - Layout.fillWidth: true - } - } - } - TextArea { - id: t3 - text: "This fills the whole cell" - Layout.minimumHeight: 30 - Layout.fillHeight: true - Layout.fillWidth: true - } - GroupBox { - id: stackBox - title: "Stack layout" - implicitWidth: 200 - implicitHeight: 60 - Layout.fillWidth: true - Layout.fillHeight: true - StackLayout { - id: stackLayout - anchors.fill: parent - - function advance() { currentIndex = (currentIndex + 1) % count } - - Repeater { - id: stackRepeater - model: 5 - Rectangle { - color: Qt.hsla((0.5 + index)/stackRepeater.count, 0.3, 0.7, 1) - Button { anchors.centerIn: parent; text: "Page " + (index + 1); onClicked: { stackLayout.advance() } } - } - } - } - } - } -} diff --git a/examples/quick/controls/basiclayouts/resources.qrc b/examples/quick/controls/basiclayouts/resources.qrc deleted file mode 100644 index 3b111a907..000000000 --- a/examples/quick/controls/basiclayouts/resources.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource prefix="/"> - <file>main.qml</file> -</qresource> -</RCC> diff --git a/examples/quick/controls/basiclayouts/src/main.cpp b/examples/quick/controls/basiclayouts/src/main.cpp deleted file mode 100644 index e66387f7b..000000000 --- a/examples/quick/controls/basiclayouts/src/main.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** 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/QQmlApplicationEngine> - -int main(int argc, char *argv[]) -{ - QtQuickControlsApplication app(argc, argv); - QQmlApplicationEngine engine(QUrl("qrc:/main.qml")); - if (engine.rootObjects().isEmpty()) - return -1; - return app.exec(); -} diff --git a/examples/quick/controls/basiclayouts/src/src.pri b/examples/quick/controls/basiclayouts/src/src.pri deleted file mode 100644 index 66d903eac..000000000 --- a/examples/quick/controls/basiclayouts/src/src.pri +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES += \ - $$PWD/main.cpp diff --git a/examples/quick/controls/calendar/calendar.pro b/examples/quick/controls/calendar/calendar.pro deleted file mode 100644 index e5bee1e97..000000000 --- a/examples/quick/controls/calendar/calendar.pro +++ /dev/null @@ -1,11 +0,0 @@ -QT += qml quick sql -TARGET = calendar - -!contains(sql-drivers, sqlite): QTPLUGIN += qsqlite - -include(src/src.pri) -include(../shared/shared.pri) - -OTHER_FILES += qml/main.qml - -RESOURCES += resources.qrc diff --git a/examples/quick/controls/calendar/images/eventindicator.png b/examples/quick/controls/calendar/images/eventindicator.png Binary files differdeleted file mode 100644 index 1edffd02d..000000000 --- a/examples/quick/controls/calendar/images/eventindicator.png +++ /dev/null diff --git a/examples/quick/controls/calendar/qml/main.qml b/examples/quick/controls/calendar/qml/main.qml deleted file mode 100644 index 46215e28d..000000000 --- a/examples/quick/controls/calendar/qml/main.qml +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** -** -** 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.Controls 1.2 -import QtQuick.Controls.Private 1.0 -import QtQuick.Controls.Styles 1.1 -import org.qtproject.examples.calendar 1.0 - -ApplicationWindow { - visible: true - width: 640 - height: 400 - minimumWidth: 400 - minimumHeight: 300 - color: "#f4f4f4" - - title: "Calendar Example" - - SystemPalette { - id: systemPalette - } - - SqlEventModel { - id: eventModel - } - - Flow { - id: row - anchors.fill: parent - anchors.margins: 20 - spacing: 10 - layoutDirection: Qt.RightToLeft - - Calendar { - id: calendar - width: (parent.width > parent.height ? parent.width * 0.6 - parent.spacing : parent.width) - height: (parent.height > parent.width ? parent.height * 0.6 - parent.spacing : parent.height) - frameVisible: true - weekNumbersVisible: true - selectedDate: new Date(2014, 0, 1) - focus: true - - style: CalendarStyle { - dayDelegate: Item { - readonly property color sameMonthDateTextColor: "#444" - readonly property color selectedDateColor: Qt.platform.os === "osx" ? "#3778d0" : systemPalette.highlight - readonly property color selectedDateTextColor: "white" - readonly property color differentMonthDateTextColor: "#bbb" - readonly property color invalidDatecolor: "#dddddd" - - Rectangle { - anchors.fill: parent - border.color: "transparent" - color: styleData.date !== undefined && styleData.selected ? selectedDateColor : "transparent" - anchors.margins: styleData.selected ? -1 : 0 - } - - Image { - visible: eventModel.eventsForDate(styleData.date).length > 0 - anchors.top: parent.top - anchors.left: parent.left - anchors.margins: -1 - width: 12 - height: width - source: "qrc:/images/eventindicator.png" - } - - Label { - id: dayDelegateText - text: styleData.date.getDate() - anchors.centerIn: parent - color: { - var color = invalidDatecolor; - if (styleData.valid) { - // Date is within the valid range. - color = styleData.visibleMonth ? sameMonthDateTextColor : differentMonthDateTextColor; - if (styleData.selected) { - color = selectedDateTextColor; - } - } - color; - } - } - } - } - } - - Component { - id: eventListHeader - - Row { - id: eventDateRow - width: parent.width - height: eventDayLabel.height - spacing: 10 - - Label { - id: eventDayLabel - text: calendar.selectedDate.getDate() - font.pointSize: 35 - } - - Column { - height: eventDayLabel.height - - Label { - readonly property var options: { weekday: "long" } - text: Qt.locale().standaloneDayName(calendar.selectedDate.getDay(), Locale.LongFormat) - font.pointSize: 18 - } - Label { - text: Qt.locale().standaloneMonthName(calendar.selectedDate.getMonth()) - + calendar.selectedDate.toLocaleDateString(Qt.locale(), " yyyy") - font.pointSize: 12 - } - } - } - } - - Rectangle { - width: (parent.width > parent.height ? parent.width * 0.4 - parent.spacing : parent.width) - height: (parent.height > parent.width ? parent.height * 0.4 - parent.spacing : parent.height) - border.color: Qt.darker(color, 1.2) - - ListView { - id: eventsListView - spacing: 4 - clip: true - header: eventListHeader - anchors.fill: parent - anchors.margins: 10 - model: eventModel.eventsForDate(calendar.selectedDate) - - delegate: Rectangle { - width: eventsListView.width - height: eventItemColumn.height - anchors.horizontalCenter: parent.horizontalCenter - - Image { - anchors.top: parent.top - anchors.topMargin: 4 - width: 12 - height: width - source: "qrc:/images/eventindicator.png" - } - - Rectangle { - width: parent.width - height: 1 - color: "#eee" - } - - Column { - id: eventItemColumn - anchors.left: parent.left - anchors.leftMargin: 20 - anchors.right: parent.right - height: timeLabel.height + nameLabel.height + 8 - - Label { - id: nameLabel - width: parent.width - wrapMode: Text.Wrap - text: modelData.name - } - Label { - id: timeLabel - width: parent.width - wrapMode: Text.Wrap - text: modelData.startDate.toLocaleTimeString(calendar.locale, Locale.ShortFormat) - color: "#aaa" - } - } - } - } - } - } -} diff --git a/examples/quick/controls/calendar/resources.qrc b/examples/quick/controls/calendar/resources.qrc deleted file mode 100644 index 9da283ba3..000000000 --- a/examples/quick/controls/calendar/resources.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/main.qml</file> - <file>images/eventindicator.png</file> - </qresource> -</RCC> diff --git a/examples/quick/controls/calendar/src/event.cpp b/examples/quick/controls/calendar/src/event.cpp deleted file mode 100644 index e4c7dd787..000000000 --- a/examples/quick/controls/calendar/src/event.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** 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 "event.h" - -Event::Event(QObject *parent) : - QObject(parent) -{ -} - -QString Event::name() const -{ - return mName; -} - -void Event::setName(const QString &name) -{ - if (name != mName) { - mName = name; - emit nameChanged(mName); - } -} - -QDateTime Event::startDate() const -{ - return mStartDate; -} - -void Event::setStartDate(const QDateTime &startDate) -{ - if (startDate != mStartDate) { - mStartDate = startDate; - emit startDateChanged(mStartDate); - } -} - -QDateTime Event::endDate() const -{ - return mEndDate; -} - -void Event::setEndDate(const QDateTime &endDate) -{ - if (endDate != mEndDate) { - mEndDate = endDate; - emit endDateChanged(mEndDate); - } -} diff --git a/examples/quick/controls/calendar/src/event.h b/examples/quick/controls/calendar/src/event.h deleted file mode 100644 index bfa11ad72..000000000 --- a/examples/quick/controls/calendar/src/event.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - -#ifndef EVENT_H -#define EVENT_H - -#include <QDateTime> -#include <QObject> -#include <QString> - -class Event : public QObject -{ - Q_OBJECT - - Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) - Q_PROPERTY(QDateTime startDate READ startDate WRITE setStartDate NOTIFY startDateChanged) - Q_PROPERTY(QDateTime endDate READ endDate WRITE setEndDate NOTIFY endDateChanged) -public: - explicit Event(QObject *parent = 0); - - QString name() const; - void setName(const QString &name); - - QDateTime startDate() const; - void setStartDate(const QDateTime &startDate); - - QDateTime endDate() const; - void setEndDate(const QDateTime &endDate); -signals: - void nameChanged(const QString &name); - void startDateChanged(const QDateTime &startDate); - void endDateChanged(const QDateTime &endDate); -private: - QString mName; - QDateTime mStartDate; - QDateTime mEndDate; -}; - -#endif diff --git a/examples/quick/controls/calendar/src/main.cpp b/examples/quick/controls/calendar/src/main.cpp deleted file mode 100644 index bab7e4b26..000000000 --- a/examples/quick/controls/calendar/src/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** 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 <QtQml> - -#include "qtquickcontrolsapplication.h" -#include "sqleventmodel.h" - -int main(int argc, char *argv[]) -{ - QtQuickControlsApplication app(argc, argv); - qmlRegisterType<SqlEventModel>("org.qtproject.examples.calendar", 1, 0, "SqlEventModel"); - QQmlApplicationEngine engine(QUrl("qrc:/qml/main.qml")); - if (engine.rootObjects().isEmpty()) - return -1; - return app.exec(); -} diff --git a/examples/quick/controls/calendar/src/sqleventmodel.cpp b/examples/quick/controls/calendar/src/sqleventmodel.cpp deleted file mode 100644 index 92e558ef3..000000000 --- a/examples/quick/controls/calendar/src/sqleventmodel.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** 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 "sqleventmodel.h" - -#include <QDebug> -#include <QFileInfo> -#include <QSqlError> -#include <QSqlQuery> - -SqlEventModel::SqlEventModel() -{ - createConnection(); -} - -QList<QObject*> SqlEventModel::eventsForDate(const QDate &date) -{ - const QString queryStr = QString::fromLatin1("SELECT * FROM Event WHERE '%1' >= startDate AND '%1' <= endDate").arg(date.toString("yyyy-MM-dd")); - QSqlQuery query(queryStr); - if (!query.exec()) - qFatal("Query failed"); - - QList<QObject*> events; - while (query.next()) { - Event *event = new Event(this); - event->setName(query.value("name").toString()); - - QDateTime startDate; - startDate.setDate(query.value("startDate").toDate()); - startDate.setTime(QTime(0, 0).addSecs(query.value("startTime").toInt())); - event->setStartDate(startDate); - - QDateTime endDate; - endDate.setDate(query.value("endDate").toDate()); - endDate.setTime(QTime(0, 0).addSecs(query.value("endTime").toInt())); - event->setEndDate(endDate); - - events.append(event); - } - - return events; -} - -/* - Defines a helper function to open a connection to an - in-memory SQLITE database and to create a test table. -*/ -void SqlEventModel::createConnection() -{ - QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); - db.setDatabaseName(":memory:"); - if (!db.open()) { - qFatal("Cannot open database"); - return; - } - - QSqlQuery query; - // We store the time as seconds because it's easier to query. - query.exec("create table Event (name TEXT, startDate DATE, startTime INT, endDate DATE, endTime INT)"); - query.exec("insert into Event values('Grocery shopping', '2014-01-01', 36000, '2014-01-01', 39600)"); - query.exec("insert into Event values('Ice skating', '2014-01-01', 57600, '2014-01-01', 61200)"); - query.exec("insert into Event values('Doctor''s appointment', '2014-01-15', 57600, '2014-01-15', 63000)"); - query.exec("insert into Event values('Conference', '2014-01-24', 32400, '2014-01-28', 61200)"); - - return; -} diff --git a/examples/quick/controls/calendar/src/sqleventmodel.h b/examples/quick/controls/calendar/src/sqleventmodel.h deleted file mode 100644 index e7a35c011..000000000 --- a/examples/quick/controls/calendar/src/sqleventmodel.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - -#ifndef SQLEVENTMODEL_H -#define SQLEVENTMODEL_H - -#include <QList> -#include <QObject> - -#include "event.h" - -class SqlEventModel : public QObject -{ - Q_OBJECT - -public: - SqlEventModel(); - - Q_INVOKABLE QList<QObject*> eventsForDate(const QDate &date); - -private: - static void createConnection(); -}; - -#endif diff --git a/examples/quick/controls/calendar/src/src.pri b/examples/quick/controls/calendar/src/src.pri deleted file mode 100644 index 50b2ea620..000000000 --- a/examples/quick/controls/calendar/src/src.pri +++ /dev/null @@ -1,9 +0,0 @@ -SOURCES += \ - $$PWD/event.cpp \ - $$PWD/main.cpp \ - $$PWD/sqleventmodel.cpp - - -HEADERS += \ - $$PWD/event.h \ - $$PWD/sqleventmodel.h diff --git a/examples/quick/controls/controls.pro b/examples/quick/controls/controls.pro deleted file mode 100644 index 52ab8c459..000000000 --- a/examples/quick/controls/controls.pro +++ /dev/null @@ -1,17 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS += \ - gallery \ - tableview \ - touch \ - basiclayouts \ - styles \ - uiforms - -qtHaveModule(widgets) { - SUBDIRS += texteditor filesystembrowser -} - -qtHaveModule(sql) { - SUBDIRS += calendar -} diff --git a/examples/quick/controls/filesystembrowser/filesystembrowser.pro b/examples/quick/controls/filesystembrowser/filesystembrowser.pro deleted file mode 100644 index bf77d958f..000000000 --- a/examples/quick/controls/filesystembrowser/filesystembrowser.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = app -TARGET = filesystembrowser -QT += qml quick widgets - -SOURCES += main.cpp - -RESOURCES += qml.qrc diff --git a/examples/quick/controls/filesystembrowser/main.cpp b/examples/quick/controls/filesystembrowser/main.cpp deleted file mode 100644 index e9c63c208..000000000 --- a/examples/quick/controls/filesystembrowser/main.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** -** -** 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 <QApplication> -#include <QQmlApplicationEngine> -#include <QtQml> -#include <QFileSystemModel> -#include <QDateTime> -#include <QDesktopServices> -#include <QUrl> - -static inline QString permissionString(const QFileInfo &fi) -{ - const QFile::Permissions permissions = fi.permissions(); - QString result = QLatin1String("----------"); - if (fi.isSymLink()) - result[0] = QLatin1Char('l'); - else if (fi.isDir()) - result[0] = QLatin1Char('d'); - if (permissions & QFileDevice::ReadUser) - result[1] = QLatin1Char('r'); - if (permissions & QFileDevice::WriteUser) - result[2] = QLatin1Char('w'); - if (permissions & QFileDevice::ExeUser) - result[3] = QLatin1Char('x'); - if (permissions & QFileDevice::ReadGroup) - result[4] = QLatin1Char('r'); - if (permissions & QFileDevice::WriteGroup) - result[5] = QLatin1Char('w'); - if (permissions & QFileDevice::ExeGroup) - result[6] = QLatin1Char('x'); - if (permissions & QFileDevice::ReadOther) - result[7] = QLatin1Char('r'); - if (permissions & QFileDevice::WriteOther) - result[8] = QLatin1Char('w'); - if (permissions & QFileDevice::ExeOther) - result[9] = QLatin1Char('x'); - return result; -} - -static inline QString sizeString(const QFileInfo &fi) -{ - if (!fi.isFile()) - return QString(); - const qint64 size = fi.size(); - if (size > 1024 * 1024 * 10) - return QString::number(size / (1024 * 1024)) + QLatin1Char('M'); - if (size > 1024 * 10) - return QString::number(size / 1024) + QLatin1Char('K'); - return QString::number(size); -} - -class DisplayFileSystemModel : public QFileSystemModel { - Q_OBJECT -public: - explicit DisplayFileSystemModel(QObject *parent = Q_NULLPTR) - : QFileSystemModel(parent) {} - - enum Roles { - SizeRole = Qt::UserRole + 4, - DisplayableFilePermissionsRole = Qt::UserRole + 5, - LastModifiedRole = Qt::UserRole + 6, - UrlStringRole = Qt::UserRole + 7 - }; - Q_ENUM(Roles) - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE - { - if (index.isValid() && role >= SizeRole) { - switch (role) { - case SizeRole: - return QVariant(sizeString(fileInfo(index))); - case DisplayableFilePermissionsRole: - return QVariant(permissionString(fileInfo(index))); - case LastModifiedRole: - return QVariant(fileInfo(index).lastModified().toString(Qt::SystemLocaleShortDate)); - case UrlStringRole: - return QVariant(QUrl::fromLocalFile(filePath(index)).toString()); - default: - break; - } - } - return QFileSystemModel::data(index, role); - } - - QHash<int,QByteArray> roleNames() const Q_DECL_OVERRIDE - { - QHash<int, QByteArray> result = QFileSystemModel::roleNames(); - result.insert(SizeRole, QByteArrayLiteral("size")); - result.insert(DisplayableFilePermissionsRole, QByteArrayLiteral("displayableFilePermissions")); - result.insert(LastModifiedRole, QByteArrayLiteral("lastModified")); - return result; - } -}; - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QQmlApplicationEngine engine; - qmlRegisterUncreatableType<DisplayFileSystemModel>("io.qt.examples.quick.controls.filesystembrowser", 1, 0, - "FileSystemModel", "Cannot create a FileSystemModel instance."); - QFileSystemModel *fsm = new DisplayFileSystemModel(&engine); - fsm->setRootPath(QDir::homePath()); - fsm->setResolveSymlinks(true); - engine.rootContext()->setContextProperty("fileSystemModel", fsm); - engine.rootContext()->setContextProperty("rootPathIndex", fsm->index(fsm->rootPath())); - engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); - if (engine.rootObjects().isEmpty()) - return -1; - - return app.exec(); -} - -#include "main.moc" diff --git a/examples/quick/controls/filesystembrowser/main.qml b/examples/quick/controls/filesystembrowser/main.qml deleted file mode 100644 index 6e79ca618..000000000 --- a/examples/quick/controls/filesystembrowser/main.qml +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** 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.Controls 1.5 -import QtQml.Models 2.2 -import io.qt.examples.quick.controls.filesystembrowser 1.0 - -ApplicationWindow { - visible: true - width: 640 - height: 480 - title: qsTr("File System") - - menuBar: MenuBar { - Menu { - title: qsTr("File") - MenuItem { - text: qsTr("Exit") - onTriggered: Qt.quit(); - } - } - } - - Row { - id: row - anchors.top: parent.top - anchors.topMargin: 12 - anchors.horizontalCenter: parent.horizontalCenter - - ExclusiveGroup { - id: eg - } - - Repeater { - model: [ "None", "Single", "Extended", "Multi", "Contig."] - Button { - text: modelData - exclusiveGroup: eg - checkable: true - checked: index === 1 - onClicked: view.selectionMode = index - } - } - } - - ItemSelectionModel { - id: sel - model: fileSystemModel - } - - TreeView { - id: view - anchors.fill: parent - anchors.margins: 2 * 12 + row.height - model: fileSystemModel - rootIndex: rootPathIndex - selection: sel - - TableViewColumn { - title: "Name" - role: "fileName" - resizable: true - } - - TableViewColumn { - title: "Size" - role: "size" - resizable: true - horizontalAlignment : Text.AlignRight - width: 70 - } - - TableViewColumn { - title: "Permissions" - role: "displayableFilePermissions" - resizable: true - width: 100 - } - - TableViewColumn { - title: "Date Modified" - role: "lastModified" - resizable: true - } - - onActivated : { - var url = fileSystemModel.data(index, FileSystemModel.UrlStringRole) - Qt.openUrlExternally(url) - } - } -} diff --git a/examples/quick/controls/filesystembrowser/qml.qrc b/examples/quick/controls/filesystembrowser/qml.qrc deleted file mode 100644 index 5f6483ac3..000000000 --- a/examples/quick/controls/filesystembrowser/qml.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>main.qml</file> - </qresource> -</RCC> diff --git a/examples/quick/controls/gallery/gallery.pro b/examples/quick/controls/gallery/gallery.pro deleted file mode 100644 index f13f42135..000000000 --- a/examples/quick/controls/gallery/gallery.pro +++ /dev/null @@ -1,20 +0,0 @@ -TEMPLATE = app -TARGET = gallery - -SOURCES += \ - main.cpp - -RESOURCES += \ - gallery.qrc - -OTHER_FILES += \ - main.qml \ - qml/ButtonPage.qml \ - qml/InputPage.qml \ - qml/ProgressPage.qml \ - qml/UI.js \ - qml/+android/UI.js \ - qml/+ios/UI.js \ - qml/+osx/UI.js - -include(../shared/shared.pri) diff --git a/examples/quick/controls/gallery/gallery.qrc b/examples/quick/controls/gallery/gallery.qrc deleted file mode 100644 index 873c8b5ca..000000000 --- a/examples/quick/controls/gallery/gallery.qrc +++ /dev/null @@ -1,12 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>main.qml</file> - <file>qml/ButtonPage.qml</file> - <file>qml/InputPage.qml</file> - <file>qml/ProgressPage.qml</file> - <file>qml/UI.js</file> - <file>qml/+android/UI.js</file> - <file>qml/+ios/UI.js</file> - <file>qml/+osx/UI.js</file> - </qresource> -</RCC> diff --git a/examples/quick/controls/gallery/main.cpp b/examples/quick/controls/gallery/main.cpp deleted file mode 100644 index ac3f447d3..000000000 --- a/examples/quick/controls/gallery/main.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** 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/QQmlApplicationEngine> -#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); - } - QQmlApplicationEngine engine(QUrl("qrc:/main.qml")); - if (engine.rootObjects().isEmpty()) - return -1; - return app.exec(); -} diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml deleted file mode 100644 index ab3d8d32a..000000000 --- a/examples/quick/controls/gallery/main.qml +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -** -** 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 "qml/UI.js" as UI -import "qml" - -ApplicationWindow { - visible: true - title: "Qt Quick Controls Gallery" - - width: 640 - height: 480 - - MessageDialog { - id: aboutDialog - icon: StandardIcon.Information - title: "About" - text: "Qt Quick Controls Gallery" - informativeText: "This example demonstrates most of the available Qt Quick Controls." - } - - Action { - id: copyAction - text: "&Copy" - shortcut: StandardKey.Copy - iconName: "edit-copy" - enabled: (!!activeFocusItem && !!activeFocusItem["copy"]) - onTriggered: activeFocusItem.copy() - } - - Action { - id: cutAction - text: "Cu&t" - shortcut: StandardKey.Cut - iconName: "edit-cut" - enabled: (!!activeFocusItem && !!activeFocusItem["cut"]) - onTriggered: activeFocusItem.cut() - } - - Action { - id: pasteAction - text: "&Paste" - shortcut: StandardKey.Paste - iconName: "edit-paste" - enabled: (!!activeFocusItem && !!activeFocusItem["paste"]) - onTriggered: activeFocusItem.paste() - } - - toolBar: ToolBar { - RowLayout { - anchors.fill: parent - anchors.margins: spacing - Label { - text: UI.label - } - Item { Layout.fillWidth: true } - CheckBox { - id: enabler - text: "Enabled" - checked: true - } - } - } - - menuBar: MenuBar { - Menu { - title: "&File" - MenuItem { - text: "E&xit" - shortcut: StandardKey.Quit - onTriggered: Qt.quit() - } - } - Menu { - title: "&Edit" - visible: tabView.currentIndex == 2 - MenuItem { action: cutAction } - MenuItem { action: copyAction } - MenuItem { action: pasteAction } - } - Menu { - title: "&Help" - MenuItem { - text: "About..." - onTriggered: aboutDialog.open() - } - } - } - - TabView { - id: tabView - - anchors.fill: parent - anchors.margins: UI.margin - tabPosition: UI.tabPosition - - Layout.minimumWidth: 360 - Layout.minimumHeight: 360 - Layout.preferredWidth: 480 - Layout.preferredHeight: 640 - - Tab { - title: "Buttons" - ButtonPage { - enabled: enabler.checked - } - } - Tab { - title: "Progress" - ProgressPage { - enabled: enabler.checked - } - } - Tab { - title: "Input" - InputPage { - enabled: enabler.checked - } - } - } -} diff --git a/examples/quick/controls/gallery/qml/+android/UI.js b/examples/quick/controls/gallery/qml/+android/UI.js deleted file mode 100644 index 417b4581e..000000000 --- a/examples/quick/controls/gallery/qml/+android/UI.js +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** 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 library - -var margin = 0 -var tabPosition = Qt.BottomEdge -var label = "Gallery" diff --git a/examples/quick/controls/gallery/qml/+ios/UI.js b/examples/quick/controls/gallery/qml/+ios/UI.js deleted file mode 100644 index 417b4581e..000000000 --- a/examples/quick/controls/gallery/qml/+ios/UI.js +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** 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 library - -var margin = 0 -var tabPosition = Qt.BottomEdge -var label = "Gallery" diff --git a/examples/quick/controls/gallery/qml/+osx/UI.js b/examples/quick/controls/gallery/qml/+osx/UI.js deleted file mode 100644 index ee439953c..000000000 --- a/examples/quick/controls/gallery/qml/+osx/UI.js +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** 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 library - -var margin = 12 -var tabPosition = Qt.TopEdge -var label = "" diff --git a/examples/quick/controls/gallery/qml/ButtonPage.qml b/examples/quick/controls/gallery/qml/ButtonPage.qml deleted file mode 100644 index b6db20de4..000000000 --- a/examples/quick/controls/gallery/qml/ButtonPage.qml +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** 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 - -ScrollView { - id: page - implicitWidth: 640 - implicitHeight: 200 - - horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff - - Item { - id: content - - width: Math.max(page.viewport.width, grid.implicitWidth + 2 * grid.rowSpacing) - height: Math.max(page.viewport.height, grid.implicitHeight + 2 * grid.columnSpacing) - - GridLayout { - id: grid - - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: grid.rowSpacing - anchors.rightMargin: grid.rowSpacing - anchors.topMargin: grid.columnSpacing - - columns: page.width < page.height ? 1 : 2 - - GroupBox { - title: "Button" - Layout.fillWidth: true - Layout.columnSpan: grid.columns - RowLayout { - anchors.fill: parent - Button { text: "OK"; isDefault: true } - Button { text: "Cancel" } - Item { Layout.fillWidth: true } - Button { - text: "Attach" - menu: Menu { - MenuItem { text: "Image" } - MenuItem { text: "Document" } - } - } - } - } - - GroupBox { - title: "CheckBox" - Layout.fillWidth: true - ColumnLayout { - anchors.fill: parent - CheckBox { text: "E-mail"; checked: true } - CheckBox { text: "Calendar"; checked: true } - CheckBox { text: "Contacts" } - } - } - - GroupBox { - title: "RadioButton" - Layout.fillWidth: true - ColumnLayout { - anchors.fill: parent - ExclusiveGroup { id: radioGroup } - RadioButton { text: "Portrait"; exclusiveGroup: radioGroup } - RadioButton { text: "Landscape"; exclusiveGroup: radioGroup } - RadioButton { text: "Automatic"; exclusiveGroup: radioGroup; checked: true } - } - } - - GroupBox { - title: "Switch" - Layout.fillWidth: true - Layout.columnSpan: grid.columns - ColumnLayout { - anchors.fill: parent - RowLayout { - Label { text: "Wi-Fi"; Layout.fillWidth: true } - Switch { checked: true } - } - RowLayout { - Label { text: "Bluetooth"; Layout.fillWidth: true } - Switch { checked: false } - } - } - } - } - } -} diff --git a/examples/quick/controls/gallery/qml/InputPage.qml b/examples/quick/controls/gallery/qml/InputPage.qml deleted file mode 100644 index 660429671..000000000 --- a/examples/quick/controls/gallery/qml/InputPage.qml +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** 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 - -ScrollView { - id: page - implicitWidth: 640 - implicitHeight: 400 - - horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff - - Item { - id: content - - width: Math.max(page.viewport.width, column.implicitWidth + 2 * column.spacing) - height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing) - - ColumnLayout { - id: column - - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: column.spacing - - GroupBox { - title: "TextField" - Layout.fillWidth: true - ColumnLayout { - anchors.fill: parent - TextField { placeholderText: "..."; Layout.fillWidth: true; z: 1 } - TextField { placeholderText: "Password"; echoMode: TextInput.Password; Layout.fillWidth: true } - } - } - - GroupBox { - title: "ComboBox" - Layout.fillWidth: true - ColumnLayout { - anchors.fill: parent - ComboBox { - model: Qt.fontFamilies() - Layout.fillWidth: true - } - ComboBox { - editable: true - model: ListModel { - id: listModel - ListElement { text: "Apple" } - ListElement { text: "Banana" } - ListElement { text: "Coconut" } - ListElement { text: "Orange" } - } - onAccepted: { - if (find(currentText) === -1) { - listModel.append({text: editText}) - currentIndex = find(editText) - } - } - Layout.fillWidth: true - } - } - } - - GroupBox { - title: "SpinBox" - Layout.fillWidth: true - ColumnLayout { - anchors.fill: parent - SpinBox { value: 99; Layout.fillWidth: true; z: 1 } - SpinBox { decimals: 2; Layout.fillWidth: true } - } - } - } - } -} diff --git a/examples/quick/controls/gallery/qml/ProgressPage.qml b/examples/quick/controls/gallery/qml/ProgressPage.qml deleted file mode 100644 index 416e936ae..000000000 --- a/examples/quick/controls/gallery/qml/ProgressPage.qml +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** 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 - -ScrollView { - id: page - implicitWidth: 640 - implicitHeight: 400 - - horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff - - Item { - id: content - - width: Math.max(page.viewport.width, column.implicitWidth + 2 * column.spacing) - height: Math.max(page.viewport.height, column.implicitHeight + 2 * column.spacing) - - ColumnLayout { - id: column - - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: column.spacing - - GroupBox { - title: "ProgressBar" - Layout.fillWidth: true - ColumnLayout { - anchors.fill: parent - ProgressBar { indeterminate: true; Layout.fillWidth: true } - ProgressBar { value: slider.value; Layout.fillWidth: true } - } - } - - GroupBox { - title: "Slider" - Layout.fillWidth: true - ColumnLayout { - anchors.fill: parent - Slider { id: slider; value: 0.5; Layout.fillWidth: true } - } - } - - GroupBox { - title: "BusyIndicator" - Layout.fillWidth: true - BusyIndicator { running: true } - } - } - } -} diff --git a/examples/quick/controls/gallery/qml/UI.js b/examples/quick/controls/gallery/qml/UI.js deleted file mode 100644 index 819c34eec..000000000 --- a/examples/quick/controls/gallery/qml/UI.js +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** 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 library - -var margin = 2 -var tabPosition = Qt.TopEdge -var label = "" diff --git a/examples/quick/controls/shared/qtquickcontrolsapplication.h b/examples/quick/controls/shared/qtquickcontrolsapplication.h deleted file mode 100644 index 5f22b483f..000000000 --- a/examples/quick/controls/shared/qtquickcontrolsapplication.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - -#ifndef QTQUICKCONTROLSAPPLICATION_H -#define QTQUICKCONTROLSAPPLICATION_H - -#ifdef QT_WIDGETS_LIB -#include <QtWidgets/QApplication> -#else -#include <QtGui/QGuiApplication> -#endif - -QT_BEGIN_NAMESPACE - -#ifdef QT_WIDGETS_LIB -#define QtQuickControlsApplication QApplication -#else -#define QtQuickControlsApplication QGuiApplication -#endif - -QT_END_NAMESPACE - -#endif // QTQUICKCONTROLSAPPLICATION_H diff --git a/examples/quick/controls/shared/shared.pri b/examples/quick/controls/shared/shared.pri deleted file mode 100644 index 1d9e0592f..000000000 --- a/examples/quick/controls/shared/shared.pri +++ /dev/null @@ -1,7 +0,0 @@ -QT += quick -!no_desktop: QT += widgets - -INCLUDEPATH += $$PWD - -SOURCES += \ - $$PWD/qtquickcontrolsapplication.h diff --git a/examples/quick/controls/styles/images/bubble.png b/examples/quick/controls/styles/images/bubble.png Binary files differdeleted file mode 100644 index 62aa1efe5..000000000 --- a/examples/quick/controls/styles/images/bubble.png +++ /dev/null diff --git a/examples/quick/controls/styles/images/button-pressed.png b/examples/quick/controls/styles/images/button-pressed.png Binary files differdeleted file mode 100644 index d64cdaa78..000000000 --- a/examples/quick/controls/styles/images/button-pressed.png +++ /dev/null diff --git a/examples/quick/controls/styles/images/button.png b/examples/quick/controls/styles/images/button.png Binary files differdeleted file mode 100644 index 8ab41cc80..000000000 --- a/examples/quick/controls/styles/images/button.png +++ /dev/null diff --git a/examples/quick/controls/styles/images/progress-background.png b/examples/quick/controls/styles/images/progress-background.png Binary files differdeleted file mode 100644 index 55a069dfc..000000000 --- a/examples/quick/controls/styles/images/progress-background.png +++ /dev/null diff --git a/examples/quick/controls/styles/images/progress-fill.png b/examples/quick/controls/styles/images/progress-fill.png Binary files differdeleted file mode 100644 index b588c9586..000000000 --- a/examples/quick/controls/styles/images/progress-fill.png +++ /dev/null diff --git a/examples/quick/controls/styles/images/slider-handle.png b/examples/quick/controls/styles/images/slider-handle.png Binary files differdeleted file mode 100644 index ac4d4a0d9..000000000 --- a/examples/quick/controls/styles/images/slider-handle.png +++ /dev/null diff --git a/examples/quick/controls/styles/images/tab.png b/examples/quick/controls/styles/images/tab.png Binary files differdeleted file mode 100644 index 74fefab78..000000000 --- a/examples/quick/controls/styles/images/tab.png +++ /dev/null diff --git a/examples/quick/controls/styles/images/tab_selected.png b/examples/quick/controls/styles/images/tab_selected.png Binary files differdeleted file mode 100644 index 665400ccf..000000000 --- a/examples/quick/controls/styles/images/tab_selected.png +++ /dev/null diff --git a/examples/quick/controls/styles/images/textfield.png b/examples/quick/controls/styles/images/textfield.png Binary files differdeleted file mode 100644 index 1d4a38ab3..000000000 --- a/examples/quick/controls/styles/images/textfield.png +++ /dev/null diff --git a/examples/quick/controls/styles/main.cpp b/examples/quick/controls/styles/main.cpp deleted file mode 100644 index 55c592e6e..000000000 --- a/examples/quick/controls/styles/main.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 <QGuiApplication> -#include <QQmlApplicationEngine> - -int main(int argc, char *argv[]) -{ - QGuiApplication app(argc, argv); - - QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - if (engine.rootObjects().isEmpty()) - return -1; - return app.exec(); -} diff --git a/examples/quick/controls/styles/main.qml b/examples/quick/controls/styles/main.qml deleted file mode 100644 index b2eefb862..000000000 --- a/examples/quick/controls/styles/main.qml +++ /dev/null @@ -1,397 +0,0 @@ -/**************************************************************************** -** -** 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.Window 2.2 -import QtQuick.Layouts 1.1 -import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.2 -import QtQuick.Particles 2.0 - -Window { - id: window - width: 640 - height: 480 - visible: true - title: qsTr("Styles Example") - - property int columnFactor: 5 - - GridLayout { - rowSpacing: 12 - columnSpacing: 30 - anchors.top: parent.top - anchors.horizontalCenter: parent.horizontalCenter - anchors.margins: 30 - - Button { - text: "Button" - implicitWidth: window.width / columnFactor - } - Button { - text: "Button" - style: ButtonStyle { - background: BorderImage { - source: control.pressed ? "images/button-pressed.png" : "images/button.png" - border.left: 4 ; border.right: 4 ; border.top: 4 ; border.bottom: 4 - } - } - implicitWidth: window.width / columnFactor - } - Button { - text: "Button" - style: buttonStyle - implicitWidth: window.width / columnFactor - } - - TextField { - Layout.row: 1 - implicitWidth: window.width / columnFactor - } - TextField { - style: TextFieldStyle { - background: BorderImage { - source: "images/textfield.png" - border.left: 4 ; border.right: 4 ; border.top: 4 ; border.bottom: 4 - } - } - implicitWidth: window.width / columnFactor - } - TextField { - style: textFieldStyle - implicitWidth: window.width / columnFactor - } - - Slider { - id: slider1 - Layout.row: 2 - value: 0.5 - implicitWidth: window.width / columnFactor - } - Slider { - id: slider2 - value: 0.5 - implicitWidth: window.width / columnFactor - style: SliderStyle { - groove: BorderImage { - height: 6 - border.top: 1 - border.bottom: 1 - source: "images/progress-background.png" - border.left: 6 - border.right: 6 - BorderImage { - anchors.verticalCenter: parent.verticalCenter - source: "images/progress-fill.png" - border.left: 5 ; border.top: 1 - border.right: 5 ; border.bottom: 1 - width: styleData.handlePosition - height: parent.height - } - } - handle: Item { - width: 13 - height: 13 - Image { - anchors.centerIn: parent - source: "images/slider-handle.png" - } - } - } - } - Slider { - id: slider3 - value: 0.5 - implicitWidth: window.width / columnFactor - style: sliderStyle - } - - ProgressBar { - Layout.row: 3 - value: slider1.value - implicitWidth: window.width / columnFactor - } - ProgressBar { - value: slider2.value - implicitWidth: window.width / columnFactor - style: progressBarStyle - } - ProgressBar { - value: slider3.value - implicitWidth: window.width / columnFactor - style: progressBarStyle2 - } - - CheckBox { - text: "CheckBox" - Layout.row: 4 - implicitWidth: window.width / columnFactor - } - - RadioButton { - text: "RadioButton" - implicitWidth: window.width / columnFactor - } - - ComboBox { - model: ["Paris", "Oslo", "New York"] - implicitWidth: window.width / columnFactor - } - - TabView { - Layout.row: 5 - Layout.columnSpan: 3 - Layout.fillWidth: true - implicitHeight: 30 - Tab { title: "One" ; Item {} } - Tab { title: "Two" ; Item {} } - Tab { title: "Three" ; Item {} } - Tab { title: "Four" ; Item {} } - } - - TabView { - Layout.row: 6 - Layout.columnSpan: 3 - Layout.fillWidth: true - implicitHeight: 30 - Tab { title: "One" ; Item {}} - Tab { title: "Two" ; Item {}} - Tab { title: "Three" ; Item {}} - Tab { title: "Four" ; Item {}} - style: tabViewStyle - } - } - - // Style delegates: - - Component { - id: buttonStyle - ButtonStyle { - - background: Rectangle { - implicitHeight: 22 - implicitWidth: window.width / columnFactor - color: control.pressed ? "darkGray" : control.activeFocus ? "#cdd" : "#ccc" - antialiasing: true - border.color: "gray" - radius: height/2 - Rectangle { - anchors.fill: parent - anchors.margins: 1 - color: "transparent" - antialiasing: true - visible: !control.pressed - border.color: "#aaffffff" - radius: height/2 - } - } - } - } - - Component { - id: textFieldStyle - TextFieldStyle { - background: Rectangle { - implicitWidth: window.width / columnFactor - color: "#f0f0f0" - antialiasing: true - border.color: "gray" - radius: height/2 - Rectangle { - anchors.fill: parent - anchors.margins: 1 - color: "transparent" - antialiasing: true - border.color: "#aaffffff" - radius: height/2 - } - } - } - } - - Component { - id: sliderStyle - SliderStyle { - handle: Rectangle { - width: 18 - height: 18 - color: control.pressed ? "darkGray" : "lightGray" - border.color: "gray" - antialiasing: true - radius: height/2 - Rectangle { - anchors.fill: parent - anchors.margins: 1 - color: "transparent" - antialiasing: true - border.color: "#eee" - radius: height/2 - } - } - - groove: Rectangle { - height: 8 - implicitWidth: window.width / columnFactor - implicitHeight: 22 - - antialiasing: true - color: "#ccc" - border.color: "#777" - radius: height/2 - Rectangle { - anchors.fill: parent - anchors.margins: 1 - color: "transparent" - antialiasing: true - border.color: "#66ffffff" - radius: height/2 - } - } - } - } - - Component { - id: progressBarStyle - ProgressBarStyle { - background: BorderImage { - source: "images/progress-background.png" - border.left: 2 ; border.right: 2 ; border.top: 2 ; border.bottom: 2 - } - progress: Item { - clip: true - BorderImage { - anchors.fill: parent - anchors.rightMargin: (control.value < control.maximumValue) ? -4 : 0 - source: "images/progress-fill.png" - border.left: 10 ; border.right: 10 - Rectangle { - width: 1 - color: "#a70" - opacity: 0.8 - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.bottomMargin: 1 - anchors.right: parent.right - visible: control.value < control.maximumValue - anchors.rightMargin: -parent.anchors.rightMargin - } - } - ParticleSystem { id: bubbles; running: visible } - ImageParticle { - id: fireball - system: bubbles - source: "images/bubble.png" - opacity: 0.7 - } - Emitter { - system: bubbles - anchors.bottom: parent.bottom - anchors.margins: 4 - anchors.bottomMargin: -4 - anchors.left: parent.left - anchors.right: parent.right - size: 4 - sizeVariation: 4 - acceleration: PointDirection { y: -6; xVariation: 3 } - emitRate: 6 * control.value - lifeSpan: 3000 - } - } - } - } - - Component { - id: progressBarStyle2 - ProgressBarStyle { - background: Rectangle { - implicitWidth: window.width / columnFactor - implicitHeight: 24 - color: "#f0f0f0" - border.color: "gray" - } - progress: Rectangle { - color: "#ccc" - border.color: "gray" - Rectangle { - color: "transparent" - border.color: "#44ffffff" - anchors.fill: parent - anchors.margins: 1 - } - } - } - } - - Component { - id: tabViewStyle - TabViewStyle { - tabOverlap: 16 - frameOverlap: 4 - tabsMovable: true - - frame: Rectangle { - gradient: Gradient { - GradientStop { color: "#e5e5e5" ; position: 0 } - GradientStop { color: "#e0e0e0" ; position: 1 } - } - border.color: "#898989" - Rectangle { anchors.fill: parent ; anchors.margins: 1 ; border.color: "white" ; color: "transparent" } - } - tab: Item { - property int totalOverlap: tabOverlap * (control.count - 1) - implicitWidth: Math.min ((styleData.availableWidth + totalOverlap)/control.count - 4, image.sourceSize.width) - implicitHeight: image.sourceSize.height - BorderImage { - id: image - anchors.fill: parent - source: styleData.selected ? "images/tab_selected.png" : "images/tab.png" - border.left: 30 - smooth: false - border.right: 30 - } - Text { - text: styleData.title - anchors.centerIn: parent - } - } - leftCorner: Item { implicitWidth: 12 } - } - } -} diff --git a/examples/quick/controls/styles/styles.pro b/examples/quick/controls/styles/styles.pro deleted file mode 100644 index 03648f4cc..000000000 --- a/examples/quick/controls/styles/styles.pro +++ /dev/null @@ -1,10 +0,0 @@ -TEMPLATE = app -TARGET = styles -QT += qml quick - -SOURCES += \ - main.cpp -RESOURCES += \ - styles.qrc -OTHER_FILES += \ - main.qml diff --git a/examples/quick/controls/styles/styles.qrc b/examples/quick/controls/styles/styles.qrc deleted file mode 100644 index d2300c6fa..000000000 --- a/examples/quick/controls/styles/styles.qrc +++ /dev/null @@ -1,14 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>main.qml</file> - <file>images/bubble.png</file> - <file>images/button.png</file> - <file>images/button-pressed.png</file> - <file>images/progress-background.png</file> - <file>images/progress-fill.png</file> - <file>images/slider-handle.png</file> - <file>images/tab.png</file> - <file>images/tab_selected.png</file> - <file>images/textfield.png</file> - </qresource> -</RCC> diff --git a/examples/quick/controls/tableview/main.qml b/examples/quick/controls/tableview/main.qml deleted file mode 100644 index 1d99f4b93..000000000 --- a/examples/quick/controls/tableview/main.qml +++ /dev/null @@ -1,188 +0,0 @@ -/**************************************************************************** -** -** 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 org.qtproject.example 1.0 - -ApplicationWindow { - id: window - visible: true - title: "Table View Example" - - toolBar: ToolBar { - TextField { - id: searchBox - - placeholderText: "Search..." - inputMethodHints: Qt.ImhNoPredictiveText - - width: window.width / 5 * 2 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - } - } - - TableView { - id: tableView - - frameVisible: false - sortIndicatorVisible: true - - anchors.fill: parent - - Layout.minimumWidth: 400 - Layout.minimumHeight: 240 - Layout.preferredWidth: 600 - Layout.preferredHeight: 400 - - TableViewColumn { - id: titleColumn - title: "Title" - role: "title" - movable: false - resizable: false - width: tableView.viewport.width - authorColumn.width - } - - TableViewColumn { - id: authorColumn - title: "Author" - role: "author" - movable: false - resizable: false - width: tableView.viewport.width / 3 - } - - model: SortFilterProxyModel { - id: proxyModel - source: sourceModel.count > 0 ? sourceModel : null - - sortOrder: tableView.sortIndicatorOrder - sortCaseSensitivity: Qt.CaseInsensitive - sortRole: sourceModel.count > 0 ? tableView.getColumn(tableView.sortIndicatorColumn).role : "" - - filterString: "*" + searchBox.text + "*" - filterSyntax: SortFilterProxyModel.Wildcard - filterCaseSensitivity: Qt.CaseInsensitive - } - - ListModel { - id: sourceModel - ListElement { - title: "Moby-Dick" - author: "Herman Melville" - } - ListElement { - title: "The Adventures of Tom Sawyer" - author: "Mark Twain" - } - ListElement { - title: "Cat’s Cradle" - author: "Kurt Vonnegut" - } - ListElement { - title: "Farenheit 451" - author: "Ray Bradbury" - } - ListElement { - title: "It" - author: "Stephen King" - } - ListElement { - title: "On the Road" - author: "Jack Kerouac" - } - ListElement { - title: "Of Mice and Men" - author: "John Steinbeck" - } - ListElement { - title: "Do Androids Dream of Electric Sheep?" - author: "Philip K. Dick" - } - ListElement { - title: "Uncle Tom’s Cabin" - author: "Harriet Beecher Stowe" - } - ListElement { - title: "The Call of the Wild" - author: "Jack London" - } - ListElement { - title: "The Old Man and the Sea" - author: "Ernest Hemingway" - } - ListElement { - title: "A Streetcar Named Desire" - author: "Tennessee Williams" - } - ListElement { - title: "Catch-22" - author: "Joseph Heller" - } - ListElement { - title: "One Flew Over the Cuckoo’s Nest" - author: "Ken Kesey" - } - ListElement { - title: "The Murders in the Rue Morgue" - author: "Edgar Allan Poe" - } - ListElement { - title: "Breakfast at Tiffany’s" - author: "Truman Capote" - } - ListElement { - title: "Death of a Salesman" - author: "Arthur Miller" - } - ListElement { - title: "Post Office" - author: "Charles Bukowski" - } - ListElement { - title: "Herbert West—Reanimator" - author: "H. P. Lovecraft" - } - } - } -} diff --git a/examples/quick/controls/tableview/src/main.cpp b/examples/quick/controls/tableview/src/main.cpp deleted file mode 100644 index dbba7f38c..000000000 --- a/examples/quick/controls/tableview/src/main.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** 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 "sortfilterproxymodel.h" -#include <QtQml/qqmlapplicationengine.h> -#include <QtGui/qsurfaceformat.h> -#include <QtQml/qqml.h> - -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); - } - qmlRegisterType<SortFilterProxyModel>("org.qtproject.example", 1, 0, "SortFilterProxyModel"); - QQmlApplicationEngine engine(QUrl("qrc:/main.qml")); - return app.exec(); -} diff --git a/examples/quick/controls/tableview/src/sortfilterproxymodel.cpp b/examples/quick/controls/tableview/src/sortfilterproxymodel.cpp deleted file mode 100644 index f362d5d3d..000000000 --- a/examples/quick/controls/tableview/src/sortfilterproxymodel.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/**************************************************************************** -** -** 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 "sortfilterproxymodel.h" -#include <QtDebug> -#include <QtQml> - -SortFilterProxyModel::SortFilterProxyModel(QObject *parent) : QSortFilterProxyModel(parent), m_complete(false) -{ - connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(countChanged())); - connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(countChanged())); -} - -int SortFilterProxyModel::count() const -{ - return rowCount(); -} - -QObject *SortFilterProxyModel::source() const -{ - return sourceModel(); -} - -void SortFilterProxyModel::setSource(QObject *source) -{ - setSourceModel(qobject_cast<QAbstractItemModel *>(source)); -} - -QByteArray SortFilterProxyModel::sortRole() const -{ - return m_sortRole; -} - -void SortFilterProxyModel::setSortRole(const QByteArray &role) -{ - if (m_sortRole != role) { - m_sortRole = role; - if (m_complete) - QSortFilterProxyModel::setSortRole(roleKey(role)); - } -} - -void SortFilterProxyModel::setSortOrder(Qt::SortOrder order) -{ - QSortFilterProxyModel::sort(0, order); -} - -QByteArray SortFilterProxyModel::filterRole() const -{ - return m_filterRole; -} - -void SortFilterProxyModel::setFilterRole(const QByteArray &role) -{ - if (m_filterRole != role) { - m_filterRole = role; - if (m_complete) - QSortFilterProxyModel::setFilterRole(roleKey(role)); - } -} - -QString SortFilterProxyModel::filterString() const -{ - return filterRegExp().pattern(); -} - -void SortFilterProxyModel::setFilterString(const QString &filter) -{ - setFilterRegExp(QRegExp(filter, filterCaseSensitivity(), static_cast<QRegExp::PatternSyntax>(filterSyntax()))); -} - -SortFilterProxyModel::FilterSyntax SortFilterProxyModel::filterSyntax() const -{ - return static_cast<FilterSyntax>(filterRegExp().patternSyntax()); -} - -void SortFilterProxyModel::setFilterSyntax(SortFilterProxyModel::FilterSyntax syntax) -{ - setFilterRegExp(QRegExp(filterString(), filterCaseSensitivity(), static_cast<QRegExp::PatternSyntax>(syntax))); -} - -QJSValue SortFilterProxyModel::get(int idx) const -{ - QJSEngine *engine = qmlEngine(this); - QJSValue value = engine->newObject(); - if (idx >= 0 && idx < count()) { - QHash<int, QByteArray> roles = roleNames(); - QHashIterator<int, QByteArray> it(roles); - while (it.hasNext()) { - it.next(); - value.setProperty(QString::fromUtf8(it.value()), data(index(idx, 0), it.key()).toString()); - } - } - return value; -} - -void SortFilterProxyModel::classBegin() -{ -} - -void SortFilterProxyModel::componentComplete() -{ - m_complete = true; - if (!m_sortRole.isEmpty()) - QSortFilterProxyModel::setSortRole(roleKey(m_sortRole)); - if (!m_filterRole.isEmpty()) - QSortFilterProxyModel::setFilterRole(roleKey(m_filterRole)); -} - -int SortFilterProxyModel::roleKey(const QByteArray &role) const -{ - QHash<int, QByteArray> roles = roleNames(); - QHashIterator<int, QByteArray> it(roles); - while (it.hasNext()) { - it.next(); - if (it.value() == role) - return it.key(); - } - return -1; -} - -QHash<int, QByteArray> SortFilterProxyModel::roleNames() const -{ - if (QAbstractItemModel *source = sourceModel()) - return source->roleNames(); - return QHash<int, QByteArray>(); -} - -bool SortFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const -{ - QRegExp rx = filterRegExp(); - if (rx.isEmpty()) - return true; - QAbstractItemModel *model = sourceModel(); - if (filterRole().isEmpty()) { - QHash<int, QByteArray> roles = roleNames(); - QHashIterator<int, QByteArray> it(roles); - while (it.hasNext()) { - it.next(); - QModelIndex sourceIndex = model->index(sourceRow, 0, sourceParent); - QString key = model->data(sourceIndex, it.key()).toString(); - if (key.contains(rx)) - return true; - } - return false; - } - QModelIndex sourceIndex = model->index(sourceRow, 0, sourceParent); - if (!sourceIndex.isValid()) - return true; - QString key = model->data(sourceIndex, roleKey(filterRole())).toString(); - return key.contains(rx); -} diff --git a/examples/quick/controls/tableview/src/sortfilterproxymodel.h b/examples/quick/controls/tableview/src/sortfilterproxymodel.h deleted file mode 100644 index c4460b0f1..000000000 --- a/examples/quick/controls/tableview/src/sortfilterproxymodel.h +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - -#ifndef SORTFILTERPROXYMODEL_H -#define SORTFILTERPROXYMODEL_H - -#include <QtCore/qsortfilterproxymodel.h> -#include <QtQml/qqmlparserstatus.h> -#include <QtQml/qjsvalue.h> - -class SortFilterProxyModel : public QSortFilterProxyModel, public QQmlParserStatus -{ - Q_OBJECT - Q_INTERFACES(QQmlParserStatus) - - Q_PROPERTY(int count READ count NOTIFY countChanged) - Q_PROPERTY(QObject *source READ source WRITE setSource) - - Q_PROPERTY(QByteArray sortRole READ sortRole WRITE setSortRole) - Q_PROPERTY(Qt::SortOrder sortOrder READ sortOrder WRITE setSortOrder) - - Q_PROPERTY(QByteArray filterRole READ filterRole WRITE setFilterRole) - Q_PROPERTY(QString filterString READ filterString WRITE setFilterString) - Q_PROPERTY(FilterSyntax filterSyntax READ filterSyntax WRITE setFilterSyntax) - - Q_ENUMS(FilterSyntax) - -public: - explicit SortFilterProxyModel(QObject *parent = 0); - - QObject *source() const; - void setSource(QObject *source); - - QByteArray sortRole() const; - void setSortRole(const QByteArray &role); - - void setSortOrder(Qt::SortOrder order); - - QByteArray filterRole() const; - void setFilterRole(const QByteArray &role); - - QString filterString() const; - void setFilterString(const QString &filter); - - enum FilterSyntax { - RegExp, - Wildcard, - FixedString - }; - - FilterSyntax filterSyntax() const; - void setFilterSyntax(FilterSyntax syntax); - - int count() const; - Q_INVOKABLE QJSValue get(int index) const; - - void classBegin(); - void componentComplete(); - -signals: - void countChanged(); - -protected: - int roleKey(const QByteArray &role) const; - QHash<int, QByteArray> roleNames() const; - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; - -private: - bool m_complete; - QByteArray m_sortRole; - QByteArray m_filterRole; -}; - -#endif // SORTFILTERPROXYMODEL_H diff --git a/examples/quick/controls/tableview/src/src.pri b/examples/quick/controls/tableview/src/src.pri deleted file mode 100644 index 491f851c9..000000000 --- a/examples/quick/controls/tableview/src/src.pri +++ /dev/null @@ -1,8 +0,0 @@ -INCLUDEPATH += $$PWD - -HEADERS += \ - $$PWD/sortfilterproxymodel.h - -SOURCES += \ - $$PWD/main.cpp \ - $$PWD/sortfilterproxymodel.cpp diff --git a/examples/quick/controls/tableview/tableview.pro b/examples/quick/controls/tableview/tableview.pro deleted file mode 100644 index c0ed1a2f9..000000000 --- a/examples/quick/controls/tableview/tableview.pro +++ /dev/null @@ -1,11 +0,0 @@ -TEMPLATE = app -TARGET = tableview - -RESOURCES += \ - tableview.qrc - -OTHER_FILES += \ - main.qml - -include(src/src.pri) -include(../shared/shared.pri) diff --git a/examples/quick/controls/tableview/tableview.qrc b/examples/quick/controls/tableview/tableview.qrc deleted file mode 100644 index 3b111a907..000000000 --- a/examples/quick/controls/tableview/tableview.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource prefix="/"> - <file>main.qml</file> -</qresource> -</RCC> diff --git a/examples/quick/controls/texteditor/example.html b/examples/quick/controls/texteditor/example.html deleted file mode 100644 index 52bb507a1..000000000 --- a/examples/quick/controls/texteditor/example.html +++ /dev/null @@ -1,79 +0,0 @@ -<html><head><meta name="qrichtext" content="1" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>TextArea Example</title><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:20pt; font-weight:600;">TextArea</span></p> -<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">The TextArea control is an advanced editor that supports formatted rich text. It can be used to display HTML and other rich document formats. Internally, TextArea uses the QQuickTextDocument class to describe both the high-level structure of each document and the low-level formatting of paragraphs.</span></p> -<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">If you are viewing this document in the <span style=" font-style:italic;">Text Editor</span> example, you can edit this document to explore Qt's rich text editing features. We have included some comments in each of the following sections to encourage you to experiment. </p> -<p style=" margin-top:16px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:18pt; font-weight:600;"><span style=" font-size:16pt;">Font and Paragraph Styles</span></p> -<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">TextArea supports </span><span style=" font-size:11pt; font-weight:600;">bold</span><span style=" font-size:11pt;">, </span><span style=" font-size:11pt; font-style:italic;">italic</span><span style=" font-size:11pt;">, and </span><span style=" font-size:11pt; text-decoration: underline;">underlined</span><span style=" font-size:11pt;"> font styles, and can display </span><span style=" font-size:11pt; font-weight:600; color:#00007f;">multicolored</span> -<span style=" font-size:11pt;"> </span><span style=" font-size:11pt; font-weight:600; color:#aa0000;">text</span><span style=" font-size:11pt;">. Font families such as</span><span style=" font-family:'Helvetica'; font-size:11pt; font-weight:600;"> Helvetica</span><span style=" font-size:11pt;"> and -</span><span style=" font-family:'Courier'; font-size:11pt; font-weight:600;"> Courier</span><span style=" font-size:11pt;"> can also be used directly.<span style=" font-size:11pt; font-style:italic;"> If you place the cursor in a region of styled text, the corresponding controls in the tool bar will change to reflect the current style, font size and color.</span></p> -<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Paragraphs can be formatted so that the text is left-aligned, right-aligned, centered, or fully justified.</p> -<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><span style=" font-style:italic;">Try changing the alignment of some text and resize the editor to see how the text layout changes.</span> </p> -<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt; font-weight:600;">Lists</span></p> -<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16pt; font-weight:600;"><span style=" font-size:11pt; font-weight:400;">Different kinds of lists can be included in rich text documents. Standard bullet lists can be nested, using different symbols for each level of the list: </span></p> -<ul style="-qt-list-indent: 1;"><li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Disc symbols are typically used for top-level list items. </li></ul> -<ul type=circle style="-qt-list-indent: 2;"><li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Circle symbols can be used to distinguish between items in lower-level lists.</li></ul> -<ul type=square style="-qt-list-indent: 3;"><li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Square symbols provide a reasonable alternative to discs and circles. </li></ul> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Ordered lists can be used for tables of contents. Different characters can be used to enumerate items, and one can use both Roman and Arabic numerals in the same list structure: </p> -<ol style="-qt-list-indent: 1;"><li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Introduction</li> -<li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Qt Tools </li></ol> -<ol type=a style="-qt-list-indent: 2;"><li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Qt Assistant</li> -<li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Qt Designer</li> -<ol type=A style="-qt-list-indent: 3;"><li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Form Editor</li> -<li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Component Architecture</li></ol> -<li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Qt Linguist</li></ol> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">The list will automatically be renumbered if you add or remove items. <span style=" font-style:italic;">Try adding new sections to the above list or removing existing item to see the numbers change.</span> </p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p> -<p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><span style=" font-size:16pt; font-weight:600;">Images</span></p> -<p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16pt; font-weight:600;"><span style=" font-size:11pt; font-weight:400;">Inline images are treated like ordinary ranges of characters in the text editor, so they flow with the surrounding text. Images can also be selected in the same way as text, making it easy to cut, copy, and paste them. </span></p> -<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><img src="qrc:qml/images/qt-logo.png" /><span style=" font-style:italic;"> Try to select this image by clicking and dragging over it with the mouse, or use the text cursor to select it by holding down Shift and using the arrow keys. You can then cut or copy it, and paste it into different parts of this document.</span></p> -<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><span style=" font-size:16pt; font-weight:600;">Tables</span></p> -<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16pt; font-weight:600;"><span style=" font-size:11pt; font-weight:400;">TextArea can arrange and format tables, supporting features such as row and column spans, text formatting within cells, and size constraints for columns. </span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p> -<table border="1" align="center" width="90%" cellspacing="0" cellpadding="4"> -<tr> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> </p></td> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Development Tools </span></p></td> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Programming Techniques </span></p></td> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Graphical User Interfaces </span></p></td></tr> -<tr> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">9:00 - 11:00 </span></p></td> -<td colspan="3"> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Introduction to <span style=" font-style:italic;">Qt </span></p></td></tr> -<tr> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">11:00 - 13:00 </span></p></td> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Using <span style=" font-style:italic;">qmake</span> </p></td> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Object-oriented Programming </p></td> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Layouts in <span style=" font-style:italic;">Qt</span> </p></td></tr> -<tr> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">13:00 - 15:00 </span></p></td> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Qt Designer</span> Tutorial </p></td> -<td rowspan="2"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Extreme Programming </p></td> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Writing Custom Styles </p></td></tr> -<tr> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">15:00 - 17:00 </span></p></td> -<td> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Qt Linguist</span> and Internationalization </p></td> -<td></td></tr></table> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt; font-style:italic;">Try adding text to the cells in the table and experiment with the alignment of the paragraphs.</p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><span style=" font-size:16pt; font-weight:600;">Undo and Redo</span></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Full support for undo and redo operations is built into TextArea and the underlying rich text framework. Operations on a document can be packaged together to make editing easier for the user.</p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><span style=" font-style:italic;">Try making changes to this document and press Ctrl+Z to undo them. You can always recover the original contents of the document.</span> </p></body></html> diff --git a/examples/quick/controls/texteditor/qml/ToolBarSeparator.qml b/examples/quick/controls/texteditor/qml/ToolBarSeparator.qml deleted file mode 100644 index a225e2eaa..000000000 --- a/examples/quick/controls/texteditor/qml/ToolBarSeparator.qml +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** 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 - -Item { - width: 8 - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.margins: 6 - Rectangle { - width: 1 - height: parent.height - anchors.horizontalCenter: parent.horizontalCenter - color: "#22000000" - } - Rectangle { - width: 1 - height: parent.height - anchors.horizontalCenterOffset: 1 - anchors.horizontalCenter: parent.horizontalCenter - color: "#33ffffff" - } -} diff --git a/examples/quick/controls/texteditor/qml/images/editcopy.png b/examples/quick/controls/texteditor/qml/images/editcopy.png Binary files differdeleted file mode 100644 index f55136446..000000000 --- a/examples/quick/controls/texteditor/qml/images/editcopy.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/editcut.png b/examples/quick/controls/texteditor/qml/images/editcut.png Binary files differdeleted file mode 100644 index a784fd570..000000000 --- a/examples/quick/controls/texteditor/qml/images/editcut.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/editpaste.png b/examples/quick/controls/texteditor/qml/images/editpaste.png Binary files differdeleted file mode 100644 index 64c0b2d6a..000000000 --- a/examples/quick/controls/texteditor/qml/images/editpaste.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/editredo.png b/examples/quick/controls/texteditor/qml/images/editredo.png Binary files differdeleted file mode 100644 index 8875bf246..000000000 --- a/examples/quick/controls/texteditor/qml/images/editredo.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/editundo.png b/examples/quick/controls/texteditor/qml/images/editundo.png Binary files differdeleted file mode 100644 index a3bd5e0bf..000000000 --- a/examples/quick/controls/texteditor/qml/images/editundo.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/exportpdf.png b/examples/quick/controls/texteditor/qml/images/exportpdf.png Binary files differdeleted file mode 100644 index ebb44e6b8..000000000 --- a/examples/quick/controls/texteditor/qml/images/exportpdf.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/filenew.png b/examples/quick/controls/texteditor/qml/images/filenew.png Binary files differdeleted file mode 100644 index d3882c7b3..000000000 --- a/examples/quick/controls/texteditor/qml/images/filenew.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/fileopen.png b/examples/quick/controls/texteditor/qml/images/fileopen.png Binary files differdeleted file mode 100644 index fc06c5ec6..000000000 --- a/examples/quick/controls/texteditor/qml/images/fileopen.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/fileprint.png b/examples/quick/controls/texteditor/qml/images/fileprint.png Binary files differdeleted file mode 100644 index 10ca56c82..000000000 --- a/examples/quick/controls/texteditor/qml/images/fileprint.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/filesave.png b/examples/quick/controls/texteditor/qml/images/filesave.png Binary files differdeleted file mode 100644 index b41ecf531..000000000 --- a/examples/quick/controls/texteditor/qml/images/filesave.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/qt-logo.png b/examples/quick/controls/texteditor/qml/images/qt-logo.png Binary files differdeleted file mode 100644 index be1bb1060..000000000 --- a/examples/quick/controls/texteditor/qml/images/qt-logo.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/textbold.png b/examples/quick/controls/texteditor/qml/images/textbold.png Binary files differdeleted file mode 100644 index 38400bd1f..000000000 --- a/examples/quick/controls/texteditor/qml/images/textbold.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/textcenter.png b/examples/quick/controls/texteditor/qml/images/textcenter.png Binary files differdeleted file mode 100644 index 2ef5b2ee6..000000000 --- a/examples/quick/controls/texteditor/qml/images/textcenter.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/textitalic.png b/examples/quick/controls/texteditor/qml/images/textitalic.png Binary files differdeleted file mode 100644 index 0170ee26a..000000000 --- a/examples/quick/controls/texteditor/qml/images/textitalic.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/textjustify.png b/examples/quick/controls/texteditor/qml/images/textjustify.png Binary files differdeleted file mode 100644 index 39cd6c1a9..000000000 --- a/examples/quick/controls/texteditor/qml/images/textjustify.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/textleft.png b/examples/quick/controls/texteditor/qml/images/textleft.png Binary files differdeleted file mode 100644 index 83a66d553..000000000 --- a/examples/quick/controls/texteditor/qml/images/textleft.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/textright.png b/examples/quick/controls/texteditor/qml/images/textright.png Binary files differdeleted file mode 100644 index e7c04645c..000000000 --- a/examples/quick/controls/texteditor/qml/images/textright.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/textunder.png b/examples/quick/controls/texteditor/qml/images/textunder.png Binary files differdeleted file mode 100644 index 968bac5e9..000000000 --- a/examples/quick/controls/texteditor/qml/images/textunder.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/zoomin.png b/examples/quick/controls/texteditor/qml/images/zoomin.png Binary files differdeleted file mode 100644 index d46f5aff0..000000000 --- a/examples/quick/controls/texteditor/qml/images/zoomin.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/images/zoomout.png b/examples/quick/controls/texteditor/qml/images/zoomout.png Binary files differdeleted file mode 100644 index 46326566d..000000000 --- a/examples/quick/controls/texteditor/qml/images/zoomout.png +++ /dev/null diff --git a/examples/quick/controls/texteditor/qml/main.qml b/examples/quick/controls/texteditor/qml/main.qml deleted file mode 100644 index 42f5e7f94..000000000 --- a/examples/quick/controls/texteditor/qml/main.qml +++ /dev/null @@ -1,357 +0,0 @@ -/**************************************************************************** -** -** 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.Controls 1.2 -import QtQuick.Layouts 1.0 -import QtQuick.Dialogs 1.1 -import QtQuick.Window 2.1 -import org.qtproject.example 1.0 - -ApplicationWindow { - visible: true - width: 640 - height: 480 - minimumWidth: 400 - minimumHeight: 300 - - title: document.documentTitle + " - Text Editor Example" - - MessageDialog { - id: aboutBox - title: "About Text" - text: "This is a basic text editor \nwritten with Qt Quick Controls" - icon: StandardIcon.Information - } - - Action { - id: cutAction - text: "Cut" - shortcut: "ctrl+x" - iconSource: "images/editcut.png" - iconName: "edit-cut" - onTriggered: textArea.cut() - } - - Action { - id: copyAction - text: "Copy" - shortcut: "Ctrl+C" - iconSource: "images/editcopy.png" - iconName: "edit-copy" - onTriggered: textArea.copy() - } - - Action { - id: pasteAction - text: "Paste" - shortcut: "ctrl+v" - iconSource: "qrc:images/editpaste.png" - iconName: "edit-paste" - onTriggered: textArea.paste() - } - - Action { - id: alignLeftAction - text: "&Left" - iconSource: "images/textleft.png" - iconName: "format-justify-left" - shortcut: "ctrl+l" - onTriggered: document.alignment = Qt.AlignLeft - checkable: true - checked: document.alignment == Qt.AlignLeft - } - Action { - id: alignCenterAction - text: "C&enter" - iconSource: "images/textcenter.png" - iconName: "format-justify-center" - onTriggered: document.alignment = Qt.AlignHCenter - checkable: true - checked: document.alignment == Qt.AlignHCenter - } - Action { - id: alignRightAction - text: "&Right" - iconSource: "images/textright.png" - iconName: "format-justify-right" - onTriggered: document.alignment = Qt.AlignRight - checkable: true - checked: document.alignment == Qt.AlignRight - } - Action { - id: alignJustifyAction - text: "&Justify" - iconSource: "images/textjustify.png" - iconName: "format-justify-fill" - onTriggered: document.alignment = Qt.AlignJustify - checkable: true - checked: document.alignment == Qt.AlignJustify - } - - Action { - id: boldAction - text: "&Bold" - iconSource: "images/textbold.png" - iconName: "format-text-bold" - onTriggered: document.bold = !document.bold - checkable: true - checked: document.bold - } - - Action { - id: italicAction - text: "&Italic" - iconSource: "images/textitalic.png" - iconName: "format-text-italic" - onTriggered: document.italic = !document.italic - checkable: true - checked: document.italic - } - Action { - id: underlineAction - text: "&Underline" - iconSource: "images/textunder.png" - iconName: "format-text-underline" - onTriggered: document.underline = !document.underline - checkable: true - checked: document.underline - } - - FileDialog { - id: fileDialog - nameFilters: ["Text files (*.txt)", "HTML files (*.html, *.htm)"] - onAccepted: { - if (fileDialog.selectExisting) - document.fileUrl = fileUrl - else - document.saveAs(fileUrl, selectedNameFilter) - } - } - - ColorDialog { - id: colorDialog - color: "black" - } - - Action { - id: fileOpenAction - iconSource: "images/fileopen.png" - iconName: "document-open" - text: "Open" - onTriggered: { - fileDialog.selectExisting = true - fileDialog.open() - } - } - - Action { - id: fileSaveAsAction - iconSource: "images/filesave.png" - iconName: "document-save" - text: "Save As…" - onTriggered: { - fileDialog.selectExisting = false - fileDialog.open() - } - } - - menuBar: MenuBar { - Menu { - title: "&File" - MenuItem { action: fileOpenAction } - MenuItem { action: fileSaveAsAction } - MenuItem { text: "Quit"; onTriggered: Qt.quit() } - } - Menu { - title: "&Edit" - MenuItem { action: copyAction } - MenuItem { action: cutAction } - MenuItem { action: pasteAction } - } - Menu { - title: "F&ormat" - MenuItem { action: boldAction } - MenuItem { action: italicAction } - MenuItem { action: underlineAction } - MenuSeparator {} - MenuItem { action: alignLeftAction } - MenuItem { action: alignCenterAction } - MenuItem { action: alignRightAction } - MenuItem { action: alignJustifyAction } - MenuSeparator {} - MenuItem { - text: "&Color ..." - onTriggered: { - colorDialog.color = document.textColor - colorDialog.open() - } - } - } - Menu { - title: "&Help" - MenuItem { text: "About..." ; onTriggered: aboutBox.open() } - } - } - - toolBar: ToolBar { - id: mainToolBar - width: parent.width - RowLayout { - anchors.fill: parent - spacing: 0 - ToolButton { action: fileOpenAction } - - ToolBarSeparator {} - - ToolButton { action: copyAction } - ToolButton { action: cutAction } - ToolButton { action: pasteAction } - - ToolBarSeparator {} - - ToolButton { action: boldAction } - ToolButton { action: italicAction } - ToolButton { action: underlineAction } - - ToolBarSeparator {} - - ToolButton { action: alignLeftAction } - ToolButton { action: alignCenterAction } - ToolButton { action: alignRightAction } - ToolButton { action: alignJustifyAction } - - ToolBarSeparator {} - - ToolButton { - id: colorButton - property var color : document.textColor - Rectangle { - id: colorRect - anchors.fill: parent - anchors.margins: 8 - color: Qt.darker(document.textColor, colorButton.pressed ? 1.4 : 1) - border.width: 1 - border.color: Qt.darker(colorRect.color, 2) - } - onClicked: { - colorDialog.color = document.textColor - colorDialog.open() - } - } - Item { Layout.fillWidth: true } - } - } - - ToolBar { - id: secondaryToolBar - width: parent.width - - RowLayout { - anchors.fill: parent - ComboBox { - id: fontFamilyComboBox - implicitWidth: 150 - model: Qt.fontFamilies() - property bool special : false - onActivated: { - if (special == false || index != 0) { - document.fontFamily = textAt(index) - } - } - } - SpinBox { - id: fontSizeSpinBox - activeFocusOnPress: false - implicitWidth: 50 - value: 0 - property bool valueGuard: true - onValueChanged: if (valueGuard) document.fontSize = value - } - Item { Layout.fillWidth: true } - } - } - - TextArea { - Accessible.name: "document" - id: textArea - frameVisible: false - width: parent.width - anchors.top: secondaryToolBar.bottom - anchors.bottom: parent.bottom - baseUrl: "qrc:/" - text: document.text - textFormat: Qt.RichText - Component.onCompleted: forceActiveFocus() - } - - MessageDialog { - id: errorDialog - } - - DocumentHandler { - id: document - target: textArea - cursorPosition: textArea.cursorPosition - selectionStart: textArea.selectionStart - selectionEnd: textArea.selectionEnd - textColor: colorDialog.color - Component.onCompleted: document.fileUrl = "qrc:/example.html" - onFontSizeChanged: { - fontSizeSpinBox.valueGuard = false - fontSizeSpinBox.value = document.fontSize - fontSizeSpinBox.valueGuard = true - } - onFontFamilyChanged: { - var index = Qt.fontFamilies().indexOf(document.fontFamily) - if (index == -1) { - fontFamilyComboBox.currentIndex = 0 - fontFamilyComboBox.special = true - } else { - fontFamilyComboBox.currentIndex = index - fontFamilyComboBox.special = false - } - } - onError: { - errorDialog.text = message - errorDialog.visible = true - } - } -} diff --git a/examples/quick/controls/texteditor/resources.qrc b/examples/quick/controls/texteditor/resources.qrc deleted file mode 100644 index 27c7b9215..000000000 --- a/examples/quick/controls/texteditor/resources.qrc +++ /dev/null @@ -1,27 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>qml/main.qml</file> - <file>qml/ToolBarSeparator.qml</file> - <file>qml/images/editcopy.png</file> - <file>qml/images/editcut.png</file> - <file>qml/images/editpaste.png</file> - <file>qml/images/editredo.png</file> - <file>qml/images/editundo.png</file> - <file>qml/images/exportpdf.png</file> - <file>qml/images/filenew.png</file> - <file>qml/images/fileopen.png</file> - <file>qml/images/fileprint.png</file> - <file>qml/images/filesave.png</file> - <file>qml/images/textbold.png</file> - <file>qml/images/textcenter.png</file> - <file>qml/images/textitalic.png</file> - <file>qml/images/textjustify.png</file> - <file>qml/images/textleft.png</file> - <file>qml/images/textright.png</file> - <file>qml/images/textunder.png</file> - <file>qml/images/zoomin.png</file> - <file>qml/images/zoomout.png</file> - <file>example.html</file> - <file>qml/images/qt-logo.png</file> - </qresource> -</RCC> diff --git a/examples/quick/controls/texteditor/src/documenthandler.cpp b/examples/quick/controls/texteditor/src/documenthandler.cpp deleted file mode 100644 index 2e03f7471..000000000 --- a/examples/quick/controls/texteditor/src/documenthandler.cpp +++ /dev/null @@ -1,335 +0,0 @@ -/**************************************************************************** -** -** 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 "documenthandler.h" - -#include <QtGui/QTextDocument> -#include <QtGui/QTextCursor> -#include <QtGui/QFontDatabase> -#include <QtCore/QFileInfo> - -DocumentHandler::DocumentHandler() - : m_target(0) - , m_doc(0) - , m_cursorPosition(-1) - , m_selectionStart(0) - , m_selectionEnd(0) -{ -} - -void DocumentHandler::setTarget(QQuickItem *target) -{ - m_doc = 0; - m_target = target; - if (!m_target) - return; - - QVariant doc = m_target->property("textDocument"); - if (doc.canConvert<QQuickTextDocument*>()) { - QQuickTextDocument *qqdoc = doc.value<QQuickTextDocument*>(); - if (qqdoc) - m_doc = qqdoc->textDocument(); - } - emit targetChanged(); -} - -void DocumentHandler::setFileUrl(const QUrl &arg) -{ - if (m_fileUrl != arg) { - m_fileUrl = arg; - QString fileName = QQmlFile::urlToLocalFileOrQrc(arg); - if (QFile::exists(fileName)) { - QFile file(fileName); - if (file.open(QFile::ReadOnly)) { - QByteArray data = file.readAll(); - QTextCodec *codec = QTextCodec::codecForHtml(data); - setText(codec->toUnicode(data)); - if (m_doc) - m_doc->setModified(false); - if (fileName.isEmpty()) - m_documentTitle = QStringLiteral("untitled.txt"); - else - m_documentTitle = QFileInfo(fileName).fileName(); - - emit textChanged(); - emit documentTitleChanged(); - - reset(); - } - } - emit fileUrlChanged(); - } -} - -QString DocumentHandler::documentTitle() const -{ - return m_documentTitle; -} - -void DocumentHandler::setDocumentTitle(QString arg) -{ - if (m_documentTitle != arg) { - m_documentTitle = arg; - emit documentTitleChanged(); - } -} - -void DocumentHandler::setText(const QString &arg) -{ - if (m_text != arg) { - m_text = arg; - emit textChanged(); - } -} - -void DocumentHandler::saveAs(const QUrl &arg, const QString &fileType) -{ - bool isHtml = fileType.contains(QLatin1String("htm")); - QLatin1String ext(isHtml ? ".html" : ".txt"); - QString localPath = arg.toLocalFile(); - if (!localPath.endsWith(ext)) - localPath += ext; - QFile f(localPath); - if (!f.open(QFile::WriteOnly | QFile::Truncate | (isHtml ? QFile::NotOpen : QFile::Text))) { - emit error(tr("Cannot save: ") + f.errorString()); - return; - } - f.write((isHtml ? m_doc->toHtml() : m_doc->toPlainText()).toLocal8Bit()); - f.close(); - setFileUrl(QUrl::fromLocalFile(localPath)); -} - -QUrl DocumentHandler::fileUrl() const -{ - return m_fileUrl; -} - -QString DocumentHandler::text() const -{ - return m_text; -} - -void DocumentHandler::setCursorPosition(int position) -{ - if (position == m_cursorPosition) - return; - - m_cursorPosition = position; - - reset(); -} - -void DocumentHandler::reset() -{ - emit fontFamilyChanged(); - emit alignmentChanged(); - emit boldChanged(); - emit italicChanged(); - emit underlineChanged(); - emit fontSizeChanged(); - emit textColorChanged(); -} - -QTextCursor DocumentHandler::textCursor() const -{ - QTextCursor cursor = QTextCursor(m_doc); - if (m_selectionStart != m_selectionEnd) { - cursor.setPosition(m_selectionStart); - cursor.setPosition(m_selectionEnd, QTextCursor::KeepAnchor); - } else { - cursor.setPosition(m_cursorPosition); - } - return cursor; -} - -void DocumentHandler::mergeFormatOnWordOrSelection(const QTextCharFormat &format) -{ - QTextCursor cursor = textCursor(); - if (!cursor.hasSelection()) - cursor.select(QTextCursor::WordUnderCursor); - cursor.mergeCharFormat(format); -} - -void DocumentHandler::setSelectionStart(int position) -{ - m_selectionStart = position; -} - -void DocumentHandler::setSelectionEnd(int position) -{ - m_selectionEnd = position; -} - -void DocumentHandler::setAlignment(Qt::Alignment a) -{ - QTextBlockFormat fmt; - fmt.setAlignment((Qt::Alignment) a); - QTextCursor cursor = QTextCursor(m_doc); - cursor.setPosition(m_selectionStart, QTextCursor::MoveAnchor); - cursor.setPosition(m_selectionEnd, QTextCursor::KeepAnchor); - cursor.mergeBlockFormat(fmt); - emit alignmentChanged(); -} - -Qt::Alignment DocumentHandler::alignment() const -{ - QTextCursor cursor = textCursor(); - if (cursor.isNull()) - return Qt::AlignLeft; - return textCursor().blockFormat().alignment(); -} - -bool DocumentHandler::bold() const -{ - QTextCursor cursor = textCursor(); - if (cursor.isNull()) - return false; - return textCursor().charFormat().fontWeight() == QFont::Bold; -} - -bool DocumentHandler::italic() const -{ - QTextCursor cursor = textCursor(); - if (cursor.isNull()) - return false; - return textCursor().charFormat().fontItalic(); -} - -bool DocumentHandler::underline() const -{ - QTextCursor cursor = textCursor(); - if (cursor.isNull()) - return false; - return textCursor().charFormat().fontUnderline(); -} - -void DocumentHandler::setBold(bool arg) -{ - QTextCharFormat fmt; - fmt.setFontWeight(arg ? QFont::Bold : QFont::Normal); - mergeFormatOnWordOrSelection(fmt); - emit boldChanged(); -} - -void DocumentHandler::setItalic(bool arg) -{ - QTextCharFormat fmt; - fmt.setFontItalic(arg); - mergeFormatOnWordOrSelection(fmt); - emit italicChanged(); -} - -void DocumentHandler::setUnderline(bool arg) -{ - QTextCharFormat fmt; - fmt.setFontUnderline(arg); - mergeFormatOnWordOrSelection(fmt); - emit underlineChanged(); -} - -int DocumentHandler::fontSize() const -{ - QTextCursor cursor = textCursor(); - if (cursor.isNull()) - return 0; - QTextCharFormat format = cursor.charFormat(); - return format.font().pointSize(); -} - -void DocumentHandler::setFontSize(int arg) -{ - QTextCursor cursor = textCursor(); - if (cursor.isNull()) - return; - QTextCharFormat format; - format.setFontPointSize(arg); - mergeFormatOnWordOrSelection(format); - emit fontSizeChanged(); -} - -QColor DocumentHandler::textColor() const -{ - QTextCursor cursor = textCursor(); - if (cursor.isNull()) - return QColor(Qt::black); - QTextCharFormat format = cursor.charFormat(); - return format.foreground().color(); -} - -void DocumentHandler::setTextColor(const QColor &c) -{ - QTextCursor cursor = textCursor(); - if (cursor.isNull()) - return; - QTextCharFormat format; - format.setForeground(QBrush(c)); - mergeFormatOnWordOrSelection(format); - emit textColorChanged(); -} - -QString DocumentHandler::fontFamily() const -{ - QTextCursor cursor = textCursor(); - if (cursor.isNull()) - return QString(); - QTextCharFormat format = cursor.charFormat(); - return format.font().family(); -} - -void DocumentHandler::setFontFamily(const QString &arg) -{ - QTextCursor cursor = textCursor(); - if (cursor.isNull()) - return; - QTextCharFormat format; - format.setFontFamily(arg); - mergeFormatOnWordOrSelection(format); - emit fontFamilyChanged(); -} - -QStringList DocumentHandler::defaultFontSizes() const -{ - // uhm... this is quite ugly - QStringList sizes; - QFontDatabase db; - foreach (int size, db.standardSizes()) - sizes.append(QString::number(size)); - return sizes; -} diff --git a/examples/quick/controls/texteditor/src/documenthandler.h b/examples/quick/controls/texteditor/src/documenthandler.h deleted file mode 100644 index f2bd4eead..000000000 --- a/examples/quick/controls/texteditor/src/documenthandler.h +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - -#ifndef DOCUMENTHANDLER_H -#define DOCUMENTHANDLER_H - -#include <QQuickTextDocument> - -#include <QtGui/QTextCharFormat> -#include <QtCore/QTextCodec> - -#include <qqmlfile.h> - -QT_BEGIN_NAMESPACE -class QTextDocument; -QT_END_NAMESPACE - -class DocumentHandler : public QObject -{ - Q_OBJECT - - Q_ENUMS(HAlignment) - - Q_PROPERTY(QQuickItem *target READ target WRITE setTarget NOTIFY targetChanged) - Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) - Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged) - Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged) - - Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor NOTIFY textColorChanged) - Q_PROPERTY(QString fontFamily READ fontFamily WRITE setFontFamily NOTIFY fontFamilyChanged) - Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) - - Q_PROPERTY(bool bold READ bold WRITE setBold NOTIFY boldChanged) - Q_PROPERTY(bool italic READ italic WRITE setItalic NOTIFY italicChanged) - Q_PROPERTY(bool underline READ underline WRITE setUnderline NOTIFY underlineChanged) - - Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize NOTIFY fontSizeChanged) - - Q_PROPERTY(QStringList defaultFontSizes READ defaultFontSizes NOTIFY defaultFontSizesChanged) - - Q_PROPERTY(QUrl fileUrl READ fileUrl WRITE setFileUrl NOTIFY fileUrlChanged) - Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) - Q_PROPERTY(QString documentTitle READ documentTitle WRITE setDocumentTitle NOTIFY documentTitleChanged) - -public: - DocumentHandler(); - - QQuickItem *target() { return m_target; } - - void setTarget(QQuickItem *target); - - void setCursorPosition(int position); - void setSelectionStart(int position); - void setSelectionEnd(int position); - - int cursorPosition() const { return m_cursorPosition; } - int selectionStart() const { return m_selectionStart; } - int selectionEnd() const { return m_selectionEnd; } - - QString fontFamily() const; - - QColor textColor() const; - - Qt::Alignment alignment() const; - void setAlignment(Qt::Alignment a); - - bool bold() const; - bool italic() const; - bool underline() const; - int fontSize() const; - - QStringList defaultFontSizes() const; - QUrl fileUrl() const; - QString text() const; - - QString documentTitle() const; - -public Q_SLOTS: - void setBold(bool arg); - void setItalic(bool arg); - void setUnderline(bool arg); - void setFontSize(int arg); - void setTextColor(const QColor &arg); - void setFontFamily(const QString &arg); - - void setFileUrl(const QUrl &arg); - void setText(const QString &arg); - void saveAs(const QUrl &arg, const QString &fileType); - - void setDocumentTitle(QString arg); - -Q_SIGNALS: - void targetChanged(); - void cursorPositionChanged(); - void selectionStartChanged(); - void selectionEndChanged(); - - void fontFamilyChanged(); - void textColorChanged(); - void alignmentChanged(); - - void boldChanged(); - void italicChanged(); - void underlineChanged(); - - void fontSizeChanged(); - void defaultFontSizesChanged(); - - void fileUrlChanged(); - - void textChanged(); - void documentTitleChanged(); - void error(QString message); - -private: - void reset(); - QTextCursor textCursor() const; - void mergeFormatOnWordOrSelection(const QTextCharFormat &format); - - QQuickItem *m_target; - QTextDocument *m_doc; - - int m_cursorPosition; - int m_selectionStart; - int m_selectionEnd; - - QFont m_font; - int m_fontSize; - QUrl m_fileUrl; - QString m_text; - QString m_documentTitle; -}; - -#endif diff --git a/examples/quick/controls/texteditor/src/main.cpp b/examples/quick/controls/texteditor/src/main.cpp deleted file mode 100644 index 1ef76e3a0..000000000 --- a/examples/quick/controls/texteditor/src/main.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** 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 "documenthandler.h" -#include <QtQml/QQmlApplicationEngine> - -int main(int argc, char *argv[]) -{ - QtQuickControlsApplication app(argc, argv); - qmlRegisterType<DocumentHandler>("org.qtproject.example", 1, 0, "DocumentHandler"); - QQmlApplicationEngine engine(QUrl("qrc:/qml/main.qml")); - if (engine.rootObjects().isEmpty()) - return -1; - return app.exec(); -} diff --git a/examples/quick/controls/texteditor/src/src.pri b/examples/quick/controls/texteditor/src/src.pri deleted file mode 100644 index 2b89cd629..000000000 --- a/examples/quick/controls/texteditor/src/src.pri +++ /dev/null @@ -1,9 +0,0 @@ -SOURCES += \ - $$PWD/documenthandler.cpp \ - $$PWD/main.cpp - - -HEADERS += \ - $$PWD/documenthandler.h - - diff --git a/examples/quick/controls/texteditor/texteditor.pro b/examples/quick/controls/texteditor/texteditor.pro deleted file mode 100644 index ec9d8d863..000000000 --- a/examples/quick/controls/texteditor/texteditor.pro +++ /dev/null @@ -1,13 +0,0 @@ -QT += qml quick -TARGET = texteditor -!no_desktop: QT += widgets - -include(src/src.pri) -include(../shared/shared.pri) - -OTHER_FILES += \ - qml/main.qml \ - qml/ToolBarSeparator.qml - -RESOURCES += \ - resources.qrc diff --git a/examples/quick/controls/touch/content/AndroidDelegate.qml b/examples/quick/controls/touch/content/AndroidDelegate.qml deleted file mode 100644 index 07f288337..000000000 --- a/examples/quick/controls/touch/content/AndroidDelegate.qml +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** 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 - -Item { - id: root - width: parent.width - height: 88 - - property alias text: textitem.text - signal clicked - - Rectangle { - anchors.fill: parent - color: "#11ffffff" - visible: mouse.pressed - } - - Text { - id: textitem - color: "white" - font.pixelSize: 32 - text: modelData - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: 30 - } - - Rectangle { - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: 15 - height: 1 - color: "#424246" - } - - Image { - anchors.right: parent.right - anchors.rightMargin: 20 - anchors.verticalCenter: parent.verticalCenter - source: "../images/navigation_next_item.png" - } - - MouseArea { - id: mouse - anchors.fill: parent - onClicked: root.clicked() - - } -} diff --git a/examples/quick/controls/touch/content/ButtonPage.qml b/examples/quick/controls/touch/content/ButtonPage.qml deleted file mode 100644 index 3888e30d5..000000000 --- a/examples/quick/controls/touch/content/ButtonPage.qml +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** -** -** 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.Controls 1.2 -import QtQuick.Controls.Styles 1.1 - -Item { - width: parent.width - height: parent.height - - property real progress: 0 - SequentialAnimation on progress { - loops: Animation.Infinite - running: true - NumberAnimation { - from: 0 - to: 1 - duration: 3000 - } - NumberAnimation { - from: 1 - to: 0 - duration: 3000 - } - } - - Column { - spacing: 40 - anchors.centerIn: parent - - Button { - text: "Press me" - style: touchStyle - } - - Button { - style: touchStyle - text: "Press me too" - } - - Button { - anchors.margins: 20 - style: touchStyle - text: "Don't press me" - onClicked: if (stackView) stackView.pop() - } - - Row { - spacing: 20 - Switch { - style: switchStyle - } - Switch { - style: switchStyle - } - } - - } - - Component { - id: touchStyle - ButtonStyle { - panel: Item { - implicitHeight: 50 - implicitWidth: 320 - BorderImage { - anchors.fill: parent - antialiasing: true - border.bottom: 8 - border.top: 8 - border.left: 8 - border.right: 8 - anchors.margins: control.pressed ? -4 : 0 - source: control.pressed ? "../images/button_pressed.png" : "../images/button_default.png" - Text { - text: control.text - anchors.centerIn: parent - color: "white" - font.pixelSize: 23 - renderType: Text.NativeRendering - } - } - } - } - } - - Component { - id: switchStyle - SwitchStyle { - - groove: Rectangle { - implicitHeight: 50 - implicitWidth: 152 - Rectangle { - anchors.top: parent.top - anchors.left: parent.left - anchors.bottom: parent.bottom - width: parent.width/2 - 2 - height: 20 - anchors.margins: 2 - color: control.checked ? "#468bb7" : "#222" - Behavior on color {ColorAnimation {}} - Text { - font.pixelSize: 23 - color: "white" - anchors.centerIn: parent - text: "ON" - } - } - Item { - width: parent.width/2 - height: parent.height - anchors.right: parent.right - Text { - font.pixelSize: 23 - color: "white" - anchors.centerIn: parent - text: "OFF" - } - } - color: "#222" - border.color: "#444" - border.width: 2 - } - handle: Rectangle { - width: parent.parent.width/2 - height: control.height - color: "#444" - border.color: "#555" - border.width: 2 - } - } - } -} diff --git a/examples/quick/controls/touch/content/ListPage.qml b/examples/quick/controls/touch/content/ListPage.qml deleted file mode 100644 index f12b0c12b..000000000 --- a/examples/quick/controls/touch/content/ListPage.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** 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.Controls 1.2 -import QtQuick.Controls.Styles 1.1 - -ScrollView { - width: parent.width - height: parent.height - - flickableItem.interactive: true - - ListView { - anchors.fill: parent - model: 100 - delegate: AndroidDelegate { - text: "Item #" + modelData - } - } - - style: ScrollViewStyle { - transientScrollBars: true - handle: Item { - implicitWidth: 14 - implicitHeight: 26 - Rectangle { - color: "#424246" - anchors.fill: parent - anchors.topMargin: 6 - anchors.leftMargin: 4 - anchors.rightMargin: 4 - anchors.bottomMargin: 6 - } - } - scrollBarBackground: Item { - implicitWidth: 14 - implicitHeight: 26 - } - } -} diff --git a/examples/quick/controls/touch/content/ProgressBarPage.qml b/examples/quick/controls/touch/content/ProgressBarPage.qml deleted file mode 100644 index 5190b4bba..000000000 --- a/examples/quick/controls/touch/content/ProgressBarPage.qml +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** 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.Controls 1.2 -import QtQuick.Controls.Styles 1.1 - -Item { - width: parent.width - height: parent.height - - property real progress: 0 - SequentialAnimation on progress { - loops: Animation.Infinite - running: true - NumberAnimation { - from: 0 - to: 1 - duration: 3000 - } - NumberAnimation { - from: 1 - to: 0 - duration: 3000 - } - } - - Column { - spacing: 40 - anchors.centerIn: parent - - ProgressBar { - anchors.margins: 20 - style: touchStyle - width: 400 - value: progress - } - - ProgressBar { - anchors.margins: 20 - style: touchStyle - width: 400 - value: 1 - progress - } - - ProgressBar { - anchors.margins: 20 - style: touchStyle - value: 1 - width: 400 - } - - } - - Component { - id: touchStyle - ProgressBarStyle { - panel: Rectangle { - implicitHeight: 15 - implicitWidth: 400 - color: "#444" - opacity: 0.8 - Rectangle { - antialiasing: true - radius: 1 - color: "#468bb7" - height: parent.height - width: parent.width * control.value / control.maximumValue - } - } - } - } -} diff --git a/examples/quick/controls/touch/content/SliderPage.qml b/examples/quick/controls/touch/content/SliderPage.qml deleted file mode 100644 index 4f4e2ee82..000000000 --- a/examples/quick/controls/touch/content/SliderPage.qml +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -** -** 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.Controls 1.2 -import QtQuick.Controls.Styles 1.1 - -Item { - width: parent.width - height: parent.height - - Column { - spacing: 12 - anchors.centerIn: parent - - Slider { - anchors.margins: 20 - style: touchStyle - value: 0 - } - Slider { - anchors.margins: 20 - style: touchStyle - value: 0.5 - } - Slider { - anchors.margins: 20 - style: touchStyle - value: 1.0 - } - - } - - Component { - id: touchStyle - SliderStyle { - handle: Rectangle { - width: 30 - height: 30 - radius: height - antialiasing: true - color: Qt.lighter("#468bb7", 1.2) - } - - groove: Item { - implicitHeight: 50 - implicitWidth: 400 - Rectangle { - height: 8 - width: parent.width - anchors.verticalCenter: parent.verticalCenter - color: "#444" - opacity: 0.8 - Rectangle { - antialiasing: true - radius: 1 - color: "#468bb7" - height: parent.height - width: parent.width * control.value / control.maximumValue - } - } - } - } - } -} diff --git a/examples/quick/controls/touch/content/TabBarPage.qml b/examples/quick/controls/touch/content/TabBarPage.qml deleted file mode 100644 index a27bb2069..000000000 --- a/examples/quick/controls/touch/content/TabBarPage.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** 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.Controls 1.2 -import QtQuick.Controls.Styles 1.1 - -Item { - width: parent.width - height: parent.height - - TabView { - anchors.fill: parent - style: touchStyle - Tab { - title: "Buttons" - ButtonPage{ visible: true } - } - Tab { - title: "Sliders" - SliderPage{ visible: true } - } - Tab { - title: "Progress" - ProgressBarPage{ visible: true } - } - } - - Component { - id: touchStyle - TabViewStyle { - tabsAlignment: Qt.AlignVCenter - tabOverlap: 0 - frame: Item { } - tab: Item { - implicitWidth: control.width/control.count - implicitHeight: 50 - BorderImage { - anchors.fill: parent - border.bottom: 8 - border.top: 8 - source: styleData.selected ? "../images/tab_selected.png":"../images/tabs_standard.png" - Text { - anchors.centerIn: parent - color: "white" - text: styleData.title.toUpperCase() - font.pixelSize: 16 - } - Rectangle { - visible: index > 0 - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.margins: 10 - width:1 - color: "#3a3a3a" - } - } - } - } - } -} diff --git a/examples/quick/controls/touch/content/TextInputPage.qml b/examples/quick/controls/touch/content/TextInputPage.qml deleted file mode 100644 index 3c4dc4ade..000000000 --- a/examples/quick/controls/touch/content/TextInputPage.qml +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -** -** 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.Controls 1.2 -import QtQuick.Controls.Styles 1.1 - -Item { - width: parent.width - height: parent.height - - property real progress: 0 - SequentialAnimation on progress { - loops: Animation.Infinite - running: true - NumberAnimation { - from: 0 - to: 1 - duration: 3000 - } - NumberAnimation { - from: 1 - to: 0 - duration: 3000 - } - } - - Column { - spacing: 40 - anchors.centerIn: parent - - TextField { - anchors.margins: 20 - text: "Text input" - style: touchStyle - } - - TextField { - anchors.margins: 20 - text: "Readonly Text input" - style: touchStyle - readOnly: true - } - } - Component { - id: touchStyle - - TextFieldStyle { - textColor: "white" - font.pixelSize: 28 - background: Item { - implicitHeight: 50 - implicitWidth: 320 - BorderImage { - source: "../images/textinput.png" - border.left: 8 - border.right: 8 - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - } - } - } - } -} diff --git a/examples/quick/controls/touch/images/NOTICE.txt b/examples/quick/controls/touch/images/NOTICE.txt deleted file mode 100644 index 93a9afc8c..000000000 --- a/examples/quick/controls/touch/images/NOTICE.txt +++ /dev/null @@ -1,2 +0,0 @@ -Notice some of these images are derived from Google applications resources. They were provided under the following license: -You may use the materials in this directory without restriction to develop your apps and to use in your apps. diff --git a/examples/quick/controls/touch/images/button_default.png b/examples/quick/controls/touch/images/button_default.png Binary files differdeleted file mode 100644 index 6d6cfd9ad..000000000 --- a/examples/quick/controls/touch/images/button_default.png +++ /dev/null diff --git a/examples/quick/controls/touch/images/button_pressed.png b/examples/quick/controls/touch/images/button_pressed.png Binary files differdeleted file mode 100644 index ab78b6ea3..000000000 --- a/examples/quick/controls/touch/images/button_pressed.png +++ /dev/null diff --git a/examples/quick/controls/touch/images/navigation_next_item.png b/examples/quick/controls/touch/images/navigation_next_item.png Binary files differdeleted file mode 100644 index 6665c9d85..000000000 --- a/examples/quick/controls/touch/images/navigation_next_item.png +++ /dev/null diff --git a/examples/quick/controls/touch/images/navigation_previous_item.png b/examples/quick/controls/touch/images/navigation_previous_item.png Binary files differdeleted file mode 100644 index f8be01197..000000000 --- a/examples/quick/controls/touch/images/navigation_previous_item.png +++ /dev/null diff --git a/examples/quick/controls/touch/images/tab_selected.png b/examples/quick/controls/touch/images/tab_selected.png Binary files differdeleted file mode 100644 index 2345f7a8e..000000000 --- a/examples/quick/controls/touch/images/tab_selected.png +++ /dev/null diff --git a/examples/quick/controls/touch/images/tabs_standard.png b/examples/quick/controls/touch/images/tabs_standard.png Binary files differdeleted file mode 100644 index 7140ab7b7..000000000 --- a/examples/quick/controls/touch/images/tabs_standard.png +++ /dev/null diff --git a/examples/quick/controls/touch/images/textinput.png b/examples/quick/controls/touch/images/textinput.png Binary files differdeleted file mode 100644 index b0256db2c..000000000 --- a/examples/quick/controls/touch/images/textinput.png +++ /dev/null diff --git a/examples/quick/controls/touch/images/toolbar.png b/examples/quick/controls/touch/images/toolbar.png Binary files differdeleted file mode 100644 index e9eba4c74..000000000 --- a/examples/quick/controls/touch/images/toolbar.png +++ /dev/null diff --git a/examples/quick/controls/touch/main.qml b/examples/quick/controls/touch/main.qml deleted file mode 100644 index 5138fa0ca..000000000 --- a/examples/quick/controls/touch/main.qml +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** 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.Controls 1.2 -import "content" - -ApplicationWindow { - visible: true - width: 800 - height: 1280 - - Rectangle { - color: "#212126" - anchors.fill: parent - } - - toolBar: BorderImage { - border.bottom: 8 - source: "images/toolbar.png" - width: parent.width - height: 100 - - Rectangle { - id: backButton - width: opacity ? 60 : 0 - anchors.left: parent.left - anchors.leftMargin: 20 - opacity: stackView.depth > 1 ? 1 : 0 - anchors.verticalCenter: parent.verticalCenter - antialiasing: true - height: 60 - radius: 4 - color: backmouse.pressed ? "#222" : "transparent" - Behavior on opacity { NumberAnimation{} } - Image { - anchors.verticalCenter: parent.verticalCenter - source: "images/navigation_previous_item.png" - } - MouseArea { - id: backmouse - anchors.fill: parent - anchors.margins: -10 - onClicked: stackView.pop() - } - } - - Text { - font.pixelSize: 42 - Behavior on x { NumberAnimation{ easing.type: Easing.OutCubic} } - x: backButton.x + backButton.width + 20 - anchors.verticalCenter: parent.verticalCenter - color: "white" - text: "Widget Gallery" - } - } - - ListModel { - id: pageModel - ListElement { - title: "Buttons" - page: "content/ButtonPage.qml" - } - ListElement { - title: "Sliders" - page: "content/SliderPage.qml" - } - ListElement { - title: "ProgressBar" - page: "content/ProgressBarPage.qml" - } - ListElement { - title: "Tabs" - page: "content/TabBarPage.qml" - } - ListElement { - title: "TextInput" - page: "content/TextInputPage.qml" - } - ListElement { - title: "List" - page: "content/ListPage.qml" - } - } - - StackView { - id: stackView - anchors.fill: parent - // Implements back key navigation - focus: true - Keys.onReleased: if (event.key === Qt.Key_Back && stackView.depth > 1) { - stackView.pop(); - event.accepted = true; - } - - initialItem: Item { - width: parent.width - height: parent.height - ListView { - model: pageModel - anchors.fill: parent - delegate: AndroidDelegate { - text: title - onClicked: stackView.push(Qt.resolvedUrl(page)) - } - } - } - } - -} diff --git a/examples/quick/controls/touch/resources.qrc b/examples/quick/controls/touch/resources.qrc deleted file mode 100644 index e64a063f1..000000000 --- a/examples/quick/controls/touch/resources.qrc +++ /dev/null @@ -1,20 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource prefix="/"> - <file>main.qml</file> - <file>content/AndroidDelegate.qml</file> - <file>content/ButtonPage.qml</file> - <file>content/ListPage.qml</file> - <file>content/ProgressBarPage.qml</file> - <file>content/SliderPage.qml</file> - <file>content/TabBarPage.qml</file> - <file>content/TextInputPage.qml</file> - <file>images/button_default.png</file> - <file>images/button_pressed.png</file> - <file>images/navigation_next_item.png</file> - <file>images/navigation_previous_item.png</file> - <file>images/tab_selected.png</file> - <file>images/tabs_standard.png</file> - <file>images/textinput.png</file> - <file>images/toolbar.png</file> -</qresource> -</RCC> diff --git a/examples/quick/controls/touch/src/main.cpp b/examples/quick/controls/touch/src/main.cpp deleted file mode 100644 index e66387f7b..000000000 --- a/examples/quick/controls/touch/src/main.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** 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/QQmlApplicationEngine> - -int main(int argc, char *argv[]) -{ - QtQuickControlsApplication app(argc, argv); - QQmlApplicationEngine engine(QUrl("qrc:/main.qml")); - if (engine.rootObjects().isEmpty()) - return -1; - return app.exec(); -} diff --git a/examples/quick/controls/touch/src/src.pri b/examples/quick/controls/touch/src/src.pri deleted file mode 100644 index 66d903eac..000000000 --- a/examples/quick/controls/touch/src/src.pri +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES += \ - $$PWD/main.cpp diff --git a/examples/quick/controls/touch/touch.pro b/examples/quick/controls/touch/touch.pro deleted file mode 100644 index 63902f81b..000000000 --- a/examples/quick/controls/touch/touch.pro +++ /dev/null @@ -1,19 +0,0 @@ -QT += qml quick -TARGET = touch -!no_desktop: QT += widgets - -include(src/src.pri) -include(../shared/shared.pri) - -OTHER_FILES += \ - main.qml \ - content/AndroidDelegate.qml \ - content/ButtonPage.qml \ - content/ListPage.qml \ - content/ProgressBarPage.qml \ - content/SliderPage.qml \ - content/TabBarPage.qml \ - content/TextInputPage.qml - -RESOURCES += \ - resources.qrc diff --git a/examples/quick/controls/touch/touch.qmlproject b/examples/quick/controls/touch/touch.qmlproject deleted file mode 100644 index e5a8bf02c..000000000 --- a/examples/quick/controls/touch/touch.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/controls/uiforms/MainForm.ui.qml b/examples/quick/controls/uiforms/MainForm.ui.qml deleted file mode 100644 index 4649209f4..000000000 --- a/examples/quick/controls/uiforms/MainForm.ui.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 6a15842a9..000000000 --- a/examples/quick/controls/uiforms/main.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** 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")); - if (engine.rootObjects().isEmpty()) - return -1; - return app.exec(); -} diff --git a/examples/quick/controls/uiforms/main.qml b/examples/quick/controls/uiforms/main.qml deleted file mode 100644 index da2580225..000000000 --- a/examples/quick/controls/uiforms/main.qml +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 70a9695dd..000000000 --- a/examples/quick/controls/uiforms/qml/CustomerModel.qml +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** -** -** 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: "[email protected]" - 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: "[email protected]" - 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: "[email protected]" - 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: "[email protected]" - 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: "[email protected]" - 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: "[email protected]" - 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: "[email protected]" - 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 deleted file mode 100644 index 336d717ff..000000000 --- a/examples/quick/controls/uiforms/qml/History.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 9445b12fb..000000000 --- a/examples/quick/controls/uiforms/qml/HistoryForm.ui.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index af506af31..000000000 --- a/examples/quick/controls/uiforms/qml/Notes.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 9552afcd0..000000000 --- a/examples/quick/controls/uiforms/qml/NotesForm.ui.qml +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 658c62d3c..000000000 --- a/examples/quick/controls/uiforms/qml/Settings.qml +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 5cafe0e7a..000000000 --- a/examples/quick/controls/uiforms/qml/SettingsForm.ui.qml +++ /dev/null @@ -1,259 +0,0 @@ -/**************************************************************************** -** -** 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 deleted file mode 100644 index 08b3d0c4a..000000000 --- a/examples/quick/controls/uiforms/uiforms.pro +++ /dev/null @@ -1,21 +0,0 @@ -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 deleted file mode 100644 index 447bb039d..000000000 --- a/examples/quick/controls/uiforms/uiforms.qrc +++ /dev/null @@ -1,13 +0,0 @@ -<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> |