diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index ffa4d71d120bc3fab84890e42d2f8d463f2a3088..fbeb359bb2007932b165729ab0f5580dae5b278d 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -159,3 +159,73 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." \endcode */ + +/*! + \page qtopenglextensions.html + \title The QtOpenGLExtensions Library + \ingroup licensing + \brief Commercial and \l{BSD 3-clause "New" or "Revised" License}. + + QtOpenGLExtensions is a library that contains auto-generated wrappers + for OpenGL extensions from the Khronos registry. + + To include the definitions of the module, use the following directive: + + \code + #include <QtOpenGLExtensions> + \endcode + + To link against the module, add this line to your qmake .pro file: + + \code + QT += openglextensions + \endcode + + Because applications do typically use only few extensions, the library is + statically linked with the application. To avoid issues with + \l{GNU Lesser General Public License (LGPL)} in this case, the library is + licensed both under the commercial licenses, and the + \l{BSD 3-clause "New" or "Revised" License}. + + \section1 License Information + + \badcode + 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." + \endcode +*/ diff --git a/examples/demos/calqlatr/calqlatr.pro b/examples/demos/calqlatr/calqlatr.pro index 19ed61c6ea128734930f804b2ba378eb686f6b8f..0c114b5f0f11785d51163ee6a76350bf1bbd2e0d 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 6e25fc639d200a0b36e884f6a7310e5b71bf665f..6b5b59c2b7d7eccd4a9ff36200cc487e70d7485d 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 c2508dc6a3a9b1dc28679173fa0a2a28c950b879..5889eabad89c5f8022ff2d6c5fcedb3fc5ef2e67 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 baf372125fc4912cf1adebaf9afe69e4d841d3a0..cfc426c8d64692f2f79f7b6253ad1927c05082ad 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 7bbd83c46ce84b9ba863a1aaecad64fc95549e0f..9588c0654341b0c6fa5a870e2d7f30ab9c944863 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 8ac1f7ab4d81c42365b9eec7e04262a829d39e89..4053c94e24931fbba34c08742fd8249e692fb847 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 8abce273bdcb13012eef27d76829a6b38567b4d1..0000000000000000000000000000000000000000 --- 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 bcf8178f74edeaeff13b2bd935140e6af87b1796..0000000000000000000000000000000000000000 --- 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 acbffb8dfac41c13014892d8114b081aa5078ba0..0000000000000000000000000000000000000000 --- 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 e532b53e7f6fa765dabe3c657d2364d188469239..0000000000000000000000000000000000000000 --- 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 2bf26d7c888f58773d442454cb8bd88e83cd95ad..0000000000000000000000000000000000000000 --- 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 86a3b0dfd33ee9355d0e8076b11ec619d0aa1796..0000000000000000000000000000000000000000 --- 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 28f92446d0eb5eb9d00420c8eca1104da4399dac..0000000000000000000000000000000000000000 --- 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 d66aa33634cc593b12d89721189853caea2f2968..0000000000000000000000000000000000000000 --- 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 05e048011abf8158ca8efb4fbc9fb2375a7a7d40..0000000000000000000000000000000000000000 --- 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 53402096b294d5f7afdbbd36f5f13f68d7eb945e..0000000000000000000000000000000000000000 Binary files a/examples/demos/shared/images/back.png and /dev/null differ diff --git a/examples/demos/shared/images/checkmark.png b/examples/demos/shared/images/checkmark.png deleted file mode 100644 index 821aafccdd700f2a96f0dafd3c169876ef46af5f..0000000000000000000000000000000000000000 Binary files a/examples/demos/shared/images/checkmark.png and /dev/null differ diff --git a/examples/demos/shared/images/next.png b/examples/demos/shared/images/next.png deleted file mode 100644 index cdef8db6e8227ae8202a184bd9d2477aaa4f6f2d..0000000000000000000000000000000000000000 Binary files a/examples/demos/shared/images/next.png and /dev/null differ diff --git a/examples/demos/shared/images/qt-logo.png b/examples/demos/shared/images/qt-logo.png deleted file mode 100644 index ecbff0ca36763f5ec81557e8f566f443b285ffb7..0000000000000000000000000000000000000000 Binary files a/examples/demos/shared/images/qt-logo.png and /dev/null differ diff --git a/examples/demos/shared/images/slider_handle.png b/examples/demos/shared/images/slider_handle.png deleted file mode 100644 index 63c518be7d7669e474dd119cce67a6bb9ee5aebe..0000000000000000000000000000000000000000 Binary files a/examples/demos/shared/images/slider_handle.png and /dev/null differ diff --git a/examples/demos/shared/images/tab.png b/examples/demos/shared/images/tab.png deleted file mode 100644 index 2ea989b68ded5ce002dcacb5d37518059a0b801b..0000000000000000000000000000000000000000 Binary files a/examples/demos/shared/images/tab.png and /dev/null differ diff --git a/examples/demos/shared/qmldir b/examples/demos/shared/qmldir deleted file mode 100644 index b539191fecc6c09ff8a84d6f4b39c289680c6080..0000000000000000000000000000000000000000 --- 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 21f393a64d1c505d90d7492e38c10da1a2bdf35b..0000000000000000000000000000000000000000 --- 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 18e7ff056b17ae6f5ee131ae8dc64ffe827676d4..0000000000000000000000000000000000000000 --- 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 89b3ff757ef86bd6d433a3e87109f1138d67b359..0000000000000000000000000000000000000000 --- 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 b91d7543c243dfdbc070c09e5f92fb6ef5acaf42..7c0da8afbc65c373907ddd7059d41d8b031bc001 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 508d34e91d76c015009e8c1afc4b044d2bd866da..2e92a07d526d6ace02cc84f6b79b0c33407416dd 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(); +}