summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2018-11-19 15:59:55 +0100
committerKai Koehne <kai.koehne@qt.io>2019-01-24 11:00:51 +0000
commitcc1a7a75ec5d2222230e90a6afb8770dc5810ed6 (patch)
treea423964c0bfa0cd6867e363eeaf3dafbf79952ef
parent09f7f933740458585fc389fd03f11ab5f8302f79 (diff)
downloadqtdoc-cc1a7a75ec5d2222230e90a6afb8770dc5810ed6.tar.gz
Make examples self-contained
Remove shared main entry function and shared resources (that were not used anyway), and simplify the entry point: * Get rid of special handling of QT_QUICK_CORE_PROFILE, QT_QUICK_MULTISAMPLE environment variables. * Remove QQmlFileSelector, which is not used in the examples. * Do set QtCoreAppication::organizationName to 'QtExamples', so that the settings are separate from QtProject. This follows recent changes in Qt WebEngine examples. Change-Id: I01851b3434901fefc2738136a2f1795d682a3233 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r--examples/demos/calqlatr/calqlatr.pro3
-rw-r--r--examples/demos/calqlatr/main.cpp24
-rw-r--r--examples/demos/clocks/main.cpp24
-rw-r--r--examples/demos/maroon/main.cpp24
-rw-r--r--examples/demos/rssnews/main.cpp24
-rw-r--r--examples/demos/samegame/main.cpp24
-rw-r--r--examples/demos/shared/Button.qml96
-rw-r--r--examples/demos/shared/CheckBox.qml107
-rw-r--r--examples/demos/shared/Label.qml56
-rw-r--r--examples/demos/shared/LauncherList.qml252
-rw-r--r--examples/demos/shared/README11
-rw-r--r--examples/demos/shared/SimpleLauncherDelegate.qml138
-rw-r--r--examples/demos/shared/Slider.qml127
-rw-r--r--examples/demos/shared/TabSet.qml116
-rw-r--r--examples/demos/shared/TextField.qml90
-rw-r--r--examples/demos/shared/images/back.pngbin1590 -> 0 bytes
-rw-r--r--examples/demos/shared/images/checkmark.pngbin809 -> 0 bytes
-rw-r--r--examples/demos/shared/images/next.pngbin1371 -> 0 bytes
-rw-r--r--examples/demos/shared/images/qt-logo.pngbin9186 -> 0 bytes
-rw-r--r--examples/demos/shared/images/slider_handle.pngbin887 -> 0 bytes
-rw-r--r--examples/demos/shared/images/tab.pngbin309 -> 0 bytes
-rw-r--r--examples/demos/shared/qmldir7
-rw-r--r--examples/demos/shared/quick_shared.qrc15
-rw-r--r--examples/demos/shared/shared.h82
-rw-r--r--examples/demos/shared/shared.qrc18
-rw-r--r--examples/demos/stocqt/main.cpp24
-rw-r--r--examples/demos/tweetsearch/main.cpp24
27 files changed, 155 insertions, 1131 deletions
diff --git a/examples/demos/calqlatr/calqlatr.pro b/examples/demos/calqlatr/calqlatr.pro
index 19ed61c6..0c114b5f 100644
--- a/examples/demos/calqlatr/calqlatr.pro
+++ b/examples/demos/calqlatr/calqlatr.pro
@@ -3,8 +3,7 @@ TEMPLATE = app
QT += qml quick
SOURCES += main.cpp
-RESOURCES += calqlatr.qrc \
- ../shared/shared.qrc
+RESOURCES += calqlatr.qrc
OTHER_FILES = calqlatr.qml \
content/Button.qml \
diff --git a/examples/demos/calqlatr/main.cpp b/examples/demos/calqlatr/main.cpp
index 6e25fc63..6b5b59c2 100644
--- a/examples/demos/calqlatr/main.cpp
+++ b/examples/demos/calqlatr/main.cpp
@@ -47,5 +47,25 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/calqlatr/calqlatr)
+
+#include <QGuiApplication>
+#include <QQmlEngine>
+#include <QQmlFileSelector>
+#include <QQuickView>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QCoreApplication::setOrganizationName("QtExamples");
+
+ QGuiApplication app(argc, argv);
+
+ QQuickView view;
+ view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);
+ view.setSource(QUrl("qrc:/demos/calqlatr/calqlatr.qml"));
+ if (view.status() == QQuickView::Error)
+ return -1;
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.show();
+ return app.exec();
+}
diff --git a/examples/demos/clocks/main.cpp b/examples/demos/clocks/main.cpp
index c2508dc6..5889eaba 100644
--- a/examples/demos/clocks/main.cpp
+++ b/examples/demos/clocks/main.cpp
@@ -47,5 +47,25 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/clocks/clocks)
+
+#include <QGuiApplication>
+#include <QQmlEngine>
+#include <QQmlFileSelector>
+#include <QQuickView>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QCoreApplication::setOrganizationName("QtExamples");
+
+ QGuiApplication app(argc, argv);
+
+ QQuickView view;
+ view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);
+ view.setSource(QUrl("qrc:/demos/clocks/clocks.qml"));
+ if (view.status() == QQuickView::Error)
+ return -1;
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.show();
+ return app.exec();
+}
diff --git a/examples/demos/maroon/main.cpp b/examples/demos/maroon/main.cpp
index baf37212..cfc426c8 100644
--- a/examples/demos/maroon/main.cpp
+++ b/examples/demos/maroon/main.cpp
@@ -47,5 +47,25 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/maroon/maroon)
+
+#include <QGuiApplication>
+#include <QQmlEngine>
+#include <QQmlFileSelector>
+#include <QQuickView>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QCoreApplication::setOrganizationName("QtExamples");
+
+ QGuiApplication app(argc, argv);
+
+ QQuickView view;
+ view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);
+ view.setSource(QUrl("qrc:/demos/maroon/maroon.qml"));
+ if (view.status() == QQuickView::Error)
+ return -1;
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.show();
+ return app.exec();
+}
diff --git a/examples/demos/rssnews/main.cpp b/examples/demos/rssnews/main.cpp
index 7bbd83c4..9588c065 100644
--- a/examples/demos/rssnews/main.cpp
+++ b/examples/demos/rssnews/main.cpp
@@ -47,5 +47,25 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/rssnews/rssnews)
+
+#include <QGuiApplication>
+#include <QQmlEngine>
+#include <QQmlFileSelector>
+#include <QQuickView>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QCoreApplication::setOrganizationName("QtExamples");
+
+ QGuiApplication app(argc, argv);
+
+ QQuickView view;
+ view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);
+ view.setSource(QUrl("qrc:/demos/rssnews/rssnews.qml"));
+ if (view.status() == QQuickView::Error)
+ return -1;
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.show();
+ return app.exec();
+}
diff --git a/examples/demos/samegame/main.cpp b/examples/demos/samegame/main.cpp
index 8ac1f7ab..4053c94e 100644
--- a/examples/demos/samegame/main.cpp
+++ b/examples/demos/samegame/main.cpp
@@ -47,5 +47,25 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/samegame/samegame)
+
+#include <QGuiApplication>
+#include <QQmlEngine>
+#include <QQmlFileSelector>
+#include <QQuickView>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QCoreApplication::setOrganizationName("QtExamples");
+
+ QGuiApplication app(argc, argv);
+
+ QQuickView view;
+ view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);
+ view.setSource(QUrl("qrc:/demos/samegame/samegame.qml"));
+ if (view.status() == QQuickView::Error)
+ return -1;
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.show();
+ return app.exec();
+}
diff --git a/examples/demos/shared/Button.qml b/examples/demos/shared/Button.qml
deleted file mode 100644
index 8abce273..00000000
--- a/examples/demos/shared/Button.qml
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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.1
-import QtQuick.Window 2.1
-
-Item {
- id: container
-
- property alias text: buttonLabel.text
- property alias label: buttonLabel
- signal clicked
- property alias containsMouse: mouseArea.containsMouse
- property alias pressed: mouseArea.pressed
- implicitHeight: Math.max(Screen.pixelDensity * 7, buttonLabel.implicitHeight * 1.2)
- implicitWidth: Math.max(Screen.pixelDensity * 11, buttonLabel.implicitWidth * 1.3)
- height: implicitHeight
- width: implicitWidth
-
- SystemPalette { id: palette }
-
- Rectangle {
- id: frame
- anchors.fill: parent
- color: palette.button
- gradient: Gradient {
- GradientStop { position: 0.0; color: mouseArea.pressed ? Qt.darker(palette.button, 1.3) : palette.button }
- GradientStop { position: 1.0; color: Qt.darker(palette.button, 1.3) }
- }
- antialiasing: true
- radius: height / 6
- border.color: Qt.darker(palette.button, 1.5)
- border.width: 1
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: container.clicked()
- hoverEnabled: true
- }
-
- Text {
- id: buttonLabel
- text: container.text
- color: palette.buttonText
- anchors.centerIn: parent
- }
-}
diff --git a/examples/demos/shared/CheckBox.qml b/examples/demos/shared/CheckBox.qml
deleted file mode 100644
index bcf8178f..00000000
--- a/examples/demos/shared/CheckBox.qml
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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.0
-
-Item {
- id: root
- implicitHeight: frame.height
- implicitWidth: row.implicitWidth
- width: implicitWidth
- height: implicitHeight
- property alias text: label.text
- property bool checked
- property alias pressed: mouseArea.pressed
- property alias row: row
- signal clicked
-
- SystemPalette { id: palette }
-
- Row {
- id: row
- anchors.verticalCenter: parent.verticalCenter
- spacing: 6
- Rectangle {
- id: frame
- gradient: Gradient {
- GradientStop { position: 0.0; color: mouseArea.pressed ? Qt.darker(palette.button, 1.3) : palette.button }
- GradientStop { position: 1.0; color: Qt.darker(palette.button, 1.3) }
- }
- height: label.implicitHeight * 1.5
- width: height
- anchors.margins: 1
- radius: 3
- antialiasing: true
- border.color: Qt.darker(palette.button, 1.5)
- Image {
- id: theX
- source: "images/checkmark.png"
- anchors.fill: frame
- anchors.margins: frame.width / 5
- fillMode: Image.PreserveAspectFit
- smooth: true
- visible: checked
- }
- }
- Text {
- id: label
- color: palette.text
- anchors.verticalCenter: frame.verticalCenter
- }
- }
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: {
- parent.checked = !parent.checked
- parent.clicked()
- }
- }
-}
diff --git a/examples/demos/shared/Label.qml b/examples/demos/shared/Label.qml
deleted file mode 100644
index acbffb8d..00000000
--- a/examples/demos/shared/Label.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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.0
-
-Text {
- SystemPalette { id: palette }
- color: palette.text
-}
diff --git a/examples/demos/shared/LauncherList.qml b/examples/demos/shared/LauncherList.qml
deleted file mode 100644
index e532b53e..00000000
--- a/examples/demos/shared/LauncherList.qml
+++ /dev/null
@@ -1,252 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Crimson AS <info@crimson.no>
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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.0
-
-Rectangle {
- property int activePageCount: 0
-
- //model is a list of {"name":"somename", "url":"file:///some/url/mainfile.qml"}
- //function used to add to model A) to enforce scheme B) to allow Qt.resolveUrl in url assignments
-
- color: "#eee"
- function addExample(name, desc, url) {
- myModel.append({"name":name, "description":desc, "url":url})
- }
- function showExample(url) {
- pageComponent.createObject(pageContainer, { exampleUrl: url }).show()
- }
-
- // The container rectangle here is used to give a nice "feel" when
- // transitioning into an example.
- Rectangle {
- anchors.fill: parent
- color: "black"
-
- ListView {
- id: launcherList
- clip: true
- delegate: SimpleLauncherDelegate{
- onClicked: showExample(url)
- }
- model: ListModel {id:myModel}
- anchors.fill: parent
- enabled: opacity == 1.0
- }
- }
-
- Item {
- id: pageContainer
- anchors.fill: parent
- }
-
- Component {
- id: pageComponent
- Rectangle {
- id: page
- clip: true
- property url exampleUrl
- width: parent.width
- height: parent.height - bar.height
- color: "white"
- MouseArea{
- //Eats mouse events
- anchors.fill: parent
- }
- Loader{
- focus: true
- source: parent.exampleUrl
- anchors.fill: parent
- }
-
- x: -width
-
- function show() {
- showAnim.start()
- }
-
- function exit() {
- exitAnim.start()
- }
-
- ParallelAnimation {
- id: showAnim
- ScriptAction {
- script: activePageCount++
- }
- NumberAnimation {
- target: launcherList
- property: "opacity"
- from: 1.0
- to: 0.0
- duration: 500
- }
- NumberAnimation {
- target: launcherList
- property: "scale"
- from: 1.0
- to: 0.0
- duration: 500
- }
- NumberAnimation {
- target: page
- property: "x"
- from: -page.width
- to: 0
- duration: 300
- }
- }
- SequentialAnimation {
- id: exitAnim
-
- ScriptAction {
- script: activePageCount--
- }
-
- ParallelAnimation {
- NumberAnimation {
- target: launcherList
- property: "opacity"
- from: 0.0
- to: 1.0
- duration: 300
- }
- NumberAnimation {
- target: launcherList
- property: "scale"
- from: 0.0
- to: 1.0
- duration: 300
- }
- NumberAnimation {
- target: page
- property: "x"
- from: 0
- to: -page.width
- duration: 300
- }
- }
-
- ScriptAction {
- script: page.destroy()
- }
- }
- }
- }
- Rectangle {
- id: bar
- visible: height > 0
- anchors.bottom: parent.bottom
- width: parent.width
- height: activePageCount > 0 ? 40 : 0
-
- Behavior on height {
- NumberAnimation {
- duration: 300
- }
- }
-
- Rectangle {
- height: 1
- color: "#ccc"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- }
-
- Rectangle {
- height: 1
- color: "#fff"
- anchors.top: parent.top
- anchors.topMargin: 1
- anchors.left: parent.left
- anchors.right: parent.right
- }
-
- gradient: Gradient {
- GradientStop { position: 0 ; color: "#eee" }
- GradientStop { position: 1 ; color: "#ccc" }
- }
-
- Image {
- id: back
- source: "images/back.png"
- anchors.verticalCenter: parent.verticalCenter
- anchors.verticalCenterOffset: 2
- anchors.left: parent.left
- anchors.leftMargin: 16
-
- MouseArea {
- id: mouse
- hoverEnabled: true
- anchors.centerIn: parent
- width: 38
- height: 31
- anchors.verticalCenterOffset: -1
- enabled: activePageCount > 0
- onClicked: {
- pageContainer.children[pageContainer.children.length - 1].exit()
- }
- Rectangle {
- anchors.fill: parent
- opacity: mouse.pressed ? 1 : 0
- Behavior on opacity { NumberAnimation{ duration: 100 }}
- gradient: Gradient {
- GradientStop { position: 0 ; color: "#22000000" }
- GradientStop { position: 0.2 ; color: "#11000000" }
- }
- border.color: "darkgray"
- antialiasing: true
- radius: 4
- }
- }
- }
- }
-}
diff --git a/examples/demos/shared/README b/examples/demos/shared/README
deleted file mode 100644
index 2bf26d7c..00000000
--- a/examples/demos/shared/README
+++ /dev/null
@@ -1,11 +0,0 @@
-These files are shared between multiple examples as a set of common and
-reusuable components. While they do demonstrate the building of reusable
-components in QML, they are not official examples themselves.
-Consequently they do not have entries in the Qt documentation, and are
-documented only through the code comments within the files. Developers
-new to QML are strongly encouraged to go through the official examples
-before delving into this directory.
-
-For most application use, see the Qt Quick Components project to find
-ready-made Components you can use in your own projects. Qt Quick
-examples do not use them only to avoid external dependencies.
diff --git a/examples/demos/shared/SimpleLauncherDelegate.qml b/examples/demos/shared/SimpleLauncherDelegate.qml
deleted file mode 100644
index 86a3b0df..00000000
--- a/examples/demos/shared/SimpleLauncherDelegate.qml
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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.0
-
-Rectangle {
- id: container
- property Item exampleItem
- width: ListView.view.width
- height: button.implicitHeight + 22
-
- signal clicked()
-
- gradient: Gradient {
- GradientStop {
- position: 0
- Behavior on color {ColorAnimation { duration: 100 }}
- color: button.pressed ? "#e0e0e0" : "#fff"
- }
- GradientStop {
- position: 1
- Behavior on color {ColorAnimation { duration: 100 }}
- color: button.pressed ? "#e0e0e0" : button.containsMouse ? "#f5f5f5" : "#eee"
- }
- }
-
- Image {
- id: image
- opacity: 0.7
- Behavior on opacity {NumberAnimation {duration: 100}}
- source: "images/next.png"
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- anchors.rightMargin: 16
- }
-
- Item {
- id: button
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- anchors.right:image.left
- implicitHeight: col.height
- height: implicitHeight
- width: buttonLabel.width + 20
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: container.clicked()
- hoverEnabled: true
- }
-
- Column {
- spacing: 2
- id: col
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- Text {
- id: buttonLabel
- anchors.left: parent.left
- anchors.leftMargin: 10
- anchors.right: parent.right
- anchors.rightMargin: 10
- text: name
- color: "black"
- font.pixelSize: 22
- wrapMode: Text.WrapAtWordBoundaryOrAnywhere
- styleColor: "white"
- style: Text.Raised
-
- }
- Text {
- id: buttonLabel2
- anchors.left: parent.left
- anchors.leftMargin: 10
- text: description
- wrapMode: Text.WrapAtWordBoundaryOrAnywhere
- color: "#666"
- font.pixelSize: 12
- }
- }
- }
-
- Rectangle {
- height: 1
- color: "#ccc"
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- }
-}
diff --git a/examples/demos/shared/Slider.qml b/examples/demos/shared/Slider.qml
deleted file mode 100644
index 28f92446..00000000
--- a/examples/demos/shared/Slider.qml
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQuick module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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.0
-
-Item {
- id: slider
- height: 26
- width: 320
-
- property real min: 0
- property real max: 1
- property real value: min + (max - min) * mousearea.value
- property real init: min+(max-min)/2
- property string name: "Slider"
- property color color: "#0066cc"
- property real minLabelWidth: 44
-
- Component.onCompleted: setValue(init)
- function setValue(v) {
- if (min < max)
- handle.x = Math.round( v / (max - min) *
- (mousearea.drag.maximumX - mousearea.drag.minimumX)
- + mousearea.drag.minimumX);
- }
- Rectangle {
- id:sliderName
- anchors.left: parent.left
- anchors.leftMargin: 16
- height: childrenRect.height
- width: Math.max(minLabelWidth, childrenRect.width)
- anchors.verticalCenter: parent.verticalCenter
- Text {
- text: slider.name + ":"
- font.pointSize: 12
- color: "#333"
- }
- }
-
- Rectangle{
- id: foo
- width: parent.width - 8 - sliderName.width
- color: "#eee"
- height: 7
- radius: 3
- antialiasing: true
- border.color: Qt.darker(color, 1.2)
- anchors.left: sliderName.right
- anchors.right: parent.right
- anchors.leftMargin: 10
- anchors.rightMargin: 24
- anchors.verticalCenter: parent.verticalCenter
-
- Rectangle {
- height: parent.height
- anchors.left: parent.left
- anchors.right: handle.horizontalCenter
- color: slider.color
- radius: 3
- border.width: 1
- border.color: Qt.darker(color, 1.3)
- opacity: 0.8
- }
- Image {
- id: handle
- source: "images/slider_handle.png"
- anchors.verticalCenter: parent.verticalCenter
- MouseArea {
- id: mousearea
- anchors.fill: parent
- anchors.margins: -4
- drag.target: parent
- drag.axis: Drag.XAxis
- drag.minimumX: Math.round(-handle.width / 2 + 3)
- drag.maximumX: Math.round(foo.width - handle.width/2 - 3)
- property real value: (handle.x - drag.minimumX) / (drag.maximumX - drag.minimumX)
- }
- }
- }
-}
diff --git a/examples/demos/shared/TabSet.qml b/examples/demos/shared/TabSet.qml
deleted file mode 100644
index d66aa336..00000000
--- a/examples/demos/shared/TabSet.qml
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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.0
-import QtQuick.Window 2.1
-
-Item {
- id: tabWidget
-
- // Setting the default property to stack.children means any child items
- // of the TabWidget are actually added to the 'stack' item's children.
- // See the "Property Binding"
- // documentation for details on default properties.
- default property alias content: stack.children
-
- property int current: 0
-
- onCurrentChanged: setZOrders()
- Component.onCompleted: setZOrders()
-
- function setZOrders() {
- for (var i = 0; i < stack.children.length; ++i) {
- stack.children[i].z = (i == current ? 1 : 0)
- stack.children[i].enabled = (i == current)
- }
- }
-
- Row {
- id: header
-
- Repeater {
- model: stack.children.length
- delegate: Rectangle {
- width: tabWidget.width / stack.children.length
- height: Math.max(Screen.pixelDensity * 7, label.implicitHeight * 1.2)
-
- Rectangle {
- width: parent.width; height: 1
- anchors { bottom: parent.bottom; bottomMargin: 1 }
- color: "#acb2c2"
- }
- BorderImage {
- anchors { fill: parent; leftMargin: 2; topMargin: 5; rightMargin: 1 }
- border { left: 7; right: 7 }
- source: "images/tab.png"
- visible: tabWidget.current == index
- }
- Text {
- id: label
- horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter
- anchors.fill: parent
- text: stack.children[index].title
- elide: Text.ElideRight
- font.bold: tabWidget.current == index
- }
- MouseArea {
- anchors.fill: parent
- onClicked: tabWidget.current = index
- }
- }
- }
- }
-
- Item {
- id: stack
- width: tabWidget.width
- anchors.top: header.bottom; anchors.bottom: tabWidget.bottom
- }
-}
diff --git a/examples/demos/shared/TextField.qml b/examples/demos/shared/TextField.qml
deleted file mode 100644
index 05e04801..00000000
--- a/examples/demos/shared/TextField.qml
+++ /dev/null
@@ -1,90 +0,0 @@
-/*****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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.1
-
-Item {
- id: root
-
- property alias textInput: textInput
- property alias text: textInput.text
- signal accepted
- signal downPressed
- implicitWidth: textInput.implicitWidth + rect.radius * 2
- implicitHeight: textInput.implicitHeight
-
- function copyAll() {
- textInput.selectAll()
- textInput.copy()
- }
-
- SystemPalette { id: palette }
- height: textInput.implicitHeight + 8
- clip: true
-
- Rectangle {
- id: rect
- anchors.fill: parent
- radius: height / 4
- color: palette.button
- border.color: Qt.darker(palette.button, 1.5)
- }
-
- TextInput {
- id: textInput
- color: palette.text
- anchors.fill: parent
- anchors.leftMargin: rect.radius
- anchors.rightMargin: rect.radius
- verticalAlignment: Text.AlignVCenter
- onAccepted: root.accepted()
- Keys.onDownPressed: root.downPressed()
- }
-}
diff --git a/examples/demos/shared/images/back.png b/examples/demos/shared/images/back.png
deleted file mode 100644
index 53402096..00000000
--- a/examples/demos/shared/images/back.png
+++ /dev/null
Binary files differ
diff --git a/examples/demos/shared/images/checkmark.png b/examples/demos/shared/images/checkmark.png
deleted file mode 100644
index 821aafcc..00000000
--- a/examples/demos/shared/images/checkmark.png
+++ /dev/null
Binary files differ
diff --git a/examples/demos/shared/images/next.png b/examples/demos/shared/images/next.png
deleted file mode 100644
index cdef8db6..00000000
--- a/examples/demos/shared/images/next.png
+++ /dev/null
Binary files differ
diff --git a/examples/demos/shared/images/qt-logo.png b/examples/demos/shared/images/qt-logo.png
deleted file mode 100644
index ecbff0ca..00000000
--- a/examples/demos/shared/images/qt-logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/demos/shared/images/slider_handle.png b/examples/demos/shared/images/slider_handle.png
deleted file mode 100644
index 63c518be..00000000
--- a/examples/demos/shared/images/slider_handle.png
+++ /dev/null
Binary files differ
diff --git a/examples/demos/shared/images/tab.png b/examples/demos/shared/images/tab.png
deleted file mode 100644
index 2ea989b6..00000000
--- a/examples/demos/shared/images/tab.png
+++ /dev/null
Binary files differ
diff --git a/examples/demos/shared/qmldir b/examples/demos/shared/qmldir
deleted file mode 100644
index b539191f..00000000
--- a/examples/demos/shared/qmldir
+++ /dev/null
@@ -1,7 +0,0 @@
-Button 2.0 Button.qml
-CheckBox 2.1 CheckBox.qml
-LauncherList 2.0 LauncherList.qml
-SimpleLauncherDelegate 2.0 SimpleLauncherDelegate.qml
-Slider 2.0 Slider.qml
-TabSet 2.1 TabSet.qml
-TextField 2.1 TextField.qml
diff --git a/examples/demos/shared/quick_shared.qrc b/examples/demos/shared/quick_shared.qrc
deleted file mode 100644
index 21f393a6..00000000
--- a/examples/demos/shared/quick_shared.qrc
+++ /dev/null
@@ -1,15 +0,0 @@
-<RCC>
- <qresource prefix="/quick/shared">
- <file>LauncherList.qml</file>
- <file>SimpleLauncherDelegate.qml</file>
- <file>Button.qml</file>
- <file>CheckBox.qml</file>
- <file>Label.qml</file>
- <file>TextField.qml</file>
- <file>images/back.png</file>
- <file>images/next.png</file>
- <file>images/checkmark.png</file>
- <file>Slider.qml</file>
- <file>images/slider_handle.png</file>
- </qresource>
-</RCC>
diff --git a/examples/demos/shared/shared.h b/examples/demos/shared/shared.h
deleted file mode 100644
index 18e7ff05..00000000
--- a/examples/demos/shared/shared.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 <QDir>
-#include <QGuiApplication>
-#include <QQmlEngine>
-#include <QQmlFileSelector>
-#include <QQuickView> //Not using QQmlApplicationEngine because many examples don't have a Window{}
-#define DECLARATIVE_EXAMPLE_MAIN(NAME) int main(int argc, char* argv[]) \
-{\
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);\
- QGuiApplication app(argc,argv);\
- app.setOrganizationName("QtProject");\
- app.setOrganizationDomain("qt-project.org");\
- app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName());\
- QQuickView view;\
- if (qgetenv("QT_QUICK_CORE_PROFILE").toInt()) {\
- QSurfaceFormat f = view.format();\
- f.setProfile(QSurfaceFormat::CoreProfile);\
- f.setVersion(4, 4);\
- view.setFormat(f);\
- }\
- if (qgetenv("QT_QUICK_MULTISAMPLE").toInt()) {\
- QSurfaceFormat f = view.format();\
- f.setSamples(4);\
- view.setFormat(f);\
- }\
- view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);\
- new QQmlFileSelector(view.engine(), &view);\
- view.setSource(QUrl("qrc:///" #NAME ".qml")); \
- if (view.status() == QQuickView::Error)\
- return -1;\
- view.setResizeMode(QQuickView::SizeRootObjectToView);\
- view.show();\
- return app.exec();\
-}
diff --git a/examples/demos/shared/shared.qrc b/examples/demos/shared/shared.qrc
deleted file mode 100644
index 89b3ff75..00000000
--- a/examples/demos/shared/shared.qrc
+++ /dev/null
@@ -1,18 +0,0 @@
-<RCC>
- <qresource prefix="/shared">
- <file>LauncherList.qml</file>
- <file>SimpleLauncherDelegate.qml</file>
- <file>Button.qml</file>
- <file>Slider.qml</file>
- <file>images/slider_handle.png</file>
- <file>CheckBox.qml</file>
- <file>Label.qml</file>
- <file>TabSet.qml</file>
- <file>TextField.qml</file>
- <file>images/back.png</file>
- <file>images/next.png</file>
- <file>images/qt-logo.png</file>
- <file>images/checkmark.png</file>
- <file>images/tab.png</file>
- </qresource>
-</RCC>
diff --git a/examples/demos/stocqt/main.cpp b/examples/demos/stocqt/main.cpp
index b91d7543..7c0da8af 100644
--- a/examples/demos/stocqt/main.cpp
+++ b/examples/demos/stocqt/main.cpp
@@ -47,5 +47,25 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/stocqt/stocqt)
+
+#include <QGuiApplication>
+#include <QQmlEngine>
+#include <QQmlFileSelector>
+#include <QQuickView>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QCoreApplication::setOrganizationName("QtExamples");
+
+ QGuiApplication app(argc, argv);
+
+ QQuickView view;
+ view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);
+ view.setSource(QUrl("qrc:/demos/stocqt/stocqt.qml"));
+ if (view.status() == QQuickView::Error)
+ return -1;
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.show();
+ return app.exec();
+}
diff --git a/examples/demos/tweetsearch/main.cpp b/examples/demos/tweetsearch/main.cpp
index 508d34e9..2e92a07d 100644
--- a/examples/demos/tweetsearch/main.cpp
+++ b/examples/demos/tweetsearch/main.cpp
@@ -47,5 +47,25 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/tweetsearch/tweetsearch)
+
+#include <QGuiApplication>
+#include <QQmlEngine>
+#include <QQmlFileSelector>
+#include <QQuickView>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QCoreApplication::setOrganizationName("QtExamples");
+
+ QGuiApplication app(argc, argv);
+
+ QQuickView view;
+ view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);
+ view.setSource(QUrl("qrc:/demos/tweetsearch/tweetsearch.qml"));
+ if (view.status() == QQuickView::Error)
+ return -1;
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.show();
+ return app.exec();
+}