aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2015-11-27 09:36:00 +0100
committerMitch Curtis <mitch.curtis@theqtcompany.com>2015-11-27 11:36:53 +0000
commit94d33a6875f0b159f46841fb2d45bcda48522a91 (patch)
tree767397ce8bee19b662271f099440312e70a17549 /examples
parent3208d08f6210c68ad8c48f2e3515ac1a7672a48b (diff)
Remove all examples
The current examples were temporary until we started working on proper ones, which we've recently begun doing. Change-Id: I418e5e9604f0b57a33b56dc3aa6ec1cba5c3f791 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/examples.pro3
-rw-r--r--examples/labs/calendar/DateTimePicker.qml175
-rw-r--r--examples/labs/calendar/EventView.qml209
-rw-r--r--examples/labs/calendar/TumblerDelegate.qml54
-rw-r--r--examples/labs/calendar/calendar.pro19
-rw-r--r--examples/labs/calendar/calendar.qrc8
-rw-r--r--examples/labs/calendar/main.cpp233
-rw-r--r--examples/labs/calendar/main.qml220
-rw-r--r--examples/labs/controls/controls.pro9
-rw-r--r--examples/labs/controls/drawer/drawer.pro15
-rw-r--r--examples/labs/controls/drawer/drawer.qrc7
-rw-r--r--examples/labs/controls/drawer/images/arrow.pngbin2446 -> 0 bytes
-rw-r--r--examples/labs/controls/drawer/images/qt-logo.pngbin21710 -> 0 bytes
-rw-r--r--examples/labs/controls/drawer/main.cpp52
-rw-r--r--examples/labs/controls/drawer/main.qml157
-rw-r--r--examples/labs/controls/mirroring/main.cpp52
-rw-r--r--examples/labs/controls/mirroring/main.qml237
-rw-r--r--examples/labs/controls/mirroring/mirroring.pro15
-rw-r--r--examples/labs/controls/mirroring/mirroring.qrc5
-rw-r--r--examples/labs/controls/tabs/images/qt-logo.pngbin21710 -> 0 bytes
-rw-r--r--examples/labs/controls/tabs/main.cpp52
-rw-r--r--examples/labs/controls/tabs/main.qml290
-rw-r--r--examples/labs/controls/tabs/tabs.pro15
-rw-r--r--examples/labs/controls/tabs/tabs.qrc6
-rw-r--r--examples/labs/controls/theme/main.cpp52
-rw-r--r--examples/labs/controls/theme/main.qml174
-rw-r--r--examples/labs/controls/theme/theme.pro15
-rw-r--r--examples/labs/controls/theme/theme.qrc5
-rw-r--r--examples/labs/labs.pro4
29 files changed, 0 insertions, 2083 deletions
diff --git a/examples/examples.pro b/examples/examples.pro
deleted file mode 100644
index 29810159..00000000
--- a/examples/examples.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += \
- labs
diff --git a/examples/labs/calendar/DateTimePicker.qml b/examples/labs/calendar/DateTimePicker.qml
deleted file mode 100644
index 091cf267..00000000
--- a/examples/labs/calendar/DateTimePicker.qml
+++ /dev/null
@@ -1,175 +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.6
-import Qt.labs.calendar 1.0
-import Qt.labs.controls 1.0
-
-Item {
- id: dateTimePicker
- enabled: dateToShow.getFullYear() >= fromYear || dateToShow.getFullYear() <= toYear
- implicitWidth: row.implicitWidth
- implicitHeight: row.implicitHeight
-
- readonly property var days: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
-
- readonly property int fromYear: 2000
- readonly property int toYear: 2020
-
- readonly property alias chosenDate: dateTimePicker.__date
- property var __date: new Date(
- fromYear + yearTumbler.currentIndex,
- monthTumbler.currentIndex,
- dayTumbler.currentIndex + 1,
- hoursTumbler.currentIndex + (amPmTumbler.currentIndex == 0 ? 0 : 12),
- minutesTumbler.currentIndex);
-
- property date dateToShow: new Date()
- onDateToShowChanged: {
- yearTumbler.currentIndex = dateToShow.getFullYear() - fromYear;
- monthTumbler.currentIndex = dateToShow.getMonth();
- dayTumbler.currentIndex = dateToShow.getDate() - 1;
- }
-
- FontMetrics {
- id: fontMetrics
- }
-
- Row {
- id: row
- spacing: 2
-
- Frame {
- padding: 0
-
- Row {
- Tumbler {
- id: dayTumbler
-
- delegate: TumblerDelegate {
- text: modelData
- font.pixelSize: fontMetrics.font.pixelSize * (Tumbler.tumbler.activeFocus ? 2 : 1.25)
- }
-
- function updateModel() {
- var previousIndex = dayTumbler.currentIndex;
- var array = [];
- var newDays = dateTimePicker.days[monthTumbler.currentIndex];
- for (var i = 0; i < newDays; ++i) {
- array.push(i + 1);
- }
- dayTumbler.model = array;
- dayTumbler.currentIndex = Math.min(newDays - 1, previousIndex);
- }
-
- Component.onCompleted: updateModel()
- }
- Tumbler {
- id: monthTumbler
- model: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
- delegate: TumblerDelegate {
- text: modelData
- font.pixelSize: fontMetrics.font.pixelSize * (Tumbler.tumbler.activeFocus ? 2 : 1.25)
- }
- onCurrentIndexChanged: dayTumbler.updateModel()
- }
- Tumbler {
- id: yearTumbler
- width: 80
- model: {
- var years = [];
- for (var i = fromYear; i <= toYear; ++i) {
- years.push(i);
- }
- return years;
- }
- delegate: TumblerDelegate {
- text: modelData
- font.pixelSize: fontMetrics.font.pixelSize * (Tumbler.tumbler.activeFocus ? 2 : 1.25)
- }
- }
- }
- }
-
- Frame {
- padding: 0
-
- Row {
- Tumbler {
- id: hoursTumbler
- model: 12
- delegate: TumblerDelegate {
- text: modelData.toString().length < 2 ? "0" + modelData : modelData
- font.pixelSize: fontMetrics.font.pixelSize * (Tumbler.tumbler.activeFocus ? 2 : 1.25)
- }
- }
-
- Tumbler {
- id: minutesTumbler
- model: 60
- delegate: TumblerDelegate {
- text: modelData.toString().length < 2 ? "0" + modelData : modelData
- font.pixelSize: fontMetrics.font.pixelSize * (Tumbler.tumbler.activeFocus ? 2 : 1.25)
- }
- }
-
- Tumbler {
- id: amPmTumbler
- model: ["AM", "PM"]
- delegate: TumblerDelegate {
- font.pixelSize: fontMetrics.font.pixelSize * (Tumbler.tumbler.activeFocus ? 2 : 1.25)
- }
-
- contentItem: ListView {
- anchors.fill: parent
- model: amPmTumbler.model
- delegate: amPmTumbler.delegate
-
- snapMode: ListView.SnapToItem
- highlightRangeMode: ListView.StrictlyEnforceRange
- preferredHighlightBegin: height / 2 - (height / 3 / 2)
- preferredHighlightEnd: height / 2 + (height / 3 / 2)
- clip: true
- }
- }
- }
- }
- }
-}
diff --git a/examples/labs/calendar/EventView.qml b/examples/labs/calendar/EventView.qml
deleted file mode 100644
index e47e7486..00000000
--- a/examples/labs/calendar/EventView.qml
+++ /dev/null
@@ -1,209 +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.6
-import Qt.labs.controls 1.0
-
-Rectangle {
- border.color: Theme.frameColor
-
- property date selectedDate
- property var locale
- property var eventModel
-
- signal addEventClicked
-
- Component {
- id: eventListHeader
-
- Row {
- id: eventDateRow
- width: parent.width
- height: eventDayLabel.height
- spacing: 10
-
- Label {
- id: eventDayLabel
- text: selectedDate.getDate()
- font.pointSize: 35
- }
-
- Column {
- height: eventDayLabel.height
-
- Label {
- readonly property var options: { weekday: "long" }
- text: Qt.locale().standaloneDayName(selectedDate.getDay(), Locale.LongFormat)
- font.pointSize: 18
- }
- Label {
- text: Qt.locale().standaloneMonthName(selectedDate.getMonth())
- + selectedDate.toLocaleDateString(Qt.locale(), " yyyy")
- font.pointSize: 12
- }
- }
- }
- }
-
- ListView {
- id: eventsListView
- spacing: 4
- clip: true
- header: eventListHeader
- anchors.fill: parent
- anchors.margins: 10
- model: eventModel
-
- delegate: Rectangle {
- width: eventsListView.width
- height: eventItemColumn.height
- anchors.horizontalCenter: parent.horizontalCenter
-
- Rectangle {
- width: parent.width
- height: 1
- color: "#eee"
- }
-
- Column {
- id: eventItemColumn
- x: 4
- y: 4
- width: parent.width - 8
- height: timeRow.height + descriptionLabel.height + 8
-
- Label {
- id: descriptionLabel
- width: parent.width
- wrapMode: Text.Wrap
- text: description
- }
- Row {
- id: timeRow
- width: parent.width
- Label {
- text: start.toLocaleTimeString(locale, Locale.ShortFormat)
- color: "#aaa"
- }
- Label {
- text: "-" + end.toLocaleTimeString(locale, Locale.ShortFormat)
- visible: start.getTime() !== end.getTime() && start.getDate() === end.getDate()
- color: "#aaa"
- }
- }
- }
-
- MouseArea {
- anchors.fill: parent
- onPressAndHold: removeButton.opacity = 1
- onClicked: removeButton.opacity = 0
- }
-
- Button {
- id: removeButton
- opacity: 0
-
- Behavior on opacity {
- NumberAnimation {
- duration: 150
- }
- }
-
- anchors.right: parent.right
- anchors.rightMargin: 12
- anchors.verticalCenter: parent.verticalCenter
-
- onClicked: eventModel.removeEvent(index)
-
- background: Rectangle {
- implicitWidth: 32
- implicitHeight: 32
-
- radius: width / 2
- color: Qt.tint(!addButton.enabled ? addButton.Theme.disabledColor :
- addButton.activeFocus ? addButton.Theme.focusColor : "red",
- addButton.pressed ? addButton.Theme.pressColor : "transparent")
- }
- }
-
- // Don't want the white icon to change opacity.
- Rectangle {
- anchors.centerIn: removeButton
- width: 18
- height: 4
- radius: 1
- }
- }
- }
-
- Button {
- id: addButton
-
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- anchors.margins: 12
-
- onClicked: addEventClicked()
-
- background: Rectangle {
- implicitWidth: 32
- implicitHeight: 32
-
- radius: width / 2
- color: Qt.tint(!addButton.enabled ? addButton.Theme.disabledColor :
- addButton.activeFocus ? addButton.Theme.focusColor : addButton.Theme.accentColor,
- addButton.pressed ? addButton.Theme.pressColor : "transparent")
- }
-
- Rectangle {
- anchors.centerIn: parent
- width: 4
- height: 18
- radius: 1
- }
-
- Rectangle {
- anchors.centerIn: parent
- width: 18
- height: 4
- radius: 1
- }
- }
-}
diff --git a/examples/labs/calendar/TumblerDelegate.qml b/examples/labs/calendar/TumblerDelegate.qml
deleted file mode 100644
index e379e8c0..00000000
--- a/examples/labs/calendar/TumblerDelegate.qml
+++ /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$
-**
-****************************************************************************/
-
-import QtQuick 2.6
-import Qt.labs.controls 1.0
-
-Text {
- text: isNaN(modelData) ? modelData : modelData + 1
- color: "#666666"
- opacity: 0.4 + Math.max(0, 1 - Math.abs(Tumbler.displacement)) * 0.6
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
-
- Behavior on font.pixelSize {
- NumberAnimation {}
- }
-}
diff --git a/examples/labs/calendar/calendar.pro b/examples/labs/calendar/calendar.pro
deleted file mode 100644
index 9ee101b7..00000000
--- a/examples/labs/calendar/calendar.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-TEMPLATE = app
-TARGET = calendar
-QT += quick sql
-
-SOURCES += \
- main.cpp
-
-OTHER_FILES += \
- main.qml
-
-RESOURCES += \
- calendar.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/labs/calendar/calendar
-INSTALLS += target
-
-DISTFILES += \
- DateTimePicker.qml \
- EventView.qml
diff --git a/examples/labs/calendar/calendar.qrc b/examples/labs/calendar/calendar.qrc
deleted file mode 100644
index d0f67b26..00000000
--- a/examples/labs/calendar/calendar.qrc
+++ /dev/null
@@ -1,8 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>main.qml</file>
- <file>DateTimePicker.qml</file>
- <file>TumblerDelegate.qml</file>
- <file>EventView.qml</file>
- </qresource>
-</RCC>
diff --git a/examples/labs/calendar/main.cpp b/examples/labs/calendar/main.cpp
deleted file mode 100644
index 651a51ec..00000000
--- a/examples/labs/calendar/main.cpp
+++ /dev/null
@@ -1,233 +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 <QtGui>
-#include <QtQml>
-#include <QtSql>
-
-class Event : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString description MEMBER description NOTIFY descriptionChanged)
- Q_PROPERTY(QDateTime start MEMBER start NOTIFY startChanged)
- Q_PROPERTY(QDateTime end MEMBER end NOTIFY endChanged)
-
-public:
- explicit Event(const QString &description, QObject *parent = 0) :
- QObject(parent),
- description(description)
- {
-
- }
-
- QString description;
- QDateTime start;
- QDateTime end;
-
-signals:
- void descriptionChanged();
- void startChanged();
- void endChanged();
-};
-
-static void addEvent(const QString &description, const QDateTime &start, qint64 duration = 0)
-{
- QSqlQuery query;
- QDateTime end = start.addSecs(duration);
- if (!query.exec(QStringLiteral("INSERT INTO Event (description, start, end) VALUES ('%1', %2, %3)")
- .arg(description).arg(start.toMSecsSinceEpoch()).arg(end.toMSecsSinceEpoch()))) {
- qWarning() << query.lastError();
- }
-}
-
-// create an in-memory SQLITE database
-static void createDatabase()
-{
- QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
- db.setDatabaseName(":memory:");
- if (!db.open()) {
- qFatal("Cannot open database");
- return;
- }
-
- QSqlQuery query;
- query.exec("CREATE TABLE IF NOT EXISTS Event (description TEXT, start BIGINT, end BIGINT)");
-
- const QDate current = QDate::currentDate();
- addEvent("Job interview", QDateTime(current.addDays(-19), QTime(12, 0)));
- addEvent("Grocery shopping", QDateTime(current.addDays(-14), QTime(18, 0)));
- addEvent("Ice skating", QDateTime(current.addDays(-14), QTime(20, 0)), 5400);
- addEvent("Dentist''s appointment", QDateTime(current.addDays(-8), QTime(14, 0)), 1800);
- addEvent("Cross-country skiing", QDateTime(current.addDays(1), QTime(19, 30)), 3600);
- addEvent("Conference", QDateTime(current.addDays(10), QTime(9, 0)), 432000);
- addEvent("Hairdresser", QDateTime(current.addDays(19), QTime(13, 0)));
- addEvent("Doctor''s appointment", QDateTime(current.addDays(21), QTime(16, 0)));
- addEvent("Vacation", QDateTime(current.addDays(35), QTime(0, 0)), 604800);
-}
-
-class SqlEventModel : public QSqlTableModel
-{
- Q_OBJECT
- Q_PROPERTY(QDate min READ min CONSTANT)
- Q_PROPERTY(QDate max READ max CONSTANT)
- Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY dateChanged FINAL)
- Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged)
-
-public:
- SqlEventModel(QObject *parent = 0) :
- QSqlTableModel(parent, QSqlDatabase::database(":memory:"))
- {
- connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(rowCountChanged()));
- connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(rowCountChanged()));
-
- setTable("Event");
- setEditStrategy(QSqlTableModel::OnManualSubmit);
- select();
-
- setDate(QDate::currentDate());
- }
-
- QDate min() const
- {
- QSqlQuery query(QStringLiteral("SELECT MIN(start) FROM Event"));
- if (query.next())
- return QDateTime::fromMSecsSinceEpoch(query.value(0).toLongLong()).date();
- return QDate();
- }
-
- QDate max() const
- {
- QSqlQuery query(QStringLiteral("SELECT MAX(end) FROM Event"));
- if (query.next())
- return QDateTime::fromMSecsSinceEpoch(query.value(0).toLongLong()).date();
- return QDate();
- }
-
- QDate date() const
- {
- return mDate;
- }
-
- void setDate(const QDate &date)
- {
- if (date != mDate) {
- mDate = date;
-
- qint64 from = QDateTime(mDate, QTime(0, 0)).toMSecsSinceEpoch();
- qint64 to = QDateTime(mDate, QTime(23, 59)).toMSecsSinceEpoch();
-
- setFilter(QStringLiteral("start <= %1 AND end >= %2").arg(to).arg(from));
-
- emit dateChanged();
- }
- }
-
- enum {
- DescriptionRole = Qt::UserRole,
- StartDateRole,
- EndDateRole
- };
-
- QHash<int,QByteArray> roleNames() const Q_DECL_OVERRIDE
- {
- QHash<int,QByteArray> names;
- names[DescriptionRole] = "description";
- names[StartDateRole] = "start";
- names[EndDateRole] = "end";
- return names;
- }
-
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE
- {
- if (role < Qt::UserRole)
- return QSqlTableModel::data(index, role);
-
- int columnIndex = role - DescriptionRole;
- QModelIndex modelIndex = this->index(index.row(), columnIndex);
- QVariant eventData = QSqlTableModel::data(modelIndex, Qt::DisplayRole);
- if (role == DescriptionRole)
- return eventData;
-
- return QDateTime::fromMSecsSinceEpoch(eventData.toLongLong());
- }
-
- Q_INVOKABLE void addEvent(const QString &description, const QDateTime &date)
- {
- const int row = rowCount();
- insertRows(row, 1);
- setData(index(row, 0), description);
- setData(index(row, 1), date.toMSecsSinceEpoch());
- setData(index(row, 2), date.toMSecsSinceEpoch());
- submitAll();
- }
-
- Q_INVOKABLE void removeEvent(int modelRow)
- {
- if (modelRow < 0 || modelRow >= rowCount()) {
- qWarning() << "Invalid model row:" << modelRow;
- return;
- }
-
- removeRows(modelRow, 1);
- submitAll();
- }
-
-signals:
- void dateChanged();
- void rowCountChanged();
-
-private:
- // The date to show events for.
- QDate mDate;
-};
-
-int main(int argc, char *argv[])
-{
- QGuiApplication app(argc, argv);
- createDatabase();
- qmlRegisterType<SqlEventModel>("io.qt.examples.calendar", 1, 0, "SqlEventModel");
- QQmlApplicationEngine engine;
- engine.load(QUrl("qrc:/main.qml"));
- if (engine.rootObjects().isEmpty())
- return -1;
- return app.exec();
-}
-
-#include "main.moc"
diff --git a/examples/labs/calendar/main.qml b/examples/labs/calendar/main.qml
deleted file mode 100644
index d7088fbe..00000000
--- a/examples/labs/calendar/main.qml
+++ /dev/null
@@ -1,220 +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.6
-import Qt.labs.controls 1.0
-import Qt.labs.calendar 1.0
-import QtQuick.Layouts 1.0
-import io.qt.examples.calendar 1.0
-
-ApplicationWindow {
- id: window
- width: 640
- height: 400
- minimumWidth: 400
- minimumHeight: 300
- color: "#f4f4f4"
- visible: true
- title: "Qt Labs Calendar - Example"
-
- SqlEventModel {
- id: eventModel
- date: calendar.selectedDate
- }
-
- StackView {
- id: stackView
- anchors.fill: parent
- anchors.margins: 20
-
- initialItem: flow
- }
-
- Flow {
- id: flow
- spacing: 10
- layoutDirection: Qt.RightToLeft
-
- ListView {
- id: calendar
- property date selectedDate: new Date()
-
- clip: true
- width: (parent.width > parent.height ? (parent.width - parent.spacing) * 0.6 : parent.width)
- height: (parent.height > parent.width ? (parent.height - parent.spacing) * 0.6 : parent.height)
-
- model: CalendarModel {
- id: model
- from: eventModel.min
- to: eventModel.max
- }
-
- focus: true
- currentIndex: model.indexOf(selectedDate.getFullYear(), selectedDate.getMonth() + 1)
- snapMode: ListView.SnapOneItem
- highlightMoveDuration: 250
- highlightRangeMode: ListView.StrictlyEnforceRange
- orientation: parent.width > parent.height ? ListView.Vertical : ListView.Horizontal
-
- delegate: MonthGrid {
- id: delegate
-
- width: calendar.width
- height: calendar.height
-
- month: model.month
- year: model.year
-
- topPadding: title.height
- Column {
- id: title
- x: delegate.contentItem.x
- width: delegate.contentItem.width
- spacing: 6
- Text {
- width: parent.width
- height: implicitHeight * 2
- text: delegate.title
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- font.pointSize: 18
- }
- DayOfWeekRow {
- width: parent.width
- }
- }
-
- leftPadding: weekNumbers.width
- WeekNumberColumn {
- id: weekNumbers
- month: model.month
- year: model.year
- y: delegate.contentItem.y
- height: delegate.contentItem.height
- }
-
- onClicked: calendar.selectedDate = date
-
- delegate: Text {
- text: model.day
- opacity: model.month === delegate.month ? 1 : 0
- color: model.today ? Theme.accentColor : Theme.textColor
- minimumPointSize: 8
- fontSizeMode: Text.Fit
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- Rectangle {
- z: -1
- anchors.centerIn: parent
- width: Math.min(parent.width * 0.6, parent.width * 0.6)
- height: width
- radius: width / 2
- opacity: 0.5
- color: pressed ? Theme.pressColor : "transparent";
-
- SqlEventModel {
- id: delegateEventModel
- }
-
- border.color: delegateEventModel.rowCount > 0 ? Theme.accentColor : "transparent"
- }
- }
- }
- Rectangle {
- z: -1
- parent: calendar
- anchors.fill: parent
- border.color: Theme.frameColor
- }
- }
-
- EventView {
- width: (parent.width > parent.height ? (parent.width - parent.spacing) * 0.4 : parent.width)
- height: (parent.height > parent.width ? (parent.height - parent.spacing) * 0.4 : parent.height)
- selectedDate: calendar.selectedDate
- eventModel: eventModel
- locale: calendar.locale
-
- onAddEventClicked: stackView.push(createEventComponent)
- }
- }
-
- Component {
- id: createEventComponent
-
- ColumnLayout {
- spacing: 10
- visible: StackView.index === stackView.currentIndex
-
- DateTimePicker {
- id: dateTimePicker
- anchors.horizontalCenter: parent.horizontalCenter
- dateToShow: calendar.selectedDate
- }
- Frame {
- Layout.fillWidth: true
-
- TextArea {
- id: descriptionField
- placeholderText: "Description"
- anchors.fill: parent
- }
- }
- RowLayout {
- Layout.fillWidth: true
-
- Button {
- text: "Cancel"
- Layout.fillWidth: true
- onClicked: stackView.pop()
- }
- Button {
- text: "Create"
- enabled: dateTimePicker.enabled
- Layout.fillWidth: true
- onClicked: {
- eventModel.addEvent(descriptionField.text, dateTimePicker.chosenDate);
- stackView.pop();
- }
- }
- }
- }
- }
-}
diff --git a/examples/labs/controls/controls.pro b/examples/labs/controls/controls.pro
deleted file mode 100644
index 4c0cd6e4..00000000
--- a/examples/labs/controls/controls.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += \
- mirroring \
- theme \
- tabs \
- drawer
-
-EXAMPLE_FILES += \
- shared
diff --git a/examples/labs/controls/drawer/drawer.pro b/examples/labs/controls/drawer/drawer.pro
deleted file mode 100644
index 02e40200..00000000
--- a/examples/labs/controls/drawer/drawer.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-TEMPLATE = app
-TARGET = drawer
-QT += quick
-
-SOURCES += \
- main.cpp
-
-OTHER_FILES += \
- main.qml
-
-RESOURCES += \
- drawer.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/labs/controls/drawer
-INSTALLS += target
diff --git a/examples/labs/controls/drawer/drawer.qrc b/examples/labs/controls/drawer/drawer.qrc
deleted file mode 100644
index 25cc5cbe..00000000
--- a/examples/labs/controls/drawer/drawer.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>main.qml</file>
- <file>images/arrow.png</file>
- <file>images/qt-logo.png</file>
- </qresource>
-</RCC>
diff --git a/examples/labs/controls/drawer/images/arrow.png b/examples/labs/controls/drawer/images/arrow.png
deleted file mode 100644
index 4981e0de..00000000
--- a/examples/labs/controls/drawer/images/arrow.png
+++ /dev/null
Binary files differ
diff --git a/examples/labs/controls/drawer/images/qt-logo.png b/examples/labs/controls/drawer/images/qt-logo.png
deleted file mode 100644
index cf350dad..00000000
--- a/examples/labs/controls/drawer/images/qt-logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/labs/controls/drawer/main.cpp b/examples/labs/controls/drawer/main.cpp
deleted file mode 100644
index 2abdc16d..00000000
--- a/examples/labs/controls/drawer/main.cpp
+++ /dev/null
@@ -1,52 +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("qrc:/main.qml"));
- if (engine.rootObjects().isEmpty())
- return -1;
- return app.exec();
-}
diff --git a/examples/labs/controls/drawer/main.qml b/examples/labs/controls/drawer/main.qml
deleted file mode 100644
index 5fba80b3..00000000
--- a/examples/labs/controls/drawer/main.qml
+++ /dev/null
@@ -1,157 +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.6
-import Qt.labs.controls 1.0
-
-ApplicationWindow {
- id: window
- width: 360
- height: 520
- visible: true
- title: "Qt Labs Controls - Drawer Example"
-
- Rectangle {
- id: content
- anchors.fill: parent
- anchors.margins: -1
- border.color: Theme.frameColor
-
- Image {
- width: window.width / 2
- height: window.height / 2
- anchors.centerIn: parent
- anchors.horizontalCenterOffset: window.width > window.height ? width / 2 : 0
- anchors.verticalCenterOffset: window.width < window.height ? -height / 4 : 0
- fillMode: Image.PreserveAspectFit
- source: "qrc:/images/qt-logo.png"
- }
-
- Image {
- width: window.width / 2
- anchors.bottom: parent.bottom
- anchors.bottomMargin: height / 2
- fillMode: Image.PreserveAspectFit
- source: "qrc:/images/arrow.png"
- }
-
- transform: Translate {
- x: effect.current === uncover ? drawer.position * listview.width :
- effect.current === push ? drawer.position * listview.width * 0.5 : 0
- }
-
- z: effect.current === uncover ? 2 : 0
- }
-
- Drawer {
- id: drawer
- anchors.fill: parent
-
- ListView {
- id: listview
-
- width: window.width / 3 * 2
- height: window.height
-
- ButtonGroup {
- id: effect
- }
-
- model: VisualItemModel {
- Label {
- text: "Settings"
- x: 6
- width: parent.width - 12
- lineHeight: 2.0
- color: Theme.accentColor
- verticalAlignment: Text.AlignVCenter
- }
- Rectangle { width: parent.width; height: 1; color: Theme.frameColor }
- Switch {
- id: dim
- text: "Dim"
- checked: true
- width: parent.width
- layoutDirection: Qt.RightToLeft
- enabled: effect.current != uncover
- }
- Rectangle { width: parent.width; height: 1; color: Theme.frameColor }
- RadioButton {
- id: overlay
- text: "Overlay"
- checked: true
- width: parent.width
- ButtonGroup.group: effect
- layoutDirection: Qt.RightToLeft
- }
- RadioButton {
- id: push
- text: "Push"
- width: parent.width
- ButtonGroup.group: effect
- layoutDirection: Qt.RightToLeft
- }
- RadioButton {
- id: uncover
- text: "Uncover"
- width: parent.width
- ButtonGroup.group: effect
- layoutDirection: Qt.RightToLeft
- }
- Rectangle { width: parent.width; height: 1; color: Theme.frameColor }
- }
- Rectangle {
- z: -1
- anchors.fill: parent
- anchors.topMargin: -1
- anchors.bottomMargin: -1
- border.color: Theme.frameColor
- }
-
- transform: Translate {
- x: effect.current === uncover ? (1.0 - drawer.position) * listview.width : 0
- }
- }
-
- background.visible: dim.checked
-
- onClicked: close()
- }
-}
diff --git a/examples/labs/controls/mirroring/main.cpp b/examples/labs/controls/mirroring/main.cpp
deleted file mode 100644
index 2abdc16d..00000000
--- a/examples/labs/controls/mirroring/main.cpp
+++ /dev/null
@@ -1,52 +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("qrc:/main.qml"));
- if (engine.rootObjects().isEmpty())
- return -1;
- return app.exec();
-}
diff --git a/examples/labs/controls/mirroring/main.qml b/examples/labs/controls/mirroring/main.qml
deleted file mode 100644
index 69218a86..00000000
--- a/examples/labs/controls/mirroring/main.qml
+++ /dev/null
@@ -1,237 +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.6
-import QtQuick.Layouts 1.0
-import Qt.labs.controls 1.0
-
-ApplicationWindow {
- id: window
- width: 360
- height: 520
- visible: true
- title: "Qt Labs Controls - Mirroring Example"
-
- ListView {
- id: listview
- anchors.fill: parent
-
- LayoutMirroring.enabled: headerItem.mirror
- LayoutMirroring.childrenInherit: true
-
- headerPositioning: ListView.PullBackHeader
- header: Rectangle {
- property alias mirror: mirrorSwitch.checked
-
- z: 2
- width: parent.width
- height: label.implicitHeight + 96
-
- Label {
- id: label
- text: "Beyond the essentials."
- color: Theme.accentColor
- anchors.fill: parent
- anchors.margins: 48
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- wrapMode: Text.WordWrap
- font.pointSize: 26
- }
-
- Switch {
- id: mirrorSwitch
- text: "Mirror"
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- layoutDirection: Qt.RightToLeft
- LayoutMirroring.enabled: false
- }
-
- Rectangle {
- width: parent.width
- height: 1
- anchors.bottom: parent.bottom
- color: Theme.frameColor
- }
- }
-
- model: VisualItemModel {
-
- Item { width: 1; height: 24 }
-
- Flow {
- id: flow
- spacing: 12
- width: Math.min(window.width, window.height) - 24
- anchors.horizontalCenter: parent.horizontalCenter
-
- GroupBox {
- title: "CheckBox"
- readonly property real preferredWidth: (flow.width - 12) / 2
- width: window.width > window.height || contentWidth > preferredWidth ? flow.width : preferredWidth
- ColumnLayout {
- width: parent.width
- CheckBox {
- width: parent.width
- text: "E-mail"
- checked: true
- }
- CheckBox {
- width: parent.width
- text: "Calendar"
- checked: true
- }
- CheckBox {
- width: parent.width
- text: "Contacts"
- }
- }
- }
-
- GroupBox {
- title: "RadioButton"
- readonly property real preferredWidth: (flow.width - 12) / 2
- width: window.width > window.height || contentWidth > preferredWidth ? flow.width : preferredWidth
- ButtonGroup { id: eg }
- ColumnLayout {
- width: parent.width
- RadioButton {
- width: parent.width
- text: "Portrait"
- ButtonGroup.group: eg
- }
- RadioButton {
- width: parent.width
- text: "Landscape"
- ButtonGroup.group: eg
- }
- RadioButton {
- width: parent.width
- text: "Automatic"
- checked: true
- ButtonGroup.group: eg
- }
- }
- }
-
- GroupBox {
- title: "Button"
- width: flow.width
- Row {
- width: parent.width
- spacing: 6
- readonly property real availableWidth: (flow.width - 12) / 2
- readonly property real contentWidth: okButton.implicitWidth + cancelButton.implicitWidth + 12
- readonly property real buttonWidth: implicitWidth > availableWidth ? (width / 2 - spacing) : (width / 2 - 2 * spacing) / 2
- Button {
- id: okButton
- text: "Ok"
- width: parent.buttonWidth
- }
- Button {
- id: cancelButton
- text: "Cancel"
- width: parent.buttonWidth
- }
- }
- }
-
- GroupBox {
- title: "Switch"
- width: flow.width
- Column {
- width: parent.width
- Switch {
- width: parent.width
- text: "Wifi"
- checked: true
- }
- Switch {
- width: parent.width
- text: "Bluetooth"
- }
- }
- }
-
- GroupBox {
- title: "ProgressBar"
- width: flow.width
- Column {
- width: parent.width
- spacing: 6
- ProgressBar {
- width: parent.width
- indeterminate: true
- }
- ProgressBar {
- width: parent.width
- value: slider.position
- }
- }
- }
-
- GroupBox {
- title: "Slider"
- width: flow.width
- Column {
- width: parent.width
- spacing: 6
- Slider {
- id: slider
- value: 0.4
- width: parent.width
- }
- Slider {
- width: parent.width
- snapMode: Slider.SnapAlways
- stepSize: 0.2
- value: 0.8
- }
- }
- }
- }
-
- Item { width: 1; height: 12 }
- }
-
- ScrollIndicator.vertical: ScrollIndicator { anchors.right: parent.right }
- }
-}
diff --git a/examples/labs/controls/mirroring/mirroring.pro b/examples/labs/controls/mirroring/mirroring.pro
deleted file mode 100644
index 60b73f94..00000000
--- a/examples/labs/controls/mirroring/mirroring.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-TEMPLATE = app
-TARGET = mirroring
-QT += quick
-
-SOURCES += \
- main.cpp
-
-OTHER_FILES += \
- main.qml
-
-RESOURCES += \
- mirroring.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/labs/controls/mirroring
-INSTALLS += target
diff --git a/examples/labs/controls/mirroring/mirroring.qrc b/examples/labs/controls/mirroring/mirroring.qrc
deleted file mode 100644
index 5f6483ac..00000000
--- a/examples/labs/controls/mirroring/mirroring.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>main.qml</file>
- </qresource>
-</RCC>
diff --git a/examples/labs/controls/tabs/images/qt-logo.png b/examples/labs/controls/tabs/images/qt-logo.png
deleted file mode 100644
index cf350dad..00000000
--- a/examples/labs/controls/tabs/images/qt-logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/labs/controls/tabs/main.cpp b/examples/labs/controls/tabs/main.cpp
deleted file mode 100644
index 2abdc16d..00000000
--- a/examples/labs/controls/tabs/main.cpp
+++ /dev/null
@@ -1,52 +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("qrc:/main.qml"));
- if (engine.rootObjects().isEmpty())
- return -1;
- return app.exec();
-}
diff --git a/examples/labs/controls/tabs/main.qml b/examples/labs/controls/tabs/main.qml
deleted file mode 100644
index ceebc622..00000000
--- a/examples/labs/controls/tabs/main.qml
+++ /dev/null
@@ -1,290 +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.6
-import QtQuick.Layouts 1.0
-import Qt.labs.controls 1.0
-import QtQuick.XmlListModel 2.0
-
-ApplicationWindow {
- id: window
- width: 360
- height: 520
- visible: true
- title: "Qt Labs Controls - Tabs Example"
-
- header: TabBar {
- id: bar
- currentIndex: view.currentIndex
- TabButton {
- text: "Home"
- }
- TabButton {
- text: "Discover"
- }
- TabButton {
- text: "Activity"
- }
- }
-
- SwipeView {
- id: view
-
- spacing: 1
- anchors.fill: parent
- currentIndex: bar.currentIndex
- background: Rectangle { color: Theme.frameColor }
-
- Rectangle {
- Image {
- id: logo
- width: window.width / 2
- height: window.height / 2
- anchors.centerIn: parent
- fillMode: Image.PreserveAspectFit
- source: "qrc:/images/qt-logo.png"
- }
-
- Label {
- text: "Things just got better"
- color: Theme.accentColor
- anchors.margins: 40
- anchors.top: logo.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- wrapMode: Text.WordWrap
- font.pointSize: 26
- }
- }
-
- Rectangle {
- ListView {
- anchors.fill: parent
- anchors.topMargin: -1
- model: XmlListModel {
- id: feedModel
- query: "/rss/channel/item"
- source: "http://blog.qt.io/feed/"
- namespaceDeclarations: "declare namespace dc='http://purl.org/dc/elements/1.1/';"
- XmlRole { name: "title"; query: "title/string()" }
- XmlRole { name: "link"; query: "link/string()" }
- XmlRole { name: "pubDate"; query: "pubDate/string()" }
- XmlRole { name: "creator"; query: "dc:creator/string()" }
- XmlRole { name: "description"; query: "description/string()" }
- }
-
- delegate: Item {
- width: parent.width
- height: feedItem.height
- Column {
- id: feedItem
- width: parent.width
- spacing: 6
- Rectangle {
- width: parent.width
- height: 1
- color: Theme.frameColor
- visible: index == 0
- }
- Item { width: 1; height: 6 }
- Label {
- text: model.title
- x: 6
- width: parent.width - 12
- elide: Text.ElideRight
- color: Theme.accentColor
- font.pointSize: 20
- lineHeight: 0.75
- }
- Label {
- text: model.description
- textFormat: Text.StyledText
- x: 6
- width: parent.width - 12
- wrapMode: Text.WordWrap
- }
- RowLayout {
- x: 6
- width: parent.width - 12
- spacing: 6
- Label {
- id: discoverCreator
- text: model.creator
- height: parent.height
- verticalAlignment: Text.AlignVCenter
- color: Theme.focusColor
- font.pointSize: 8
- }
- Label {
- text: model.pubDate
- height: parent.height
- elide: Text.ElideRight
- verticalAlignment: Text.AlignVCenter
- color: Theme.disabledColor
- font.pointSize: 8
- Layout.preferredWidth: parent.width - discoverCreator.width - discoverMore.width - 2 * parent.spacing
- visible: Layout.preferredWidth > 0
- }
- Button {
- id: discoverMore
- text: "Read more..."
- onClicked: Qt.openUrlExternally(model.link)
- }
- }
- Rectangle {
- width: parent.width
- height: 1
- color: Theme.frameColor
- }
- }
- }
-
- ScrollIndicator.vertical: ScrollIndicator { }
- }
-
- BusyIndicator {
- anchors.centerIn: parent
- running: feedModel.status === XmlListModel.Loading
- }
- }
-
- Rectangle {
- ListView {
- anchors.fill: parent
- anchors.topMargin: -1
- model: XmlListModel {
- id: commentModel
- query: "/rss/channel/item"
- source: "http://blog.qt.io/comments/feed/"
- namespaceDeclarations: "declare namespace dc='http://purl.org/dc/elements/1.1/';"
- XmlRole { name: "title"; query: "title/string()" }
- XmlRole { name: "link"; query: "link/string()" }
- XmlRole { name: "pubDate"; query: "pubDate/string()" }
- XmlRole { name: "creator"; query: "dc:creator/string()" }
- XmlRole { name: "description"; query: "description/string()" }
- }
-
- delegate: Rectangle {
- width: parent.width
- height: commentItem.height
- Column {
- id: commentItem
- width: parent.width
- spacing: 6
- Rectangle {
- width: parent.width
- height: 1
- color: Theme.frameColor
- visible: index == 0
- }
- Item { width: 1; height: 6 }
- Label {
- text: model.title
- x: 6
- width: parent.width - 12
- elide: Text.ElideRight
- color: Theme.accentColor
- font.pointSize: 14
- lineHeight: 0.75
- }
- Item { width: 1; height: 6 }
- Label {
- text: model.description
- textFormat: Text.StyledText
- x: 6
- width: parent.width - 12
- wrapMode: Text.WordWrap
- }
- RowLayout {
- x: 6
- width: parent.width - 12
- spacing: 6
- Label {
- id: activityCreator
- text: model.creator
- height: parent.height
- verticalAlignment: Text.AlignVCenter
- color: Theme.focusColor
- font.pointSize: 8
- }
- Label {
- text: model.pubDate
- height: parent.height
- elide: Text.ElideRight
- verticalAlignment: Text.AlignVCenter
- color: Theme.disabledColor
- font.pointSize: 8
- Layout.preferredWidth: parent.width - activityCreator.width - activityMore.width - 2 * parent.spacing
- visible: Layout.preferredWidth > 0
- }
- Button {
- id: activityMore
- text: "Read more..."
- onClicked: Qt.openUrlExternally(model.link)
- }
- }
- Rectangle {
- width: parent.width
- height: 1
- color: Theme.frameColor
- }
- }
- }
-
- ScrollIndicator.vertical: ScrollIndicator { }
- }
-
- BusyIndicator {
- anchors.centerIn: parent
- running: feedModel.status === XmlListModel.Loading
- }
- }
- }
-
- PageIndicator {
- count: view.count
- currentIndex: view.currentIndex
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- }
-}
diff --git a/examples/labs/controls/tabs/tabs.pro b/examples/labs/controls/tabs/tabs.pro
deleted file mode 100644
index f9b85c1a..00000000
--- a/examples/labs/controls/tabs/tabs.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-TEMPLATE = app
-TARGET = tabs
-QT += quick
-
-SOURCES += \
- main.cpp
-
-OTHER_FILES += \
- main.qml
-
-RESOURCES += \
- tabs.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/labs/controls/tabs
-INSTALLS += target
diff --git a/examples/labs/controls/tabs/tabs.qrc b/examples/labs/controls/tabs/tabs.qrc
deleted file mode 100644
index b48259b1..00000000
--- a/examples/labs/controls/tabs/tabs.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>main.qml</file>
- <file>images/qt-logo.png</file>
- </qresource>
-</RCC>
diff --git a/examples/labs/controls/theme/main.cpp b/examples/labs/controls/theme/main.cpp
deleted file mode 100644
index 2abdc16d..00000000
--- a/examples/labs/controls/theme/main.cpp
+++ /dev/null
@@ -1,52 +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("qrc:/main.qml"));
- if (engine.rootObjects().isEmpty())
- return -1;
- return app.exec();
-}
diff --git a/examples/labs/controls/theme/main.qml b/examples/labs/controls/theme/main.qml
deleted file mode 100644
index 32221764..00000000
--- a/examples/labs/controls/theme/main.qml
+++ /dev/null
@@ -1,174 +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.6
-import Qt.labs.controls 1.0
-
-ApplicationWindow {
- id: window
- width: 360
- height: 520
- visible: true
- title: "Qt Labs Controls - Theme Example"
-
- header: ToolBar {
- ToolButton {
- label: Text {
- // \u25C0 (black left-pointing triangle is) missing in some fonts
- // => use a rotated \u25B2 (black up-pointing triangle) instead
- text: "\u25B2"
- rotation: -90
- color: enabled ? Theme.accentColor : Theme.frameColor
- anchors.centerIn: parent
- }
- enabled: stackview.depth > 1
- onClicked: stackview.pop()
- }
- }
-
- StackView {
- id: stackview
- anchors.fill: parent
- initialItem: pageComponent
- }
-
- Component {
- id: pageComponent
- Rectangle {
- id: page
- Theme.accentColor: Qt.hsla(colorSlider.position, 0.5, 0.5, 1.0)
- Theme.backgroundColor: darkButton.checked ? "#444" : "#fff"
- Theme.frameColor: darkButton.checked ? "#666" : "#ccc"
- Theme.textColor: darkButton.checked ? "#eee" : "#111"
- Theme.pressColor: darkButton.checked ? "#33ffffff" : "#33333333"
- Theme.baseColor: darkButton.checked ? "#444" : "#eee"
- color: Theme.backgroundColor
- Flickable {
- anchors.fill: parent
- contentHeight: column.height + 48
-
- Column {
- id: column
-
- x: (window.width - width) / 2
- y: 24
- width: window.width / 2
- spacing: 12
-
- Label {
- text: "Code less. Create more."
- color: Theme.accentColor
- width: parent.width
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- wrapMode: Text.WordWrap
- font.pointSize: 26
- }
-
- Item { width: 1; height: 48 }
-
- Rectangle {
- width: parent.width
- height: 1
- color: Theme.frameColor
- }
-
- Column {
- spacing: 6
- width: parent.width
- Label {
- text: "Accent color"
- color: Theme.textColor
- }
- Slider {
- id: colorSlider
- width: parent.width
- value: 0.275
- }
- }
-
- Rectangle {
- width: parent.width
- height: 1
- color: Theme.frameColor
- }
-
- ButtonGroup {
- id: themeGroup
- }
-
- Column {
- width: parent.width
- spacing: 6
- RadioButton {
- id: lightButton
- text: "Light"
- width: parent.width
- checked: true
- layoutDirection: Qt.RightToLeft
- ButtonGroup.group: themeGroup
- }
- RadioButton {
- id: darkButton
- text: "Dark"
- width: parent.width
- layoutDirection: Qt.RightToLeft
- ButtonGroup.group: themeGroup
- }
- }
-
- Rectangle {
- width: parent.width
- height: 1
- color: Theme.frameColor
- }
-
- Button {
- text: "Push"
- anchors.right: parent.right
- onClicked: stackview.push(pageComponent)
- }
- }
-
- ScrollIndicator.vertical: ScrollIndicator { }
- }
- }
- }
-}
diff --git a/examples/labs/controls/theme/theme.pro b/examples/labs/controls/theme/theme.pro
deleted file mode 100644
index 7672a2cb..00000000
--- a/examples/labs/controls/theme/theme.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-TEMPLATE = app
-TARGET = theme
-QT += quick
-
-SOURCES += \
- main.cpp
-
-OTHER_FILES += \
- main.qml
-
-RESOURCES += \
- theme.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/labs/controls/theme
-INSTALLS += target
diff --git a/examples/labs/controls/theme/theme.qrc b/examples/labs/controls/theme/theme.qrc
deleted file mode 100644
index 5f6483ac..00000000
--- a/examples/labs/controls/theme/theme.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>main.qml</file>
- </qresource>
-</RCC>
diff --git a/examples/labs/labs.pro b/examples/labs/labs.pro
deleted file mode 100644
index 80f94e86..00000000
--- a/examples/labs/labs.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += \
- calendar \
- controls