From cf32b66adbfb489cd6e5d5c0bf3f741b59ba204c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 15 Sep 2022 13:21:53 +0200 Subject: Move examples around Change the directory structure to closer match that of Qt. Task-number: PYSIDE-841 Change-Id: I87aca346b6654aafe94dd1fb83c184c182ceb2e6 Reviewed-by: Qt CI Bot Reviewed-by: Cristian Maureira-Fredes --- .../declarative/editingmodel/MovingRectangle.qml | 78 - .../declarative/editingmodel/doc/editingmodel.rst | 14 - .../editingmodel/doc/qabstractlistmodelqml.png | Bin 45810 -> 0 bytes examples/declarative/editingmodel/main.py | 21 - examples/declarative/editingmodel/main.pyproject | 3 - examples/declarative/editingmodel/main.qml | 106 -- examples/declarative/editingmodel/model.py | 157 -- .../declarative/extending/chapter1-basics/app.qml | 27 - .../extending/chapter1-basics/basics.py | 68 - .../chapter1-basics/chapter1-basics.pyproject | 3 - .../declarative/extending/chapter2-methods/app.qml | 33 - .../chapter2-methods/chapter2-methods.pyproject | 3 - .../extending/chapter2-methods/methods.py | 75 - .../extending/chapter3-bindings/app.qml | 41 - .../extending/chapter3-bindings/bindings.py | 79 - .../chapter3-bindings/chapter3-bindings.pyproject | 3 - .../extending/chapter4-customPropertyTypes/app.qml | 23 - .../chapter4-customPropertyTypes.pyproject | 3 - .../customPropertyTypes.py | 82 - .../extending/chapter5-listproperties/app.qml | 33 - .../chapter5-listproperties.pyproject | 3 - .../chapter5-listproperties/listproperties.py | 96 - .../extending/chapter6-plugins/Charts/piechart.py | 40 - .../extending/chapter6-plugins/Charts/pieslice.py | 52 - .../extending/chapter6-plugins/Charts/plugins.png | Bin 5014 -> 0 bytes .../declarative/extending/chapter6-plugins/app.qml | 32 - .../chapter6-plugins/chapter6-plugins.pyproject | 3 - .../chapter6-plugins/doc/chapter6-plugins.rst | 21 - .../extending/chapter6-plugins/doc/plugins.png | Bin 5014 -> 0 bytes .../objectlistmodel/doc/objectlistmodel.png | Bin 1327 -> 0 bytes .../objectlistmodel/doc/objectlistmodel.rst | 12 - .../declarative/objectlistmodel/objectlistmodel.py | 61 - .../objectlistmodel/objectlistmodel.pyproject | 3 - examples/declarative/objectlistmodel/view.qml | 15 - .../openglunderqml/doc/openglunderqml.rst | 21 - .../declarative/openglunderqml/doc/squircle.png | Bin 37963 -> 0 bytes examples/declarative/openglunderqml/main.py | 27 - examples/declarative/openglunderqml/main.qml | 39 - .../openglunderqml/openglunderqml.pyproject | 3 - examples/declarative/openglunderqml/squircle.py | 79 - .../declarative/openglunderqml/squirclerenderer.py | 99 - .../referenceexamples/adding/adding.pyproject | 5 - .../referenceexamples/adding/doc/adding.rst | 67 - .../referenceexamples/adding/example.qml | 9 - .../declarative/referenceexamples/adding/main.py | 30 - .../declarative/referenceexamples/adding/person.py | 35 - .../referenceexamples/attached/attached.pyproject | 3 - .../referenceexamples/attached/birthdayparty.py | 63 - .../referenceexamples/attached/doc/attached.rst | 12 - .../referenceexamples/attached/example.qml | 22 - .../declarative/referenceexamples/attached/main.py | 46 - .../referenceexamples/attached/person.py | 46 - .../referenceexamples/binding/binding.pyproject | 3 - .../referenceexamples/binding/birthdayparty.py | 83 - .../referenceexamples/binding/doc/binding.rst | 17 - .../referenceexamples/binding/example.qml | 29 - .../referenceexamples/binding/happybirthdaysong.py | 47 - .../declarative/referenceexamples/binding/main.py | 52 - .../referenceexamples/binding/person.py | 53 - .../referenceexamples/coercion/birthdayparty.py | 41 - .../referenceexamples/coercion/coercion.pyproject | 3 - .../referenceexamples/coercion/doc/coercion.rst | 35 - .../referenceexamples/coercion/example.qml | 16 - .../declarative/referenceexamples/coercion/main.py | 36 - .../referenceexamples/coercion/person.py | 47 - .../referenceexamples/default/birthdayparty.py | 42 - .../referenceexamples/default/default.pyproject | 3 - .../referenceexamples/default/doc/default.rst | 30 - .../referenceexamples/default/example.qml | 15 - .../declarative/referenceexamples/default/main.py | 36 - .../referenceexamples/default/person.py | 46 - .../referenceexamples/extended/doc/extended.rst | 41 - .../referenceexamples/extended/example.qml | 8 - .../referenceexamples/extended/extended.pyproject | 3 - .../declarative/referenceexamples/extended/main.py | 95 - .../referenceexamples/grouped/birthdayparty.py | 42 - .../referenceexamples/grouped/doc/grouped.rst | 17 - .../referenceexamples/grouped/example.qml | 33 - .../referenceexamples/grouped/grouped.pyproject | 3 - .../declarative/referenceexamples/grouped/main.py | 43 - .../referenceexamples/grouped/person.py | 85 - .../referenceexamples/methods/birthdayparty.py | 47 - .../referenceexamples/methods/doc/methods.rst | 15 - .../referenceexamples/methods/example.qml | 19 - .../declarative/referenceexamples/methods/main.py | 32 - .../referenceexamples/methods/methods.pyproject | 3 - .../referenceexamples/methods/person.py | 34 - .../referenceexamples/properties/birthdayparty.py | 41 - .../properties/doc/properties.rst | 89 - .../referenceexamples/properties/example.qml | 16 - .../referenceexamples/properties/main.py | 34 - .../referenceexamples/properties/person.py | 35 - .../properties/properties.pyproject | 6 - .../referenceexamples/valuesource/birthdayparty.py | 76 - .../valuesource/doc/valuesource.rst | 20 - .../referenceexamples/valuesource/example.qml | 27 - .../valuesource/happybirthdaysong.py | 47 - .../referenceexamples/valuesource/main.py | 51 - .../referenceexamples/valuesource/person.py | 46 - .../valuesource/valuesource.pyproject | 3 - .../rendercontrol_opengl/cuberenderer.py | 186 -- .../rendercontrol/rendercontrol_opengl/demo.qml | 161 -- .../doc/rendercontrol_opengl.rst | 5 - .../rendercontrol/rendercontrol_opengl/main.py | 20 - .../rendercontrol_opengl.pyproject | 6 - .../rendercontrol_opengl/window_singlethreaded.py | 275 --- examples/declarative/shared/Button.qml | 50 - examples/declarative/shared/CheckBox.qml | 59 - examples/declarative/shared/FlickrRssModel.qml | 45 - examples/declarative/shared/Images.qml | 14 - examples/declarative/shared/Label.qml | 9 - examples/declarative/shared/LauncherList.qml | 205 --- examples/declarative/shared/README | 11 - .../declarative/shared/SimpleLauncherDelegate.qml | 96 - examples/declarative/shared/Slider.qml | 82 - examples/declarative/shared/TabSet.qml | 69 - examples/declarative/shared/TextField.qml | 43 - examples/declarative/shared/images/back.png | Bin 1590 -> 0 bytes examples/declarative/shared/images/checkmark.png | Bin 809 -> 0 bytes examples/declarative/shared/images/next.png | Bin 1371 -> 0 bytes examples/declarative/shared/images/qt-logo.png | Bin 6208 -> 0 bytes .../declarative/shared/images/slider_handle.png | Bin 887 -> 0 bytes examples/declarative/shared/images/tab.png | Bin 309 -> 0 bytes examples/declarative/shared/qmldir | 11 - examples/declarative/shared/quick_shared.qrc | 15 - examples/declarative/shared/shared.qrc | 21 - examples/declarative/shared/shared_rc.py | 1884 -------------------- examples/declarative/signals/pytoqml1/main.py | 31 - .../signals/pytoqml1/pytoqml1.pyproject | 3 - examples/declarative/signals/pytoqml1/view.qml | 36 - examples/declarative/signals/pytoqml2/main.py | 54 - .../signals/pytoqml2/pytoqml2.pyproject | 3 - examples/declarative/signals/pytoqml2/view.qml | 30 - examples/declarative/signals/qmltopy1/main.py | 50 - .../signals/qmltopy1/qmltopy1.pyproject | 3 - examples/declarative/signals/qmltopy1/view.qml | 54 - examples/declarative/signals/qmltopy2/main.py | 45 - .../signals/qmltopy2/qmltopy2.pyproject | 3 - examples/declarative/signals/qmltopy2/view.qml | 49 - examples/declarative/signals/qmltopy3/main.py | 33 - .../signals/qmltopy3/qmltopy3.pyproject | 3 - examples/declarative/signals/qmltopy3/view.qml | 66 - examples/declarative/signals/qmltopy4/main.py | 33 - .../signals/qmltopy4/qmltopy4.pyproject | 3 - examples/declarative/signals/qmltopy4/view.qml | 31 - .../stringlistmodel/doc/stringlistmodel.png | Bin 1978 -> 0 bytes .../stringlistmodel/doc/stringlistmodel.rst | 9 - .../declarative/stringlistmodel/stringlistmodel.py | 26 - .../stringlistmodel/stringlistmodel.pyproject | 3 - examples/declarative/stringlistmodel/view.qml | 17 - .../textproperties/doc/textproperties.png | Bin 14082 -> 0 bytes .../textproperties/doc/textproperties.rst | 9 - examples/declarative/textproperties/main.py | 76 - .../textproperties/textproperties.pyproject | 3 - examples/declarative/textproperties/view.qml | 160 -- examples/declarative/usingmodel/doc/usingmodel.png | Bin 2791 -> 0 bytes examples/declarative/usingmodel/doc/usingmodel.rst | 9 - examples/declarative/usingmodel/usingmodel.py | 70 - .../declarative/usingmodel/usingmodel.pyproject | 3 - examples/declarative/usingmodel/view.qml | 29 - examples/declarative/window/AllScreens.qml | 42 - examples/declarative/window/CurrentScreen.qml | 83 - examples/declarative/window/Splash.qml | 42 - examples/declarative/window/doc/window.png | Bin 9863 -> 0 bytes examples/declarative/window/doc/window.rst | 35 - examples/declarative/window/main.py | 37 - examples/declarative/window/resources/icon.icns | Bin 59662 -> 0 bytes examples/declarative/window/resources/icon.ico | Bin 11825 -> 0 bytes examples/declarative/window/resources/icon.svg | 208 --- examples/declarative/window/resources/icon64.png | Bin 3004 -> 0 bytes examples/declarative/window/window.pyproject | 3 - examples/declarative/window/window.qml | 151 -- examples/declarative/window/window.qrc | 8 - examples/declarative/window/window_rc.py | 328 ---- 174 files changed, 8589 deletions(-) delete mode 100644 examples/declarative/editingmodel/MovingRectangle.qml delete mode 100644 examples/declarative/editingmodel/doc/editingmodel.rst delete mode 100644 examples/declarative/editingmodel/doc/qabstractlistmodelqml.png delete mode 100644 examples/declarative/editingmodel/main.py delete mode 100644 examples/declarative/editingmodel/main.pyproject delete mode 100644 examples/declarative/editingmodel/main.qml delete mode 100644 examples/declarative/editingmodel/model.py delete mode 100644 examples/declarative/extending/chapter1-basics/app.qml delete mode 100644 examples/declarative/extending/chapter1-basics/basics.py delete mode 100644 examples/declarative/extending/chapter1-basics/chapter1-basics.pyproject delete mode 100644 examples/declarative/extending/chapter2-methods/app.qml delete mode 100644 examples/declarative/extending/chapter2-methods/chapter2-methods.pyproject delete mode 100644 examples/declarative/extending/chapter2-methods/methods.py delete mode 100644 examples/declarative/extending/chapter3-bindings/app.qml delete mode 100644 examples/declarative/extending/chapter3-bindings/bindings.py delete mode 100644 examples/declarative/extending/chapter3-bindings/chapter3-bindings.pyproject delete mode 100644 examples/declarative/extending/chapter4-customPropertyTypes/app.qml delete mode 100644 examples/declarative/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pyproject delete mode 100644 examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py delete mode 100644 examples/declarative/extending/chapter5-listproperties/app.qml delete mode 100644 examples/declarative/extending/chapter5-listproperties/chapter5-listproperties.pyproject delete mode 100644 examples/declarative/extending/chapter5-listproperties/listproperties.py delete mode 100644 examples/declarative/extending/chapter6-plugins/Charts/piechart.py delete mode 100644 examples/declarative/extending/chapter6-plugins/Charts/pieslice.py delete mode 100644 examples/declarative/extending/chapter6-plugins/Charts/plugins.png delete mode 100644 examples/declarative/extending/chapter6-plugins/app.qml delete mode 100644 examples/declarative/extending/chapter6-plugins/chapter6-plugins.pyproject delete mode 100644 examples/declarative/extending/chapter6-plugins/doc/chapter6-plugins.rst delete mode 100644 examples/declarative/extending/chapter6-plugins/doc/plugins.png delete mode 100644 examples/declarative/objectlistmodel/doc/objectlistmodel.png delete mode 100644 examples/declarative/objectlistmodel/doc/objectlistmodel.rst delete mode 100644 examples/declarative/objectlistmodel/objectlistmodel.py delete mode 100644 examples/declarative/objectlistmodel/objectlistmodel.pyproject delete mode 100644 examples/declarative/objectlistmodel/view.qml delete mode 100644 examples/declarative/openglunderqml/doc/openglunderqml.rst delete mode 100644 examples/declarative/openglunderqml/doc/squircle.png delete mode 100644 examples/declarative/openglunderqml/main.py delete mode 100644 examples/declarative/openglunderqml/main.qml delete mode 100644 examples/declarative/openglunderqml/openglunderqml.pyproject delete mode 100644 examples/declarative/openglunderqml/squircle.py delete mode 100644 examples/declarative/openglunderqml/squirclerenderer.py delete mode 100644 examples/declarative/referenceexamples/adding/adding.pyproject delete mode 100644 examples/declarative/referenceexamples/adding/doc/adding.rst delete mode 100644 examples/declarative/referenceexamples/adding/example.qml delete mode 100644 examples/declarative/referenceexamples/adding/main.py delete mode 100644 examples/declarative/referenceexamples/adding/person.py delete mode 100644 examples/declarative/referenceexamples/attached/attached.pyproject delete mode 100644 examples/declarative/referenceexamples/attached/birthdayparty.py delete mode 100644 examples/declarative/referenceexamples/attached/doc/attached.rst delete mode 100644 examples/declarative/referenceexamples/attached/example.qml delete mode 100644 examples/declarative/referenceexamples/attached/main.py delete mode 100644 examples/declarative/referenceexamples/attached/person.py delete mode 100644 examples/declarative/referenceexamples/binding/binding.pyproject delete mode 100644 examples/declarative/referenceexamples/binding/birthdayparty.py delete mode 100644 examples/declarative/referenceexamples/binding/doc/binding.rst delete mode 100644 examples/declarative/referenceexamples/binding/example.qml delete mode 100644 examples/declarative/referenceexamples/binding/happybirthdaysong.py delete mode 100644 examples/declarative/referenceexamples/binding/main.py delete mode 100644 examples/declarative/referenceexamples/binding/person.py delete mode 100644 examples/declarative/referenceexamples/coercion/birthdayparty.py delete mode 100644 examples/declarative/referenceexamples/coercion/coercion.pyproject delete mode 100644 examples/declarative/referenceexamples/coercion/doc/coercion.rst delete mode 100644 examples/declarative/referenceexamples/coercion/example.qml delete mode 100644 examples/declarative/referenceexamples/coercion/main.py delete mode 100644 examples/declarative/referenceexamples/coercion/person.py delete mode 100644 examples/declarative/referenceexamples/default/birthdayparty.py delete mode 100644 examples/declarative/referenceexamples/default/default.pyproject delete mode 100644 examples/declarative/referenceexamples/default/doc/default.rst delete mode 100644 examples/declarative/referenceexamples/default/example.qml delete mode 100644 examples/declarative/referenceexamples/default/main.py delete mode 100644 examples/declarative/referenceexamples/default/person.py delete mode 100644 examples/declarative/referenceexamples/extended/doc/extended.rst delete mode 100644 examples/declarative/referenceexamples/extended/example.qml delete mode 100644 examples/declarative/referenceexamples/extended/extended.pyproject delete mode 100644 examples/declarative/referenceexamples/extended/main.py delete mode 100644 examples/declarative/referenceexamples/grouped/birthdayparty.py delete mode 100644 examples/declarative/referenceexamples/grouped/doc/grouped.rst delete mode 100644 examples/declarative/referenceexamples/grouped/example.qml delete mode 100644 examples/declarative/referenceexamples/grouped/grouped.pyproject delete mode 100644 examples/declarative/referenceexamples/grouped/main.py delete mode 100644 examples/declarative/referenceexamples/grouped/person.py delete mode 100644 examples/declarative/referenceexamples/methods/birthdayparty.py delete mode 100644 examples/declarative/referenceexamples/methods/doc/methods.rst delete mode 100644 examples/declarative/referenceexamples/methods/example.qml delete mode 100644 examples/declarative/referenceexamples/methods/main.py delete mode 100644 examples/declarative/referenceexamples/methods/methods.pyproject delete mode 100644 examples/declarative/referenceexamples/methods/person.py delete mode 100644 examples/declarative/referenceexamples/properties/birthdayparty.py delete mode 100644 examples/declarative/referenceexamples/properties/doc/properties.rst delete mode 100644 examples/declarative/referenceexamples/properties/example.qml delete mode 100644 examples/declarative/referenceexamples/properties/main.py delete mode 100644 examples/declarative/referenceexamples/properties/person.py delete mode 100644 examples/declarative/referenceexamples/properties/properties.pyproject delete mode 100644 examples/declarative/referenceexamples/valuesource/birthdayparty.py delete mode 100644 examples/declarative/referenceexamples/valuesource/doc/valuesource.rst delete mode 100644 examples/declarative/referenceexamples/valuesource/example.qml delete mode 100644 examples/declarative/referenceexamples/valuesource/happybirthdaysong.py delete mode 100644 examples/declarative/referenceexamples/valuesource/main.py delete mode 100644 examples/declarative/referenceexamples/valuesource/person.py delete mode 100644 examples/declarative/referenceexamples/valuesource/valuesource.pyproject delete mode 100644 examples/declarative/rendercontrol/rendercontrol_opengl/cuberenderer.py delete mode 100644 examples/declarative/rendercontrol/rendercontrol_opengl/demo.qml delete mode 100644 examples/declarative/rendercontrol/rendercontrol_opengl/doc/rendercontrol_opengl.rst delete mode 100644 examples/declarative/rendercontrol/rendercontrol_opengl/main.py delete mode 100644 examples/declarative/rendercontrol/rendercontrol_opengl/rendercontrol_opengl.pyproject delete mode 100644 examples/declarative/rendercontrol/rendercontrol_opengl/window_singlethreaded.py delete mode 100644 examples/declarative/shared/Button.qml delete mode 100644 examples/declarative/shared/CheckBox.qml delete mode 100644 examples/declarative/shared/FlickrRssModel.qml delete mode 100644 examples/declarative/shared/Images.qml delete mode 100644 examples/declarative/shared/Label.qml delete mode 100644 examples/declarative/shared/LauncherList.qml delete mode 100644 examples/declarative/shared/README delete mode 100644 examples/declarative/shared/SimpleLauncherDelegate.qml delete mode 100644 examples/declarative/shared/Slider.qml delete mode 100644 examples/declarative/shared/TabSet.qml delete mode 100644 examples/declarative/shared/TextField.qml delete mode 100644 examples/declarative/shared/images/back.png delete mode 100644 examples/declarative/shared/images/checkmark.png delete mode 100644 examples/declarative/shared/images/next.png delete mode 100644 examples/declarative/shared/images/qt-logo.png delete mode 100644 examples/declarative/shared/images/slider_handle.png delete mode 100644 examples/declarative/shared/images/tab.png delete mode 100644 examples/declarative/shared/qmldir delete mode 100644 examples/declarative/shared/quick_shared.qrc delete mode 100644 examples/declarative/shared/shared.qrc delete mode 100644 examples/declarative/shared/shared_rc.py delete mode 100644 examples/declarative/signals/pytoqml1/main.py delete mode 100644 examples/declarative/signals/pytoqml1/pytoqml1.pyproject delete mode 100644 examples/declarative/signals/pytoqml1/view.qml delete mode 100644 examples/declarative/signals/pytoqml2/main.py delete mode 100644 examples/declarative/signals/pytoqml2/pytoqml2.pyproject delete mode 100644 examples/declarative/signals/pytoqml2/view.qml delete mode 100644 examples/declarative/signals/qmltopy1/main.py delete mode 100644 examples/declarative/signals/qmltopy1/qmltopy1.pyproject delete mode 100644 examples/declarative/signals/qmltopy1/view.qml delete mode 100644 examples/declarative/signals/qmltopy2/main.py delete mode 100644 examples/declarative/signals/qmltopy2/qmltopy2.pyproject delete mode 100644 examples/declarative/signals/qmltopy2/view.qml delete mode 100644 examples/declarative/signals/qmltopy3/main.py delete mode 100644 examples/declarative/signals/qmltopy3/qmltopy3.pyproject delete mode 100644 examples/declarative/signals/qmltopy3/view.qml delete mode 100644 examples/declarative/signals/qmltopy4/main.py delete mode 100644 examples/declarative/signals/qmltopy4/qmltopy4.pyproject delete mode 100644 examples/declarative/signals/qmltopy4/view.qml delete mode 100644 examples/declarative/stringlistmodel/doc/stringlistmodel.png delete mode 100644 examples/declarative/stringlistmodel/doc/stringlistmodel.rst delete mode 100644 examples/declarative/stringlistmodel/stringlistmodel.py delete mode 100644 examples/declarative/stringlistmodel/stringlistmodel.pyproject delete mode 100644 examples/declarative/stringlistmodel/view.qml delete mode 100644 examples/declarative/textproperties/doc/textproperties.png delete mode 100644 examples/declarative/textproperties/doc/textproperties.rst delete mode 100644 examples/declarative/textproperties/main.py delete mode 100644 examples/declarative/textproperties/textproperties.pyproject delete mode 100644 examples/declarative/textproperties/view.qml delete mode 100644 examples/declarative/usingmodel/doc/usingmodel.png delete mode 100644 examples/declarative/usingmodel/doc/usingmodel.rst delete mode 100644 examples/declarative/usingmodel/usingmodel.py delete mode 100644 examples/declarative/usingmodel/usingmodel.pyproject delete mode 100644 examples/declarative/usingmodel/view.qml delete mode 100644 examples/declarative/window/AllScreens.qml delete mode 100644 examples/declarative/window/CurrentScreen.qml delete mode 100644 examples/declarative/window/Splash.qml delete mode 100644 examples/declarative/window/doc/window.png delete mode 100644 examples/declarative/window/doc/window.rst delete mode 100644 examples/declarative/window/main.py delete mode 100644 examples/declarative/window/resources/icon.icns delete mode 100644 examples/declarative/window/resources/icon.ico delete mode 100644 examples/declarative/window/resources/icon.svg delete mode 100644 examples/declarative/window/resources/icon64.png delete mode 100644 examples/declarative/window/window.pyproject delete mode 100644 examples/declarative/window/window.qml delete mode 100644 examples/declarative/window/window.qrc delete mode 100644 examples/declarative/window/window_rc.py (limited to 'examples/declarative') diff --git a/examples/declarative/editingmodel/MovingRectangle.qml b/examples/declarative/editingmodel/MovingRectangle.qml deleted file mode 100644 index b99a5f4dc..000000000 --- a/examples/declarative/editingmodel/MovingRectangle.qml +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - - -import QtQuick -import QtQuick.Controls - -Rectangle { - id: root - property int modelIndex - property Item dragParent - property Item sizeParent - property alias text: zone.text - property alias bgColor: root.color - - anchors { - horizontalCenter: parent.horizontalCenter - verticalCenter: parent.verticalCenter - } - color: backgroundColor - anchors.fill: sizeParent - border.color: "yellow" - border.width: 0 - TextArea { - id: zone - anchors.centerIn: parent - text: display - onTextChanged: model.edit = text - } - - MouseArea { - id: zoneMouseArea - anchors.fill: parent - - acceptedButtons: Qt.MiddleButton - onClicked: function(mouse) { - if (mouse.button == Qt.MiddleButton) - lv.model.remove(index) - else - mouse.accepted = false - } - } - DragHandler { - id: dragHandler - xAxis { - - enabled: true - minimum: 0 - maximum: lv.width - droparea.width - } - yAxis.enabled: false - acceptedButtons: Qt.LeftButton - } - Drag.active: dragHandler.active - Drag.source: root - Drag.hotSpot.x: width / 2 - - states: [ - State { - when: dragHandler.active - ParentChange { - target: root - parent: root.dragParent - } - - AnchorChanges { - target: root - anchors.horizontalCenter: undefined - anchors.verticalCenter: undefined - } - PropertyChanges { - target: root - opacity: 0.6 - border.width: 3 - } - } - ] -} diff --git a/examples/declarative/editingmodel/doc/editingmodel.rst b/examples/declarative/editingmodel/doc/editingmodel.rst deleted file mode 100644 index d76bebc22..000000000 --- a/examples/declarative/editingmodel/doc/editingmodel.rst +++ /dev/null @@ -1,14 +0,0 @@ -QAbstractListModel in QML -========================= - -This example shows how to add, remove and move items inside a QML -ListView, but showing and editing the data via roles using a -QAbstractListModel from Python. - -You can add new elements and reset the view using the two top buttons, -remove elements by 'middle click' the element, and move the elements -with a 'left click' plus dragging the item around. - -.. image:: qabstractlistmodelqml.png - :width: 400 - :alt: QAbstractListModel/ListView Screenshot diff --git a/examples/declarative/editingmodel/doc/qabstractlistmodelqml.png b/examples/declarative/editingmodel/doc/qabstractlistmodelqml.png deleted file mode 100644 index 6e181fba1..000000000 Binary files a/examples/declarative/editingmodel/doc/qabstractlistmodelqml.png and /dev/null differ diff --git a/examples/declarative/editingmodel/main.py b/examples/declarative/editingmodel/main.py deleted file mode 100644 index 00b3ae2b1..000000000 --- a/examples/declarative/editingmodel/main.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import sys -from pathlib import Path - -from PySide6.QtCore import QUrl -from PySide6.QtGui import QGuiApplication -from PySide6.QtQml import QQmlApplicationEngine - -from model import BaseModel - -if __name__ == "__main__": - app = QGuiApplication(sys.argv) - engine = QQmlApplicationEngine() - qml_file = Path(__file__).parent / "main.qml" - engine.load(QUrl.fromLocalFile(qml_file)) - - if not engine.rootObjects(): - sys.exit(-1) - sys.exit(app.exec()) diff --git a/examples/declarative/editingmodel/main.pyproject b/examples/declarative/editingmodel/main.pyproject deleted file mode 100644 index 71272a973..000000000 --- a/examples/declarative/editingmodel/main.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["model.py","main.qml","main.py","MovingRectangle.qml"] -} diff --git a/examples/declarative/editingmodel/main.qml b/examples/declarative/editingmodel/main.qml deleted file mode 100644 index 2318ae8b3..000000000 --- a/examples/declarative/editingmodel/main.qml +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import QtQuick.Controls -import QtQuick.Window -import BaseModel - -Window { - title: "Moving Rectangle" - width: 800 - height: 480 - visible: true - id: mainWindow - - Column { - spacing: 20 - anchors.fill: parent - id: mainColumn - Text { - padding: 20 - font.pointSize: 10 - width: 600 - wrapMode: Text.Wrap - text: "This example shows how to add, remove and move items inside a QML ListView.\n -It shows and edits data via roles using QAbstractListModel on the Python side.\n -Use the 'Middle click' on top of a rectangle to remove an item.\n -'Left click' and drag to move the items." - } - - Button { - anchors { - left: mainColumn.left - right: mainColumn.right - margins: 30 - } - text: "Reset view" - onClicked: lv.model.reset() - } - - Button { - anchors { - left: mainColumn.left - right: mainColumn.right - margins: 30 - } - text: "Add element" - onClicked: lv.model.append() - } - - ListView { - id: lv - anchors { - left: mainColumn.left - right: mainColumn.right - margins: 30 - } - - height: 200 - model: BaseModel {} - orientation: ListView.Horizontal - displaced: Transition { - NumberAnimation { - properties: "x,y" - easing.type: Easing.OutQuad - } - } - delegate: DropArea { - id: droparea - width: ratio * lv.width - height: lv.height - - onEntered: function (drag) { - let dragindex = drag.source.modelIndex - if (index === dragindex) - return - lv.model.move(dragindex, index) - } - - MovingRectangle { - modelIndex: index - dragParent: lv - sizeParent: droparea - } - } - - MouseArea { - id: lvMousearea - anchors.fill: lv - z: -1 - } - Rectangle { - id: lvBackground - anchors.fill: lv - anchors.margins: -border.width - color: "white" - border.color: "black" - border.width: 5 - z: -1 - } - Component.onCompleted: { - lv.model.reset() - } - } - } -} diff --git a/examples/declarative/editingmodel/model.py b/examples/declarative/editingmodel/model.py deleted file mode 100644 index 591497872..000000000 --- a/examples/declarative/editingmodel/model.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - - -from PySide6.QtCore import (QAbstractListModel, QByteArray, QModelIndex, Qt, - Slot) -from PySide6.QtGui import QColor -from PySide6.QtQml import QmlElement - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "BaseModel" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class BaseModel(QAbstractListModel): - - RatioRole = Qt.UserRole + 1 - - def __init__(self, parent=None): - super().__init__(parent=parent) - self.db = [] - - def rowCount(self, parent=QModelIndex()): - return len(self.db) - - def roleNames(self): - default = super().roleNames() - default[self.RatioRole] = QByteArray(b"ratio") - default[Qt.BackgroundRole] = QByteArray(b"backgroundColor") - return default - - def data(self, index, role: int): - if not self.db: - ret = None - elif not index.isValid(): - ret = None - elif role == Qt.DisplayRole: - ret = self.db[index.row()]["text"] - elif role == Qt.BackgroundRole: - ret = self.db[index.row()]["bgColor"] - elif role == self.RatioRole: - ret = self.db[index.row()]["ratio"] - else: - ret = None - return ret - - def setData(self, index, value, role): - if not index.isValid(): - return False - if role == Qt.EditRole: - self.db[index.row()]["text"] = value - return True - - @Slot(result=bool) - def append(self): - """Slot to append a row at the end""" - return self.insertRow(self.rowCount()) - - def insertRow(self, row): - """Insert a single row at row""" - return self.insertRows(row, 0) - - def insertRows(self, row: int, count, index=QModelIndex()): - """Insert n rows (n = 1 + count) at row""" - - self.beginInsertRows(QModelIndex(), row, row + count) - - # start database work - if len(self.db): - newid = max(x["id"] for x in self.db) + 1 - else: - newid = 1 - for i in range(count + 1): # at least one row - self.db.insert( - row, {"id": newid, "text": "new", "bgColor": QColor("purple"), "ratio": 0.2} - ) - # end database work - self.endInsertRows() - return True - - @Slot(int, int, result=bool) - def move(self, source: int, target: int): - """Slot to move a single row from source to target""" - return self.moveRow(QModelIndex(), source, QModelIndex(), target) - - def moveRow(self, sourceParent, sourceRow, dstParent, dstChild): - """Move a single row""" - return self.moveRows(sourceParent, sourceRow, 0, dstParent, dstChild) - - def moveRows(self, sourceParent, sourceRow, count, dstParent, dstChild): - """Move n rows (n=1+ count) from sourceRow to dstChild""" - - if sourceRow == dstChild: - return False - - elif sourceRow > dstChild: - end = dstChild - - else: - end = dstChild + 1 - - self.beginMoveRows(QModelIndex(), sourceRow, sourceRow + count, QModelIndex(), end) - - # start database work - pops = self.db[sourceRow : sourceRow + count + 1] - if sourceRow > dstChild: - self.db = ( - self.db[:dstChild] - + pops - + self.db[dstChild:sourceRow] - + self.db[sourceRow + count + 1 :] - ) - else: - start = self.db[:sourceRow] - middle = self.db[dstChild : dstChild + 1] - endlist = self.db[dstChild + count + 1 :] - self.db = start + middle + pops + endlist - # end database work - - self.endMoveRows() - return True - - @Slot(int, result=bool) - def remove(self, row: int): - """Slot to remove one row""" - return self.removeRow(row) - - def removeRow(self, row, parent=QModelIndex()): - """Remove one row at index row""" - return self.removeRows(row, 0, parent) - - def removeRows(self, row: int, count: int, parent=QModelIndex()): - """Remove n rows (n=1+count) starting at row""" - self.beginRemoveRows(QModelIndex(), row, row + count) - - # start database work - self.db = self.db[:row] + self.db[row + count + 1 :] - # end database work - - self.endRemoveRows() - return True - - @Slot(result=bool) - def reset(self): - self.beginResetModel() - self.resetInternalData() # should work without calling it ? - self.endResetModel() - return True - - def resetInternalData(self): - self.db = [ - {"id": 3, "bgColor": QColor("red"), "ratio": 0.15, "text": "first"}, - {"id": 1, "bgColor": QColor("blue"), "ratio": 0.1, "text": "second"}, - {"id": 2, "bgColor": QColor("green"), "ratio": 0.2, "text": "third"}, - ] diff --git a/examples/declarative/extending/chapter1-basics/app.qml b/examples/declarative/extending/chapter1-basics/app.qml deleted file mode 100644 index 415183596..000000000 --- a/examples/declarative/extending/chapter1-basics/app.qml +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -//![0] -import Charts -import QtQuick - -Item { - width: 300; height: 200 - - PieChart { - id: aPieChart - anchors.centerIn: parent - width: 100; height: 100 - name: "A simple pie chart" - color: "red" - } - - Text { - anchors { - bottom: parent.bottom; - horizontalCenter: parent.horizontalCenter; - bottomMargin: 20 - } - text: aPieChart.name - } -} -//![0] diff --git a/examples/declarative/extending/chapter1-basics/basics.py b/examples/declarative/extending/chapter1-basics/basics.py deleted file mode 100644 index f76183705..000000000 --- a/examples/declarative/extending/chapter1-basics/basics.py +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/tutorials/extending-qml/chapter1-basics example from Qt v5.x""" - -import os -from pathlib import Path -import sys - -from PySide6.QtCore import Property, Signal, QUrl -from PySide6.QtGui import QGuiApplication, QPen, QPainter, QColor -from PySide6.QtQml import QmlElement -from PySide6.QtQuick import QQuickPaintedItem, QQuickView - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "Charts" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class PieChart (QQuickPaintedItem): - - nameChanged = Signal() - - def __init__(self, parent=None): - QQuickPaintedItem.__init__(self, parent) - self._name = u'' - self._color = QColor() - - def paint(self, painter): - pen = QPen(self.color, 2) - painter.setPen(pen) - painter.setRenderHints(QPainter.Antialiasing, True) - painter.drawPie(self.boundingRect().adjusted(1, 1, -1, -1), 90 * 16, 290 * 16) - - @Property(QColor) - def color(self): - return self._color - - @color.setter - def color(self, value): - self._color = value - - @Property(str, notify=nameChanged) - def name(self): - return self._name - - @name.setter - def name(self, value): - self._name = value - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - - view = QQuickView() - view.setResizeMode(QQuickView.SizeRootObjectToView) - qml_file = os.fspath(Path(__file__).resolve().parent / 'app.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - view.show() - res = app.exec() - # Deleting the view before it goes out of scope is required to make sure all child QML instances - # are destroyed in the correct order. - del view - sys.exit(res) diff --git a/examples/declarative/extending/chapter1-basics/chapter1-basics.pyproject b/examples/declarative/extending/chapter1-basics/chapter1-basics.pyproject deleted file mode 100644 index 869556bb8..000000000 --- a/examples/declarative/extending/chapter1-basics/chapter1-basics.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["basics.py", "app.qml"] -} diff --git a/examples/declarative/extending/chapter2-methods/app.qml b/examples/declarative/extending/chapter2-methods/app.qml deleted file mode 100644 index d330f3b64..000000000 --- a/examples/declarative/extending/chapter2-methods/app.qml +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -//![0] -import Charts -import QtQuick - -Item { - width: 300; height: 200 - - PieChart { - id: aPieChart - anchors.centerIn: parent - width: 100; height: 100 - color: "red" - - onChartCleared: console.log("The chart has been cleared") - } - - MouseArea { - anchors.fill: parent - onClicked: aPieChart.clearChart() - } - - Text { - anchors { - bottom: parent.bottom; - horizontalCenter: parent.horizontalCenter; - bottomMargin: 20 - } - text: "Click anywhere to clear the chart" - } -} -//![0] diff --git a/examples/declarative/extending/chapter2-methods/chapter2-methods.pyproject b/examples/declarative/extending/chapter2-methods/chapter2-methods.pyproject deleted file mode 100644 index cdf33be7f..000000000 --- a/examples/declarative/extending/chapter2-methods/chapter2-methods.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["methods.py", "app.qml"] -} diff --git a/examples/declarative/extending/chapter2-methods/methods.py b/examples/declarative/extending/chapter2-methods/methods.py deleted file mode 100644 index f8241db72..000000000 --- a/examples/declarative/extending/chapter2-methods/methods.py +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/tutorials/extending-qml/chapter2-methods example from Qt v5.x""" - -import os -from pathlib import Path -import sys - -from PySide6.QtCore import Property, Signal, Slot, Qt, QUrl -from PySide6.QtGui import QGuiApplication, QPen, QPainter, QColor -from PySide6.QtQml import QmlElement -from PySide6.QtQuick import QQuickPaintedItem, QQuickView - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "Charts" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class PieChart(QQuickPaintedItem): - - chartCleared = Signal() - nameChanged = Signal() - - def __init__(self, parent=None): - QQuickPaintedItem.__init__(self, parent) - self._name = u'' - self._color = QColor() - - def paint(self, painter): - pen = QPen(self.color, 2) - painter.setPen(pen) - painter.setRenderHints(QPainter.Antialiasing, True) - painter.drawPie(self.boundingRect().adjusted(1, 1, -1, -1), 90 * 16, 290 * 16) - - @Property(QColor) - def color(self): - return self._color - - @color.setter - def color(self, value): - self._color = value - - @Property(str, notify=nameChanged) - def name(self): - return self._name - - @name.setter - def name(self, value): - self._name = value - - @Slot() # This should be something like @Invokable - def clearChart(self): - self.color = Qt.transparent - self.update() - self.chartCleared.emit() - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - - view = QQuickView() - view.setResizeMode(QQuickView.SizeRootObjectToView) - qml_file = os.fspath(Path(__file__).resolve().parent / 'app.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - view.show() - res = app.exec() - # Deleting the view before it goes out of scope is required to make sure all child QML instances - # are destroyed in the correct order. - del view - sys.exit(res) diff --git a/examples/declarative/extending/chapter3-bindings/app.qml b/examples/declarative/extending/chapter3-bindings/app.qml deleted file mode 100644 index ee24a428a..000000000 --- a/examples/declarative/extending/chapter3-bindings/app.qml +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -//![0] -import Charts -import QtQuick - -Item { - width: 300; height: 200 - - Row { - anchors.centerIn: parent - spacing: 20 - - PieChart { - id: chartA - width: 100; height: 100 - color: "red" - } - - PieChart { - id: chartB - width: 100; height: 100 - color: chartA.color - } - } - - MouseArea { - anchors.fill: parent - onClicked: { chartA.color = "blue" } - } - - Text { - anchors { - bottom: parent.bottom; - horizontalCenter: parent.horizontalCenter; - bottomMargin: 20 - } - text: "Click anywhere to change the chart color" - } -} -//![0] diff --git a/examples/declarative/extending/chapter3-bindings/bindings.py b/examples/declarative/extending/chapter3-bindings/bindings.py deleted file mode 100644 index e50f08397..000000000 --- a/examples/declarative/extending/chapter3-bindings/bindings.py +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/tutorials/extending-qml/chapter3-bindings example from Qt v5.x""" - -import os -from pathlib import Path -import sys - -from PySide6.QtCore import Property, Signal, Slot, QUrl, Qt -from PySide6.QtGui import QGuiApplication, QPen, QPainter, QColor -from PySide6.QtQml import QmlElement -from PySide6.QtQuick import QQuickPaintedItem, QQuickView - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "Charts" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class PieChart (QQuickPaintedItem): - - chartCleared = Signal() - nameChanged = Signal() - colorChanged = Signal() - - def __init__(self, parent=None): - QQuickPaintedItem.__init__(self, parent) - self._name = u'' - self._color = QColor() - - def paint(self, painter): - pen = QPen(self._color, 2) - painter.setPen(pen) - painter.setRenderHints(QPainter.Antialiasing, True) - painter.drawPie(self.boundingRect().adjusted(1, 1, -1, -1), 90 * 16, 290 * 16) - - @Property(QColor, notify=colorChanged) - def color(self): - return self._color - - @color.setter - def color(self, value): - if value != self._color: - self._color = value - self.update() - self.colorChanged.emit() - - @Property(str, notify=nameChanged) - def name(self): - return self._name - - @name.setter - def name(self, value): - self._name = value - - @Slot() # This should be something like @Invokable - def clearChart(self): - self.color = Qt.transparent - self.update() - self.chartCleared.emit() - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - - view = QQuickView() - view.setResizeMode(QQuickView.SizeRootObjectToView) - qml_file = os.fspath(Path(__file__).resolve().parent / 'app.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - view.show() - res = app.exec() - # Deleting the view before it goes out of scope is required to make sure all child QML instances - # are destroyed in the correct order. - del view - sys.exit(res) diff --git a/examples/declarative/extending/chapter3-bindings/chapter3-bindings.pyproject b/examples/declarative/extending/chapter3-bindings/chapter3-bindings.pyproject deleted file mode 100644 index 6e21f86f9..000000000 --- a/examples/declarative/extending/chapter3-bindings/chapter3-bindings.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["app.qml", "bindings.py"] -} diff --git a/examples/declarative/extending/chapter4-customPropertyTypes/app.qml b/examples/declarative/extending/chapter4-customPropertyTypes/app.qml deleted file mode 100644 index 954e6465c..000000000 --- a/examples/declarative/extending/chapter4-customPropertyTypes/app.qml +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -//![0] -import Charts -import QtQuick - -Item { - width: 300; height: 200 - - PieChart { - id: chart - anchors.centerIn: parent - width: 100; height: 100 - - pieSlice: PieSlice { - anchors.fill: parent - color: "red" - } - } - - Component.onCompleted: console.log("The pie is colored " + chart.pieSlice.color) -} -//![0] diff --git a/examples/declarative/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pyproject b/examples/declarative/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pyproject deleted file mode 100644 index af1cfefb7..000000000 --- a/examples/declarative/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["app.qml", "customPropertyTypes.py"] -} diff --git a/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py b/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py deleted file mode 100644 index ee10f0894..000000000 --- a/examples/declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/tutorials/extending-qml/chapter4-customPropertyTypes example from Qt v5.x""" - -import os -from pathlib import Path -import sys - -from PySide6.QtCore import Property, QUrl -from PySide6.QtGui import QGuiApplication, QPen, QPainter, QColor -from PySide6.QtQml import QmlElement -from PySide6.QtQuick import QQuickPaintedItem, QQuickView, QQuickItem - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "Charts" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class PieSlice (QQuickPaintedItem): - - def __init__(self, parent=None): - QQuickPaintedItem.__init__(self, parent) - self._color = QColor() - - @Property(QColor) - def color(self): - return self._color - - @color.setter - def color(self, value): - self._color = value - - def paint(self, painter): - pen = QPen(self._color, 2) - painter.setPen(pen) - painter.setRenderHints(QPainter.Antialiasing, True) - painter.drawPie(self.boundingRect().adjusted(1, 1, -1, -1), 90 * 16, 290 * 16) - - -@QmlElement -class PieChart (QQuickItem): - def __init__(self, parent=None): - QQuickItem.__init__(self, parent) - self._name = None - self._pieSlice = None - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, value): - self._name = value - - @Property(PieSlice) - def pieSlice(self): - return self._pieSlice - - @pieSlice.setter - def pieSlice(self, value): - self._pieSlice = value - self._pieSlice.setParentItem(self) - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - - view = QQuickView() - view.setResizeMode(QQuickView.SizeRootObjectToView) - qml_file = os.fspath(Path(__file__).resolve().parent / 'app.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - view.show() - res = app.exec() - # Deleting the view before it goes out of scope is required to make sure all child QML instances - # are destroyed in the correct order. - del view - sys.exit(res) diff --git a/examples/declarative/extending/chapter5-listproperties/app.qml b/examples/declarative/extending/chapter5-listproperties/app.qml deleted file mode 100644 index edbf3e770..000000000 --- a/examples/declarative/extending/chapter5-listproperties/app.qml +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -//![0] -import Charts -import QtQuick - -Item { - width: 300; height: 200 - - PieChart { - anchors.centerIn: parent - width: 100; height: 100 - - slices: [ - PieSlice { - anchors.fill: parent - color: "red" - fromAngle: 0; angleSpan: 110 - }, - PieSlice { - anchors.fill: parent - color: "black" - fromAngle: 110; angleSpan: 50 - }, - PieSlice { - anchors.fill: parent - color: "blue" - fromAngle: 160; angleSpan: 100 - } - ] - } -} -//![0] diff --git a/examples/declarative/extending/chapter5-listproperties/chapter5-listproperties.pyproject b/examples/declarative/extending/chapter5-listproperties/chapter5-listproperties.pyproject deleted file mode 100644 index a3f89d575..000000000 --- a/examples/declarative/extending/chapter5-listproperties/chapter5-listproperties.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["app.qml", "listproperties.py"] -} diff --git a/examples/declarative/extending/chapter5-listproperties/listproperties.py b/examples/declarative/extending/chapter5-listproperties/listproperties.py deleted file mode 100644 index 95a393fa3..000000000 --- a/examples/declarative/extending/chapter5-listproperties/listproperties.py +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/tutorials/extending-qml/chapter5-listproperties example from Qt v5.x""" - -import os -from pathlib import Path -import sys - -from PySide6.QtCore import Property, QUrl -from PySide6.QtGui import QGuiApplication, QPen, QPainter, QColor -from PySide6.QtQml import QmlElement, ListProperty -from PySide6.QtQuick import QQuickPaintedItem, QQuickView, QQuickItem - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "Charts" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class PieSlice (QQuickPaintedItem): - def __init__(self, parent=None): - QQuickPaintedItem.__init__(self, parent) - self._color = QColor() - self._fromAngle = 0 - self._angleSpan = 0 - - @Property(QColor) - def color(self): - return self._color - - @color.setter - def color(self, value): - self._color = value - - @Property(int) - def fromAngle(self): - return self._angle - - @fromAngle.setter - def fromAngle(self, value): - self._fromAngle = value - - @Property(int) - def angleSpan(self): - return self._angleSpan - - @angleSpan.setter - def angleSpan(self, value): - self._angleSpan = value - - def paint(self, painter): - pen = QPen(self._color, 2) - painter.setPen(pen) - painter.setRenderHints(QPainter.Antialiasing, True) - painter.drawPie(self.boundingRect().adjusted(1, 1, -1, -1), self._fromAngle * 16, self._angleSpan * 16) - - -@QmlElement -class PieChart (QQuickItem): - def __init__(self, parent=None): - QQuickItem.__init__(self, parent) - self._name = u'' - self._slices = [] - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, value): - self._name = value - - def appendSlice(self, _slice): - _slice.setParentItem(self) - self._slices.append(_slice) - - slices = ListProperty(PieSlice, appendSlice) - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - - view = QQuickView() - view.setResizeMode(QQuickView.SizeRootObjectToView) - qml_file = os.fspath(Path(__file__).resolve().parent / 'app.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - view.show() - res = app.exec() - # Deleting the view before it goes out of scope is required to make sure all child QML instances - # are destroyed in the correct order. - del view - sys.exit(res) diff --git a/examples/declarative/extending/chapter6-plugins/Charts/piechart.py b/examples/declarative/extending/chapter6-plugins/Charts/piechart.py deleted file mode 100644 index b721a7130..000000000 --- a/examples/declarative/extending/chapter6-plugins/Charts/piechart.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import Property -from PySide6.QtQml import QmlElement, ListProperty -from PySide6.QtQuick import QQuickItem - -from pieslice import PieSlice - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "Charts" -QML_IMPORT_MAJOR_VERSION = 1 - -@QmlElement -class PieChart(QQuickItem): - def __init__(self, parent=None): - super().__init__(parent) - self._slices = [] - self._name = '' - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, name): - self._name = name - - def slice(self, n): - return self._slices[n] - - def sliceCount(self): - return len(self._slices) - - def append_and_setparent(self, slice): - self._slices.append(slice) - slice.setParentItem(self) - - slices = ListProperty(PieSlice, append_and_setparent) diff --git a/examples/declarative/extending/chapter6-plugins/Charts/pieslice.py b/examples/declarative/extending/chapter6-plugins/Charts/pieslice.py deleted file mode 100644 index 7945eff12..000000000 --- a/examples/declarative/extending/chapter6-plugins/Charts/pieslice.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import Property, QRectF -from PySide6.QtGui import QColor, QPainter, QPen -from PySide6.QtQuick import QQuickPaintedItem -from PySide6.QtQml import QmlElement - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "Charts" -QML_IMPORT_MAJOR_VERSION = 1 - -@QmlElement -class PieSlice(QQuickPaintedItem): - def __init__(self, parent=None): - super().__init__(parent) - - self._color = QColor() - self._from_angle = 0 - self._angle_span = 0 - - @Property(QColor) - def color(self): - return self._color - - @color.setter - def color(self, color): - self._color = QColor(color) - - @Property(int) - def fromAngle(self): - return self._from_angle - - @fromAngle.setter - def fromAngle(self, fromAngle): - self._from_angle = fromAngle - - @Property(int) - def angleSpan(self): - return self._angle_span - - @angleSpan.setter - def angleSpan(self, angleSpan): - self._angle_span = angleSpan - - def paint(self, painter): - painter.setPen(QPen(self._color, 2)) - painter.setRenderHint(QPainter.RenderHint.Antialiasing, True) - - rect = QRectF(0, 0, self.width(), self.height()).adjusted(1, 1, -1, -1) - painter.drawPie(rect, self._from_angle * 16, self._angle_span * 16) diff --git a/examples/declarative/extending/chapter6-plugins/Charts/plugins.png b/examples/declarative/extending/chapter6-plugins/Charts/plugins.png deleted file mode 100644 index 8992e89c0..000000000 Binary files a/examples/declarative/extending/chapter6-plugins/Charts/plugins.png and /dev/null differ diff --git a/examples/declarative/extending/chapter6-plugins/app.qml b/examples/declarative/extending/chapter6-plugins/app.qml deleted file mode 100644 index 70761619f..000000000 --- a/examples/declarative/extending/chapter6-plugins/app.qml +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick 2.0 -import Charts 1.0 - -Item { - width: 300; height: 200 - - PieChart { - anchors.centerIn: parent - width: 100; height: 100 - - slices: [ - PieSlice { - anchors.fill: parent - color: "red" - fromAngle: 0; angleSpan: 110 - }, - PieSlice { - anchors.fill: parent - color: "black" - fromAngle: 110; angleSpan: 50 - }, - PieSlice { - anchors.fill: parent - color: "blue" - fromAngle: 160; angleSpan: 100 - } - ] - } -} diff --git a/examples/declarative/extending/chapter6-plugins/chapter6-plugins.pyproject b/examples/declarative/extending/chapter6-plugins/chapter6-plugins.pyproject deleted file mode 100644 index cc684401f..000000000 --- a/examples/declarative/extending/chapter6-plugins/chapter6-plugins.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["app.qml", "Charts/piechart.py", "Charts/pieslice.py"] -} diff --git a/examples/declarative/extending/chapter6-plugins/doc/chapter6-plugins.rst b/examples/declarative/extending/chapter6-plugins/doc/chapter6-plugins.rst deleted file mode 100644 index 10aba1e8f..000000000 --- a/examples/declarative/extending/chapter6-plugins/doc/chapter6-plugins.rst +++ /dev/null @@ -1,21 +0,0 @@ -.. _qml-chapter6-plugins-example: - -Extending QML - Plugins Example -=============================== - -This example refers to the Python version of using a QML plugin in Python. The idea of plugins in -Python is non-existent because Python modules are dynamically loaded anyway. We use this idea and -our QML type registration decorators - QmlELement/QmlNamedElement - to register the QML modules as -they are imported. The pyside6-qml tool does this for you by simply pointing to the .qml file. - -.. image:: plugins.png - :width: 400 - :alt: Plugins Example - - -Running the Example -------------------- - -.. code-block:: shell - - pyside6-pyqml examples/declarative/extending/chapter6-plugins/app.qml -I examples/declarative/extending/chapter6-plugins/Charts diff --git a/examples/declarative/extending/chapter6-plugins/doc/plugins.png b/examples/declarative/extending/chapter6-plugins/doc/plugins.png deleted file mode 100644 index 8992e89c0..000000000 Binary files a/examples/declarative/extending/chapter6-plugins/doc/plugins.png and /dev/null differ diff --git a/examples/declarative/objectlistmodel/doc/objectlistmodel.png b/examples/declarative/objectlistmodel/doc/objectlistmodel.png deleted file mode 100644 index 416e08a85..000000000 Binary files a/examples/declarative/objectlistmodel/doc/objectlistmodel.png and /dev/null differ diff --git a/examples/declarative/objectlistmodel/doc/objectlistmodel.rst b/examples/declarative/objectlistmodel/doc/objectlistmodel.rst deleted file mode 100644 index d71ee61df..000000000 --- a/examples/declarative/objectlistmodel/doc/objectlistmodel.rst +++ /dev/null @@ -1,12 +0,0 @@ -Object List Model Example -========================= - -A list of QObject values can also be used as a model. -A list[QObject,] provides the properties of the objects in the list as roles. - -The following application creates a DataObject class with Property values -that will be accessible as named roles when a list[DataObject,] is exposed to QML: - -.. image:: objectlistmodel.png - :width: 400 - :alt: Object List Model Screenshot diff --git a/examples/declarative/objectlistmodel/objectlistmodel.py b/examples/declarative/objectlistmodel/objectlistmodel.py deleted file mode 100644 index 0843ae480..000000000 --- a/examples/declarative/objectlistmodel/objectlistmodel.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from pathlib import Path -import sys -from PySide6.QtCore import QObject, QUrl, Property, Signal -from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickView - -# This example illustrates exposing a list of QObjects as a model in QML - -class DataObject(QObject): - - nameChanged = Signal() - colorChanged = Signal() - - def __init__(self, name, color, parent=None): - super().__init__(parent) - self._name = name - self._color = color - - def name(self): - return self._name - - def setName(self, name): - if name != self._name: - self._name = name - nameChanged.emit() - - def color(self): - return self._color - - def setColor(self, color): - if color != self._color: - self._color = color - colorChanged.emit() - - - name = Property(str, name, setName, notify=nameChanged) - color = Property(str, color, setColor, notify=colorChanged) - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - - dataList = [DataObject("Item 1", "red"), - DataObject("Item 2", "green"), - DataObject("Item 3", "blue"), - DataObject("Item 4", "yellow")] - - view = QQuickView() - view.setResizeMode(QQuickView.SizeRootObjectToView) - view.setInitialProperties({"model": dataList}) - - qml_file = Path(__file__).parent / "view.qml" - view.setSource(QUrl.fromLocalFile(qml_file)) - view.show() - - r = app.exec() - del view - sys.exit(r) diff --git a/examples/declarative/objectlistmodel/objectlistmodel.pyproject b/examples/declarative/objectlistmodel/objectlistmodel.pyproject deleted file mode 100644 index 556e399f4..000000000 --- a/examples/declarative/objectlistmodel/objectlistmodel.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["objectlistmodel.py", "view.qml"] -} diff --git a/examples/declarative/objectlistmodel/view.qml b/examples/declarative/objectlistmodel/view.qml deleted file mode 100644 index b7cf68a9b..000000000 --- a/examples/declarative/objectlistmodel/view.qml +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -ListView { - width: 100; height: 100 - - delegate: Rectangle { - color: model.modelData.color - height: 25 - width: 100 - Text { text: model.modelData.name } - } -} diff --git a/examples/declarative/openglunderqml/doc/openglunderqml.rst b/examples/declarative/openglunderqml/doc/openglunderqml.rst deleted file mode 100644 index 6a89a99d9..000000000 --- a/examples/declarative/openglunderqml/doc/openglunderqml.rst +++ /dev/null @@ -1,21 +0,0 @@ -OpenGL under QML Squircle -========================= - -The OpenGL under QML example shows how an application can make use of the -QQuickWindow::beforeRendering() signal to draw custom OpenGL content under a Qt -Quick scene. This signal is emitted at the start of every frame, before the -scene graph starts its rendering, thus any OpenGL draw calls that are made as -a response to this signal, will stack under the Qt Quick items. - -As an alternative, applications that wish to render OpenGL content on top of -the Qt Quick scene, can do so by connecting to the -QQuickWindow::afterRendering() signal. - -In this example, we will also see how it is possible to have values that are -exposed to QML which affect the OpenGL rendering. We animate the threshold -value using a NumberAnimation in the QML file and this value is used by the -OpenGL shader program that draws the squircles. - -.. image:: squircle.png - :width: 400 - :alt: Squircle Screenshot diff --git a/examples/declarative/openglunderqml/doc/squircle.png b/examples/declarative/openglunderqml/doc/squircle.png deleted file mode 100644 index c099a6b7e..000000000 Binary files a/examples/declarative/openglunderqml/doc/squircle.png and /dev/null differ diff --git a/examples/declarative/openglunderqml/main.py b/examples/declarative/openglunderqml/main.py deleted file mode 100644 index a79d1bed8..000000000 --- a/examples/declarative/openglunderqml/main.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import sys -from pathlib import Path - -from PySide6.QtCore import QUrl -from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickView, QQuickWindow, QSGRendererInterface - -from squircle import Squircle - -if __name__ == "__main__": - app = QGuiApplication(sys.argv) - - QQuickWindow.setGraphicsApi(QSGRendererInterface.OpenGL) - - view = QQuickView() - view.setResizeMode(QQuickView.SizeRootObjectToView) - qml_file = Path(__file__).parent / "main.qml" - view.setSource(QUrl.fromLocalFile(qml_file)) - - if view.status() == QQuickView.Error: - sys.exit(-1) - view.show() - - sys.exit(app.exec()) diff --git a/examples/declarative/openglunderqml/main.qml b/examples/declarative/openglunderqml/main.qml deleted file mode 100644 index 73bfa3262..000000000 --- a/examples/declarative/openglunderqml/main.qml +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import OpenGLUnderQML - -Item { - - width: 320 - height: 480 - - Squircle { - SequentialAnimation on t { - NumberAnimation { to: 1; duration: 2500; easing.type: Easing.InQuad } - NumberAnimation { to: 0; duration: 2500; easing.type: Easing.OutQuad } - loops: Animation.Infinite - running: true - } - } - Rectangle { - color: Qt.rgba(1, 1, 1, 0.7) - radius: 10 - border.width: 1 - border.color: "white" - anchors.fill: label - anchors.margins: -10 - } - - Text { - id: label - color: "black" - wrapMode: Text.WordWrap - text: "The background here is a squircle rendered with raw OpenGL using the 'beforeRender()' signal in QQuickWindow. This text label and its border is rendered using QML" - anchors.right: parent.right - anchors.left: parent.left - anchors.bottom: parent.bottom - anchors.margins: 20 - } -} diff --git a/examples/declarative/openglunderqml/openglunderqml.pyproject b/examples/declarative/openglunderqml/openglunderqml.pyproject deleted file mode 100644 index e7cfbc570..000000000 --- a/examples/declarative/openglunderqml/openglunderqml.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": [ "main.py", "main.qml", "squircle.py", "squirclerenderer.py"] -} diff --git a/examples/declarative/openglunderqml/squircle.py b/examples/declarative/openglunderqml/squircle.py deleted file mode 100644 index d2900198b..000000000 --- a/examples/declarative/openglunderqml/squircle.py +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import Property, QRunnable, Qt, Signal, Slot -from PySide6.QtQml import QmlElement -from PySide6.QtQuick import QQuickItem, QQuickWindow - -from squirclerenderer import SquircleRenderer - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "OpenGLUnderQML" -QML_IMPORT_MAJOR_VERSION = 1 - - -class CleanupJob(QRunnable): - def __init__(self, renderer): - super().__init__() - self._renderer = renderer - - def run(self): - del self._renderer - - -@QmlElement -class Squircle(QQuickItem): - - tChanged = Signal() - - def __init__(self, parent=None): - super().__init__(parent) - self._t = 0.0 - self._renderer = None - self.windowChanged.connect(self.handleWindowChanged) - - def t(self): - return self._t - - def setT(self, value): - if self._t == value: - return - self._t = value - self.tChanged.emit() - if self.window(): - self.window().update() - - @Slot(QQuickWindow) - def handleWindowChanged(self, win): - if win: - win.beforeSynchronizing.connect(self.sync, type=Qt.DirectConnection) - win.sceneGraphInvalidated.connect(self.cleanup, type=Qt.DirectConnection) - win.setColor(Qt.black) - self.sync() - - @Slot() - def cleanup(self): - del self._renderer - self._renderer = None - - @Slot() - def sync(self): - window = self.window() - if not self._renderer: - self._renderer = SquircleRenderer() - window.beforeRendering.connect(self._renderer.init, Qt.DirectConnection) - window.beforeRenderPassRecording.connect( - self._renderer.paint, Qt.DirectConnection - ) - self._renderer.setViewportSize(window.size() * window.devicePixelRatio()) - self._renderer.setT(self._t) - self._renderer.setWindow(window) - - def releaseResources(self): - self.window().scheduleRenderJob( - CleanupJob(self._renderer), QQuickWindow.BeforeSynchronizingStage - ) - self._renderer = None - - t = Property(float, t, setT, notify=tChanged) diff --git a/examples/declarative/openglunderqml/squirclerenderer.py b/examples/declarative/openglunderqml/squirclerenderer.py deleted file mode 100644 index 5d1759251..000000000 --- a/examples/declarative/openglunderqml/squirclerenderer.py +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from textwrap import dedent - -import numpy as np -from OpenGL.GL import (GL_ARRAY_BUFFER, GL_BLEND, GL_DEPTH_TEST, GL_FLOAT, - GL_ONE, GL_SRC_ALPHA, GL_TRIANGLE_STRIP) -from PySide6.QtCore import QSize, Slot -from PySide6.QtGui import QOpenGLFunctions -from PySide6.QtOpenGL import (QOpenGLShader, QOpenGLShaderProgram, - QOpenGLVersionProfile) -from PySide6.QtQuick import QQuickWindow, QSGRendererInterface - -VERTEX_SHADER = dedent( - """\ - attribute highp vec4 vertices; - varying highp vec2 coords; - void main() { - gl_Position = vertices; - coords = vertices.xy; - } - """ -) -FRAGMENT_SHADER = dedent( - """\ - uniform lowp float t; - varying highp vec2 coords; - void main() { - lowp float i = 1. - (pow(abs(coords.x), 4.) + pow(abs(coords.y), 4.)); - i = smoothstep(t - 0.8, t + 0.8, i); - i = floor(i * 20.) / 20.; - gl_FragColor = vec4(coords * .5 + .5, i, i); - } - """ -) - - -class SquircleRenderer(QOpenGLFunctions): - def __init__(self): - QOpenGLFunctions.__init__(self) - self._viewport_size = QSize() - self._t = 0.0 - self._program = None - self._window = QQuickWindow() - - def setT(self, t): - self._t = t - - def setViewportSize(self, size): - self._viewport_size = size - - def setWindow(self, window): - self._window = window - - @Slot() - def init(self): - if not self._program: - rif = self._window.rendererInterface() - assert (rif.graphicsApi() == QSGRendererInterface.OpenGL) - self.initializeOpenGLFunctions() - self._program = QOpenGLShaderProgram() - self._program.addCacheableShaderFromSourceCode(QOpenGLShader.Vertex, VERTEX_SHADER) - self._program.addCacheableShaderFromSourceCode(QOpenGLShader.Fragment, FRAGMENT_SHADER) - self._program.bindAttributeLocation("vertices", 0) - self._program.link() - - @Slot() - def paint(self): - # Play nice with the RHI. Not strictly needed when the scenegraph uses - # OpenGL directly. - self._window.beginExternalCommands() - - self._program.bind() - - self._program.enableAttributeArray(0) - - values = np.array([-1, -1, 1, -1, -1, 1, 1, 1], dtype="single") - - # This example relies on (deprecated) client-side pointers for the vertex - # input. Therefore, we have to make sure no vertex buffer is bound. - self.glBindBuffer(GL_ARRAY_BUFFER, 0) - - self._program.setAttributeArray(0, GL_FLOAT, values, 2) - self._program.setUniformValue1f("t", self._t) - - self.glViewport(0, 0, self._viewport_size.width(), self._viewport_size.height()) - - self.glDisable(GL_DEPTH_TEST) - - self.glEnable(GL_BLEND) - self.glBlendFunc(GL_SRC_ALPHA, GL_ONE) - - self.glDrawArrays(GL_TRIANGLE_STRIP, 0, 4) - - self._program.disableAttributeArray(0) - self._program.release() - - self._window.endExternalCommands() diff --git a/examples/declarative/referenceexamples/adding/adding.pyproject b/examples/declarative/referenceexamples/adding/adding.pyproject deleted file mode 100644 index 46df4b253..000000000 --- a/examples/declarative/referenceexamples/adding/adding.pyproject +++ /dev/null @@ -1,5 +0,0 @@ -{ - "files": ["example.qml", - "main.py", - "person.py"] -} diff --git a/examples/declarative/referenceexamples/adding/doc/adding.rst b/examples/declarative/referenceexamples/adding/doc/adding.rst deleted file mode 100644 index 55f6105b7..000000000 --- a/examples/declarative/referenceexamples/adding/doc/adding.rst +++ /dev/null @@ -1,67 +0,0 @@ -.. _qml-adding-types-example: - -Extending QML - Adding Types Example -==================================== - -The Adding Types Example shows how to add a new object type, ``Person``, to QML. -The ``Person`` type can be used from QML like this: - -.. code-block:: javascript - - import examples.adding.people - - Person { - name: "Bob Jones" - shoe_size: 12 - } - -Declare the Person Class ------------------------- - -All QML types map to C++ types. Here we declare a basic C++ Person class -with the two properties we want accessible on the QML type - name and shoeSize. -Although in this example we use the same name for the C++ class as the QML -type, the C++ class can be named differently, or appear in a namespace. - -The Person class implementation is quite basic. The property accessors simply -return members of the object instance. - -.. code-block:: python - - from PySide6.QtCore import QObject, Property - from PySide6.QtQml import QmlElement - - # To be used on the @QmlElement decorator - # (QML_IMPORT_MINOR_VERSION is optional) - QML_IMPORT_NAME = "examples.adding.people" - QML_IMPORT_MAJOR_VERSION = 1 - - - @QmlElement - class Person(QObject): - def __init__(self, parent=None): - super().__init__(parent) - self._name = '' - self._shoe_size = 0 - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, n): - self._name = n - - @Property(int) - def shoe_size(self): - return self._shoe_size - - @shoe_size.setter - def shoe_size(self, s): - self._shoe_size = s - -Running the Example -------------------- - -The main.py file in the example includes a simple shell application that -loads and runs the QML snippet shown at the beginning of this page. diff --git a/examples/declarative/referenceexamples/adding/example.qml b/examples/declarative/referenceexamples/adding/example.qml deleted file mode 100644 index 42d47dea9..000000000 --- a/examples/declarative/referenceexamples/adding/example.qml +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import examples.adding.people - -Person { - name: "Bob Jones" - shoe_size: 12 -} diff --git a/examples/declarative/referenceexamples/adding/main.py b/examples/declarative/referenceexamples/adding/main.py deleted file mode 100644 index f10b77bc1..000000000 --- a/examples/declarative/referenceexamples/adding/main.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/examples/qml/referenceexamples/adding example from Qt v6.x""" - -from pathlib import Path -import sys - -from PySide6.QtCore import QCoreApplication, QUrl -from PySide6.QtQml import QQmlComponent, QQmlEngine - -from person import Person - - -if __name__ == '__main__': - app = QCoreApplication(sys.argv) - - qml_file = Path(__file__).parent / "example.qml" - url = QUrl.fromLocalFile(qml_file) - engine = QQmlEngine() - component = QQmlComponent(engine, url) - - person = component.create() - if person: - print(f"The person's name is {person.name}") - print(f"They wear a {person.shoe_size} sized shoe") - else: - print(component.errors()) - del engine - sys.exit(0) diff --git a/examples/declarative/referenceexamples/adding/person.py b/examples/declarative/referenceexamples/adding/person.py deleted file mode 100644 index 0c2b5b124..000000000 --- a/examples/declarative/referenceexamples/adding/person.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property -from PySide6.QtQml import QmlElement - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.adding.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class Person(QObject): - def __init__(self, parent=None): - super().__init__(parent) - self._name = '' - self._shoe_size = 0 - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, n): - self._name = n - - @Property(int) - def shoe_size(self): - return self._shoe_size - - @shoe_size.setter - def shoe_size(self, s): - self._shoe_size = s - diff --git a/examples/declarative/referenceexamples/attached/attached.pyproject b/examples/declarative/referenceexamples/attached/attached.pyproject deleted file mode 100644 index 3c01c40c2..000000000 --- a/examples/declarative/referenceexamples/attached/attached.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "birthdayparty.py", "person.py", "example.qml"] -} diff --git a/examples/declarative/referenceexamples/attached/birthdayparty.py b/examples/declarative/referenceexamples/attached/birthdayparty.py deleted file mode 100644 index d83236e26..000000000 --- a/examples/declarative/referenceexamples/attached/birthdayparty.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QDate, QObject, ClassInfo, Property -from PySide6.QtQml import QmlAnonymous, QmlAttached, QmlElement, ListProperty - -from person import Person - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.default.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlAnonymous -class BirthdayPartyAttached(QObject): - - def __init__(self, parent=None): - super().__init__(parent) - self._rsvp = QDate() - - @Property(QDate) - def rsvp(self): - return self._rsvp - - @rsvp.setter - def rsvp(self, d): - self._rsvp = d - - -@QmlElement -@ClassInfo(DefaultProperty="guests") -@QmlAttached(BirthdayPartyAttached) -class BirthdayParty(QObject): - - def __init__(self, parent=None): - super().__init__(parent) - self._host = None - self._guests = [] - - @Property(Person) - def host(self): - return self._host - - @host.setter - def host(self, h): - self._host = h - - def guest(self, n): - return self._guests[n] - - def guestCount(self): - return len(self._guests) - - def appendGuest(self, guest): - self._guests.append(guest) - - @staticmethod - def qmlAttachedProperties(self, o): - return BirthdayPartyAttached(o) - - guests = ListProperty(Person, appendGuest) diff --git a/examples/declarative/referenceexamples/attached/doc/attached.rst b/examples/declarative/referenceexamples/attached/doc/attached.rst deleted file mode 100644 index 95fb5c43c..000000000 --- a/examples/declarative/referenceexamples/attached/doc/attached.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. _qml-attached-properties-example: - -Extending QML - Attached Properties Example -=========================================== - -This example builds on the :ref:`qml-default-property-example`, -:ref:`qml-inheritance-and-coercion-example`, -:ref:`qml-object-and-list-property-types-example` -and the :ref:`qml-adding-types-example`. - -The Attached Properties Example example shows how to inject -properties to child objects. diff --git a/examples/declarative/referenceexamples/attached/example.qml b/examples/declarative/referenceexamples/attached/example.qml deleted file mode 100644 index f038b3ece..000000000 --- a/examples/declarative/referenceexamples/attached/example.qml +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import examples.default.people - -BirthdayParty { - Boy { - name: "Robert Campbell" - BirthdayParty.rsvp: "2009-07-01" - } - - Boy { - name: "Leo Hodges" - shoe_size: 10 - BirthdayParty.rsvp: "2009-07-06" - } - - host: Boy { - name: "Jack Smith" - shoe_size: 8 - } -} diff --git a/examples/declarative/referenceexamples/attached/main.py b/examples/declarative/referenceexamples/attached/main.py deleted file mode 100644 index d7483559f..000000000 --- a/examples/declarative/referenceexamples/attached/main.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/examples/qml/referenceexamples/attached example from Qt v6.x""" - -from pathlib import Path -import sys - -from PySide6.QtCore import QCoreApplication, QUrl -from PySide6.QtQml import QQmlComponent, QQmlEngine, qmlAttachedPropertiesObject - -from person import Boy, Girl -from birthdayparty import BirthdayParty - - -app = QCoreApplication(sys.argv) -qml_file = Path(__file__).parent / "example.qml" -url = QUrl.fromLocalFile(qml_file) -engine = QQmlEngine() -component = QQmlComponent(engine, url) -party = component.create() -if not party: - print(component.errors()) - del engine - sys.exit(-1) -host = party.host -print(f"{host.name} is having a birthday!") -if isinstance(host, Boy): - print("He is inviting:") -else: - print("She is inviting:") -for g in range(party.guestCount()): - guest = party.guest(g) - name = guest.name - - rsvp_date = None - attached = qmlAttachedPropertiesObject(BirthdayParty, guest, False) - if attached: - rsvp_date = attached.rsvp.toString() - if rsvp_date: - print(f" {name} RSVP date: {rsvp_date}") - else: - print(f" {name} RSVP date: Hasn't RSVP'd") - -del engine -sys.exit(0) diff --git a/examples/declarative/referenceexamples/attached/person.py b/examples/declarative/referenceexamples/attached/person.py deleted file mode 100644 index 7164bd645..000000000 --- a/examples/declarative/referenceexamples/attached/person.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property -from PySide6.QtQml import QmlAnonymous, QmlElement - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.default.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlAnonymous -class Person(QObject): - def __init__(self, parent=None): - super().__init__(parent) - self._name = '' - self._shoe_size = 0 - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, n): - self._name = n - - @Property(int) - def shoe_size(self): - return self._shoe_size - - @shoe_size.setter - def shoe_size(self, s): - self._shoe_size = s - - -@QmlElement -class Boy(Person): - def __init__(self, parent=None): - super().__init__(parent) - - -@QmlElement -class Girl(Person): - def __init__(self, parent=None): - super().__init__(parent) diff --git a/examples/declarative/referenceexamples/binding/binding.pyproject b/examples/declarative/referenceexamples/binding/binding.pyproject deleted file mode 100644 index a782d5c8a..000000000 --- a/examples/declarative/referenceexamples/binding/binding.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "birthdayparty.py", "happybirthdaysong.py", "person.py", "example.qml"] -} diff --git a/examples/declarative/referenceexamples/binding/birthdayparty.py b/examples/declarative/referenceexamples/binding/birthdayparty.py deleted file mode 100644 index 78f0314b4..000000000 --- a/examples/declarative/referenceexamples/binding/birthdayparty.py +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QDate, QObject, ClassInfo, Property, QTime, Signal -from PySide6.QtQml import QmlAnonymous, QmlAttached, QmlElement, ListProperty - -from person import Person - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.binding.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlAnonymous -class BirthdayPartyAttached(QObject): - - rsvp_changed = Signal() - - def __init__(self, parent=None): - super().__init__(parent) - self._rsvp = QDate() - - @Property(QDate, notify=rsvp_changed) - def rsvp(self): - return self._rsvp - - @rsvp.setter - def rsvp(self, d): - if self._rsvp != d: - self._rsvp = d - self.rsvp_changed.emit() - - -@QmlElement -@ClassInfo(DefaultProperty="guests") -@QmlAttached(BirthdayPartyAttached) -class BirthdayParty(QObject): - - partyStarted = Signal(QTime) - host_changed = Signal() - - def __init__(self, parent=None): - super().__init__(parent) - self._host = None - self._guests = [] - - def startParty(self): - self.partyStarted.emit(QTime.currentTime()) - - @Property(Person, notify=host_changed) - def host(self): - return self._host - - @host.setter - def host(self, h): - if self._host != h: - self._host = h - self.host_changed.emit() - - @Property(str) - def announcement(self): - return "" - - @announcement.setter - def announcement(self, a): - print(a) - - def guest(self, n): - return self._guests[n] - - def guestCount(self): - return len(self._guests) - - def appendGuest(self, guest): - self._guests.append(guest) - - @staticmethod - def qmlAttachedProperties(self, o): - return BirthdayPartyAttached(o) - - guests = ListProperty(Person, appendGuest) diff --git a/examples/declarative/referenceexamples/binding/doc/binding.rst b/examples/declarative/referenceexamples/binding/doc/binding.rst deleted file mode 100644 index 5c0ed21be..000000000 --- a/examples/declarative/referenceexamples/binding/doc/binding.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. _qml-binding-example: - -Extending QML - Binding Example -=============================== - -This example builds on the :ref:`qml-adding-types-example`, -the :ref:`qml-attached-properties-example`, -the :ref:`qml-default-property-example`, -the :ref:`qml-inheritance-and-coercion-example` -the :ref:`qml-object-and-list-property-types-example` -and the :ref:`qml-valuesource-example`. - -Running the Example -------------------- - -The ``main.py`` file in the example includes a simple shell application that -loads and runs the QML snippet shown below. diff --git a/examples/declarative/referenceexamples/binding/example.qml b/examples/declarative/referenceexamples/binding/example.qml deleted file mode 100644 index ca0958810..000000000 --- a/examples/declarative/referenceexamples/binding/example.qml +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import examples.binding.people - -BirthdayParty { - id: theParty - - HappyBirthdaySong on announcement { name: theParty.host.name } - - onPartyStarted: (time) => { console.log("This party started rockin' at " + time); } - - host: Boy { - name: "Bob Jones" - shoe_size: 12 - } - - Boy { - name: "Leo Hodges" - BirthdayParty.rsvp: "2009-07-06" - } - Boy { - name: "Jack Smith" - } - Girl { - name: "Anne Brown" - BirthdayParty.rsvp: "2009-07-01" - } -} diff --git a/examples/declarative/referenceexamples/binding/happybirthdaysong.py b/examples/declarative/referenceexamples/binding/happybirthdaysong.py deleted file mode 100644 index cfe34eb82..000000000 --- a/examples/declarative/referenceexamples/binding/happybirthdaysong.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, QTimer, Property, Slot -from PySide6.QtQml import QmlElement, QPyQmlPropertyValueSource - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.binding.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class HappyBirthdaySong(QPyQmlPropertyValueSource): - - def __init__(self, parent=None): - super().__init__(parent) - - self.m_target = None - self.m_name = "" - self.m_line = -1 - self.m_lyrics = [] - - self.m_timer = QTimer(self) - self.m_timer.timeout.connect(self.advance) - self.m_timer.start(1000) - - def setTarget(self, property): - self.m_target = property - - @Property(str) - def name(self): - return self.m_name - - @name.setter - def name(self, n): - self.m_name = n - self.m_lyrics = ["Happy birthday to you,", - "Happy birthday to you,", - f"Happy birthday dear {self.m_name},", - "Happy birthday to you!", - ""] - - @Slot() - def advance(self): - self.m_line = (self.m_line + 1) % len(self.m_lyrics) - self.m_target.write(self.m_lyrics[self.m_line]) diff --git a/examples/declarative/referenceexamples/binding/main.py b/examples/declarative/referenceexamples/binding/main.py deleted file mode 100644 index dcbd547ad..000000000 --- a/examples/declarative/referenceexamples/binding/main.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/examples/qml/referenceexamples/binding example from Qt v6.x""" - -from pathlib import Path -import sys - -from PySide6.QtCore import QCoreApplication, QUrl -from PySide6.QtQml import QQmlComponent, QQmlEngine, qmlAttachedPropertiesObject - -from person import Boy, Girl -from birthdayparty import BirthdayParty -from happybirthdaysong import HappyBirthdaySong - - -if __name__ == "__main__": - app = QCoreApplication(sys.argv) - qml_file = Path(__file__).parent / "example.qml" - url = QUrl.fromLocalFile(qml_file) - engine = QQmlEngine() - component = QQmlComponent(engine, url) - party = component.create() - if not party: - print(component.errors()) - del engine - sys.exit(-1) - host = party.host - print(f"{host.name} is having a birthday!") - if isinstance(host, Boy): - print("He is inviting:") - else: - print("She is inviting:") - for g in range(party.guestCount()): - guest = party.guest(g) - name = guest.name - - rsvp_date = None - attached = qmlAttachedPropertiesObject(BirthdayParty, guest, False) - if attached: - rsvp_date = attached.rsvp.toString() - if rsvp_date: - print(f" {name} RSVP date: {rsvp_date}") - else: - print(f" {name} RSVP date: Hasn't RSVP'd") - - party.startParty() - - r = app.exec() - - del engine - sys.exit(r) diff --git a/examples/declarative/referenceexamples/binding/person.py b/examples/declarative/referenceexamples/binding/person.py deleted file mode 100644 index 9e7d799e1..000000000 --- a/examples/declarative/referenceexamples/binding/person.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property, Signal -from PySide6.QtQml import QmlAnonymous, QmlElement - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.binding.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlAnonymous -class Person(QObject): - name_changed = Signal() - shoe_size_changed = Signal() - - def __init__(self, parent=None): - super().__init__(parent) - self._name = '' - self._shoe_size = 0 - - @Property(str, notify=name_changed) - def name(self): - return self._name - - @name.setter - def name(self, n): - if self._name != n: - self._name = n - self.name_changed.emit() - - @Property(int, notify=shoe_size_changed) - def shoe_size(self): - return self._shoe_size - - @shoe_size.setter - def shoe_size(self, s): - if self._shoe_size != s: - self._shoe_size = s - self.shoe_size_changed.emit() - - -@QmlElement -class Boy(Person): - def __init__(self, parent=None): - super().__init__(parent) - - -@QmlElement -class Girl(Person): - def __init__(self, parent=None): - super().__init__(parent) diff --git a/examples/declarative/referenceexamples/coercion/birthdayparty.py b/examples/declarative/referenceexamples/coercion/birthdayparty.py deleted file mode 100644 index f6ad1ac35..000000000 --- a/examples/declarative/referenceexamples/coercion/birthdayparty.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property -from PySide6.QtQml import QmlElement, ListProperty - -from person import Person - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.coercion.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class BirthdayParty(QObject): - - def __init__(self, parent=None): - super().__init__(parent) - self._host = None - self._guests = [] - - @Property(Person) - def host(self): - return self._host - - @host.setter - def host(self, h): - self._host = h - - def guest(self, n): - return self._guests[n] - - def guestCount(self): - return len(self._guests) - - def appendGuest(self, guest): - self._guests.append(guest) - - guests = ListProperty(Person, appendGuest) diff --git a/examples/declarative/referenceexamples/coercion/coercion.pyproject b/examples/declarative/referenceexamples/coercion/coercion.pyproject deleted file mode 100644 index 3c01c40c2..000000000 --- a/examples/declarative/referenceexamples/coercion/coercion.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "birthdayparty.py", "person.py", "example.qml"] -} diff --git a/examples/declarative/referenceexamples/coercion/doc/coercion.rst b/examples/declarative/referenceexamples/coercion/doc/coercion.rst deleted file mode 100644 index 2ccdaeb4f..000000000 --- a/examples/declarative/referenceexamples/coercion/doc/coercion.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. _qml-inheritance-and-coercion-example: - -Extending QML - Inheritance and Coercion Example -================================================ - -This example builds on the :ref:`qml-adding-types-example` and the -:ref:`qml-object-and-list-property-types-example` . - -The Inheritance and Coercion Example shows how to use base classes to assign -types of more than one type to a property. It specializes the Person type -developed in the previous examples into two types - a ``Boy`` and a ``Girl``. - -Declare Boy and Girl --------------------- - -The Person class remains unaltered in this example and the Boy and Girl C++ -classes are trivial extensions of it. The types and their QML name are -registered with the QML engine. - -As an example, the inheritance used here is a little contrived, but in real -applications it is likely that the two extensions would add additional -properties or modify the Person classes behavior. - -Running the Example -------------------- - -The BirthdayParty type has not changed since the previous example. The -celebrant and guests property still use the People type. - -However, as all three types, Person, Boy and Girl, have been registered with the -QML system, on assignment QML automatically (and type-safely) converts the Boy -and Girl objects into a Person. - -The main.py file in the example includes a simple shell application that -loads and runs the QML snippet shown below. diff --git a/examples/declarative/referenceexamples/coercion/example.qml b/examples/declarative/referenceexamples/coercion/example.qml deleted file mode 100644 index c47678483..000000000 --- a/examples/declarative/referenceexamples/coercion/example.qml +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import examples.coercion.people - -BirthdayParty { - host: Boy { - name: "Bob Jones" - shoe_size: 12 - } - guests: [ - Boy { name: "Leo Hodges" }, - Boy { name: "Jack Smith" }, - Girl { name: "Anne Brown" } - ] -} diff --git a/examples/declarative/referenceexamples/coercion/main.py b/examples/declarative/referenceexamples/coercion/main.py deleted file mode 100644 index 9f49bc1da..000000000 --- a/examples/declarative/referenceexamples/coercion/main.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/examples/qml/referenceexamples/coercion example from Qt v6.x""" - -from pathlib import Path -import sys - -from PySide6.QtCore import QCoreApplication, QUrl -from PySide6.QtQml import QQmlComponent, QQmlEngine - -from person import Boy, Girl -from birthdayparty import BirthdayParty - - -app = QCoreApplication(sys.argv) -qml_file = Path(__file__).parent / "example.qml" -url = QUrl.fromLocalFile(qml_file) -engine = QQmlEngine() -component = QQmlComponent(engine, url) -party = component.create() -if not party: - print(component.errors()) - del engine - sys.exit(-1) -host = party.host -print(f"{host.name} is having a birthday!") -if isinstance(host, Boy): - print("He is inviting:") -else: - print("She is inviting:") -for g in range(party.guestCount()): - name = party.guest(g).name - print(f" {name}") -del engine -sys.exit(0) diff --git a/examples/declarative/referenceexamples/coercion/person.py b/examples/declarative/referenceexamples/coercion/person.py deleted file mode 100644 index 69056014c..000000000 --- a/examples/declarative/referenceexamples/coercion/person.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property -from PySide6.QtQml import QmlElement, QmlUncreatable - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.coercion.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -@QmlUncreatable("Person is an abstract base class.") -class Person(QObject): - def __init__(self, parent=None): - super().__init__(parent) - self._name = '' - self._shoe_size = 0 - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, n): - self._name = n - - @Property(int) - def shoe_size(self): - return self._shoe_size - - @shoe_size.setter - def shoe_size(self, s): - self._shoe_size = s - - -@QmlElement -class Boy(Person): - def __init__(self, parent=None): - super().__init__(parent) - - -@QmlElement -class Girl(Person): - def __init__(self, parent=None): - super().__init__(parent) diff --git a/examples/declarative/referenceexamples/default/birthdayparty.py b/examples/declarative/referenceexamples/default/birthdayparty.py deleted file mode 100644 index 3c13ca6cf..000000000 --- a/examples/declarative/referenceexamples/default/birthdayparty.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, ClassInfo, Property -from PySide6.QtQml import QmlElement, ListProperty - -from person import Person - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.default.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -@ClassInfo(DefaultProperty="guests") -class BirthdayParty(QObject): - - def __init__(self, parent=None): - super().__init__(parent) - self._host = None - self._guests = [] - - @Property(Person) - def host(self): - return self._host - - @host.setter - def host(self, h): - self._host = h - - def guest(self, n): - return self._guests[n] - - def guestCount(self): - return len(self._guests) - - def appendGuest(self, guest): - self._guests.append(guest) - - guests = ListProperty(Person, appendGuest) diff --git a/examples/declarative/referenceexamples/default/default.pyproject b/examples/declarative/referenceexamples/default/default.pyproject deleted file mode 100644 index 3c01c40c2..000000000 --- a/examples/declarative/referenceexamples/default/default.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "birthdayparty.py", "person.py", "example.qml"] -} diff --git a/examples/declarative/referenceexamples/default/doc/default.rst b/examples/declarative/referenceexamples/default/doc/default.rst deleted file mode 100644 index 1b28519a7..000000000 --- a/examples/declarative/referenceexamples/default/doc/default.rst +++ /dev/null @@ -1,30 +0,0 @@ -.. _qml-default-property-example: - -Extending QML - Default Property Example -======================================== - -This example builds on the :ref:`qml-adding-types-example`, -the :ref:`qml-object-and-list-property-types-example` and -the :ref:`qml-inheritance-and-coercion-example`. - -The Default Property Example is a minor modification of the -:ref:`qml-inheritance-and-coercion-example` that simplifies the -specification of a BirthdayParty through the use of a default property. - -Declaring the BirthdayParty Class ---------------------------------- - -The only difference between this example and the last, is the addition of a -``DefaultProperty`` class info annotation. - -The default property specifies the property to assign to whenever an explicit -property is not specified, in the case of the BirthdayParty type the guest -property. It is purely a syntactic simplification, the behavior is identical -to specifying the property by name, but it can add a more natural feel in many -situations. The default property must be either an object or list property. - -Running the Example -------------------- - -The main.py file in the example includes a simple shell application that -loads and runs the QML snippet shown below. diff --git a/examples/declarative/referenceexamples/default/example.qml b/examples/declarative/referenceexamples/default/example.qml deleted file mode 100644 index 435be7860..000000000 --- a/examples/declarative/referenceexamples/default/example.qml +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import examples.default.people - -BirthdayParty { - host: Boy { - name: "Bob Jones" - shoe_size: 12 - } - - Boy { name: "Leo Hodges" } - Boy { name: "Jack Smith" } - Girl { name: "Anne Brown" } -} diff --git a/examples/declarative/referenceexamples/default/main.py b/examples/declarative/referenceexamples/default/main.py deleted file mode 100644 index a4ce2f08a..000000000 --- a/examples/declarative/referenceexamples/default/main.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/examples/qml/referenceexamples/default example from Qt v6.x""" - -from pathlib import Path -import sys - -from PySide6.QtCore import QCoreApplication, QUrl -from PySide6.QtQml import QQmlComponent, QQmlEngine - -from person import Boy, Girl -from birthdayparty import BirthdayParty - - -app = QCoreApplication(sys.argv) -qml_file = Path(__file__).parent / "example.qml" -url = QUrl.fromLocalFile(qml_file) -engine = QQmlEngine() -component = QQmlComponent(engine, url) -party = component.create() -if not party: - print(component.errors()) - del engine - sys.exit(-1) -host = party.host -print(f"{host.name} is having a birthday!") -if isinstance(host, Boy): - print("He is inviting:") -else: - print("She is inviting:") -for g in range(party.guestCount()): - name = party.guest(g).name - print(f" {name}") -del engine -sys.exit(0) diff --git a/examples/declarative/referenceexamples/default/person.py b/examples/declarative/referenceexamples/default/person.py deleted file mode 100644 index 7164bd645..000000000 --- a/examples/declarative/referenceexamples/default/person.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property -from PySide6.QtQml import QmlAnonymous, QmlElement - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.default.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlAnonymous -class Person(QObject): - def __init__(self, parent=None): - super().__init__(parent) - self._name = '' - self._shoe_size = 0 - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, n): - self._name = n - - @Property(int) - def shoe_size(self): - return self._shoe_size - - @shoe_size.setter - def shoe_size(self, s): - self._shoe_size = s - - -@QmlElement -class Boy(Person): - def __init__(self, parent=None): - super().__init__(parent) - - -@QmlElement -class Girl(Person): - def __init__(self, parent=None): - super().__init__(parent) diff --git a/examples/declarative/referenceexamples/extended/doc/extended.rst b/examples/declarative/referenceexamples/extended/doc/extended.rst deleted file mode 100644 index 745960535..000000000 --- a/examples/declarative/referenceexamples/extended/doc/extended.rst +++ /dev/null @@ -1,41 +0,0 @@ -.. _qml-extension-objects-example: - -Extending QML - Extension Objects Example -========================================= - -This example builds on the the :ref:`qml-adding-types-example`. - -Shows how to use QmlExtended decorator to provide an extension object to a -QLineEdit without modifying or subclassing it. - -Firstly, the LineEditExtension class is registered with the QML system as an -extension of QLineEdit. We declare a foreign type to do this as we cannot -modify Qt's internal QLineEdit class. - -.. code-block:: python - - @QmlNamedElement("QLineEdit") - @QmlExtended(LineEditExtension) - @QmlForeign(QLineEdit) - class LineEditForeign(QObject): - - -Note the usage of ``QmlNamedElement()`` instead of ``QmlElement()``. -``QmlElement()`` uses the name of the containing type by default, -``LineEditExtension`` in this case. As the class being an extension class is -an implementation detail, we choose the more natural name ``QLineEdit`` -instead. - -The QML engine then instantiates a QLineEdit. - -In QML, a property is set on the line edit that only exists in the -``LineEditExtension`` class: - -.. code-block:: javascript - - QLineEdit { - left_margin: 20 - } - -The extension type performs calls on the ``QLineEdit`` that otherwise will not -be accessible to the QML engine. diff --git a/examples/declarative/referenceexamples/extended/example.qml b/examples/declarative/referenceexamples/extended/example.qml deleted file mode 100644 index e4af3bec5..000000000 --- a/examples/declarative/referenceexamples/extended/example.qml +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import examples.extend 1.0 - -QLineEdit { - left_margin: 20 -} diff --git a/examples/declarative/referenceexamples/extended/extended.pyproject b/examples/declarative/referenceexamples/extended/extended.pyproject deleted file mode 100644 index 127a3a76a..000000000 --- a/examples/declarative/referenceexamples/extended/extended.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "example.qml"] -} diff --git a/examples/declarative/referenceexamples/extended/main.py b/examples/declarative/referenceexamples/extended/main.py deleted file mode 100644 index 6ee386401..000000000 --- a/examples/declarative/referenceexamples/extended/main.py +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/examples/qml/referenceexamples/extended example from Qt v6.x""" - -from pathlib import Path -import sys - -from PySide6.QtCore import QObject, QUrl, Property -from PySide6.QtWidgets import QApplication, QLineEdit -from PySide6.QtQml import (QQmlComponent, QQmlEngine, QmlForeign, QmlExtended, - QmlNamedElement) - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.extend" -QML_IMPORT_MAJOR_VERSION = 1 - - -class LineEditExtension(QObject): - - def __init__(self, parent=None): - super().__init__(parent) - self._line_edit = parent - - @Property(int) - def left_margin(self): - return self._line_edit.textMargins().left() - - @left_margin.setter - def left_margin(self, m): - margins = self._line_edit.textMargins() - margins.setLeft(m) - self._line_edit.setTextMargins(margins) - - @Property(int) - def right_margin(self): - return self._line_edit.textMargins().right() - - @right_margin.setter - def right_margin(self, m): - margins = self._line_edit.textMargins() - margins.setRight(m) - self._line_edit.setTextMargins(margins) - - @Property(int) - def top_margin(self): - return self._line_edit.textMargins().top() - - @top_margin.setter - def top_margin(self, m): - margins = self._line_edit.textMargins() - margins.setTop(m) - self._line_edit.setTextMargins(margins) - - @Property(int) - def bottom_margin(self): - return self._line_edit.textMargins().bottom() - - @bottom_margin.setter - def bottom_margin(self, m): - margins = self._line_edit.textMargins() - margins.setBottom(m) - self._line_edit.setTextMargins(margins) - - -@QmlNamedElement("QLineEdit") -@QmlExtended(LineEditExtension) -@QmlForeign(QLineEdit) -class LineEditForeign(QObject): - - def __init__(self, parent=None): - super().__init__(parent) - - -if __name__ == '__main__': - app = QApplication(sys.argv) - - qml_file = Path(__file__).parent / "example.qml" - url = QUrl.fromLocalFile(qml_file) - engine = QQmlEngine() - component = QQmlComponent(engine, url) - widget = component.create() - if not widget: - print(component.errors()) - del engine - sys.exit(-1) - - widget.show() - r = app.exec() - # Deleting the engine before it goes out of scope is required to make sure - # all child QML instances are destroyed in the correct order. - del engine - sys.exit(r) diff --git a/examples/declarative/referenceexamples/grouped/birthdayparty.py b/examples/declarative/referenceexamples/grouped/birthdayparty.py deleted file mode 100644 index 9f414441e..000000000 --- a/examples/declarative/referenceexamples/grouped/birthdayparty.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, ClassInfo, Property -from PySide6.QtQml import QmlElement, ListProperty - -from person import Person - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.grouped.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -@ClassInfo(DefaultProperty="guests") -class BirthdayParty(QObject): - - def __init__(self, parent=None): - super().__init__(parent) - self._host = None - self._guests = [] - - @Property(Person) - def host(self): - return self._host - - @host.setter - def host(self, h): - self._host = h - - def guest(self, n): - return self._guests[n] - - def guestCount(self): - return len(self._guests) - - def appendGuest(self, guest): - self._guests.append(guest) - - guests = ListProperty(Person, appendGuest) diff --git a/examples/declarative/referenceexamples/grouped/doc/grouped.rst b/examples/declarative/referenceexamples/grouped/doc/grouped.rst deleted file mode 100644 index 691c1d393..000000000 --- a/examples/declarative/referenceexamples/grouped/doc/grouped.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. _qml-grouped-example: - -Extending QML - Grouped Properties Example -========================================== - -Grouped Properties. - -This example builds on the the :ref:`qml-default-property-example`, -the :ref:`qml-inheritance-and-coercion-example` -the :ref:`qml-object-and-list-property-types-example` -and the :ref:`qml-adding-types-example`. - -Running the Example -------------------- - -The ``main.py`` file in the example includes a simple shell application that -loads and runs the QML snippet shown below. diff --git a/examples/declarative/referenceexamples/grouped/example.qml b/examples/declarative/referenceexamples/grouped/example.qml deleted file mode 100644 index d0db4f193..000000000 --- a/examples/declarative/referenceexamples/grouped/example.qml +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -import examples.grouped.people - -BirthdayParty { - host: Boy { - name: "Bob Jones" - shoe { size: 12; color: "white"; brand: "Bikey"; price: 90.0 } - } - - Boy { - name: "Leo Hodges" - shoe { size: 10; color: "black"; brand: "Thebok"; price: 59.95 } - } - Boy { name: "Jack Smith" - shoe { - size: 8 - color: "blue" - brand: "Luma" - price: 19.95 - } - } - Girl { - name: "Anne Brown" - shoe.size: 7 - shoe.color: "red" - shoe.brand: "Job Macobs" - shoe.price: 699.99 - } -} diff --git a/examples/declarative/referenceexamples/grouped/grouped.pyproject b/examples/declarative/referenceexamples/grouped/grouped.pyproject deleted file mode 100644 index 3c01c40c2..000000000 --- a/examples/declarative/referenceexamples/grouped/grouped.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "birthdayparty.py", "person.py", "example.qml"] -} diff --git a/examples/declarative/referenceexamples/grouped/main.py b/examples/declarative/referenceexamples/grouped/main.py deleted file mode 100644 index f1edb8b94..000000000 --- a/examples/declarative/referenceexamples/grouped/main.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/examples/qml/referenceexamples/default example from Qt v6.x""" - -from pathlib import Path -import sys - -from PySide6.QtCore import QCoreApplication, QUrl -from PySide6.QtQml import QQmlComponent, QQmlEngine - -from person import Boy, Girl -from birthdayparty import BirthdayParty - - -if __name__ == '__main__': - app = QCoreApplication(sys.argv) - qml_file = Path(__file__).parent / "example.qml" - url = QUrl.fromLocalFile(qml_file) - engine = QQmlEngine() - component = QQmlComponent(engine, url) - party = component.create() - if not party: - print(component.errors()) - del engine - sys.exit(-1) - host = party.host - print(f"{host.name} is having a birthday!") - if isinstance(host, Boy): - print("He is inviting:") - else: - print("She is inviting:") - best_shoe = None - for g in range(party.guestCount()): - guest = party.guest(g) - name = guest.name - print(f" {name}") - if not best_shoe or best_shoe.shoe.price < guest.shoe.price: - best_shoe = guest; - if best_shoe: - print(f"{best_shoe.name} is wearing the best shoes!"); - del engine - sys.exit(0) diff --git a/examples/declarative/referenceexamples/grouped/person.py b/examples/declarative/referenceexamples/grouped/person.py deleted file mode 100644 index a1edf077e..000000000 --- a/examples/declarative/referenceexamples/grouped/person.py +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property -from PySide6.QtGui import QColor -from PySide6.QtQml import QmlAnonymous, QmlElement - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.grouped.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlAnonymous -class ShoeDescription(QObject): - def __init__(self, parent=None): - super().__init__(parent) - self._brand = '' - self._size = 0 - self._price = 0 - self._color = QColor() - - @Property(str) - def brand(self): - return self._brand - - @brand.setter - def brand(self, b): - self._brand = b - - @Property(int) - def size(self): - return self._size - - @size.setter - def size(self, s): - self._size = s - - @Property(float) - def price(self): - return self._price - - @price.setter - def price(self, p): - self._price = p - - @Property(QColor) - def color(self): - return self._color - - @color.setter - def color(self, c): - self._color = c - - -@QmlAnonymous -class Person(QObject): - def __init__(self, parent=None): - super().__init__(parent) - self._name = '' - self._shoe = ShoeDescription() - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, n): - self._name = n - - @Property(ShoeDescription) - def shoe(self): - return self._shoe - - -@QmlElement -class Boy(Person): - def __init__(self, parent=None): - super().__init__(parent) - - -@QmlElement -class Girl(Person): - def __init__(self, parent=None): - super().__init__(parent) diff --git a/examples/declarative/referenceexamples/methods/birthdayparty.py b/examples/declarative/referenceexamples/methods/birthdayparty.py deleted file mode 100644 index 41425a2b1..000000000 --- a/examples/declarative/referenceexamples/methods/birthdayparty.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property, Slot -from PySide6.QtQml import QmlElement, ListProperty - -from person import Person - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.methods.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class BirthdayParty(QObject): - - def __init__(self, parent=None): - super().__init__(parent) - self._host = None - self._guests = [] - - @Property(Person) - def host(self): - return self._host - - @host.setter - def host(self, h): - self._host = h - - def guest(self, n): - return self._guests[n] - - def guestCount(self): - return len(self._guests) - - def appendGuest(self, guest): - self._guests.append(guest) - - @Slot(str) - def invite(self, name): - guest = Person(self) - guest.name = name - self.appendGuest(guest) - - guests = ListProperty(Person, appendGuest) diff --git a/examples/declarative/referenceexamples/methods/doc/methods.rst b/examples/declarative/referenceexamples/methods/doc/methods.rst deleted file mode 100644 index bda2ede5a..000000000 --- a/examples/declarative/referenceexamples/methods/doc/methods.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. _qml-methods-example: - -Extending QML - Methods Example -=============================== - -This example builds on the :ref:`qml-adding-types-example`, -the :ref:`qml-object-and-list-property-types-example` and -the :ref:`qml-inheritance-and-coercion-example`. - -The Methods Example has an additional method in the ``BirthdayParty`` class: -``invite()``. ``invite()`` is decorated with ``@Slot`` so that it can be -called from QML. - -In ``example.qml``, the ``invite()`` method is called -in the ``QtQml.Component.completed()`` signal handler. diff --git a/examples/declarative/referenceexamples/methods/example.qml b/examples/declarative/referenceexamples/methods/example.qml deleted file mode 100644 index c48e952fd..000000000 --- a/examples/declarative/referenceexamples/methods/example.qml +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import examples.methods.people - -BirthdayParty { - host: Person { - name: "Bob Jones" - shoe_size: 12 - } - guests: [ - Person { name: "Leo Hodges" }, - Person { name: "Jack Smith" }, - Person { name: "Anne Brown" } - ] - - Component.onCompleted: invite("William Green") -} diff --git a/examples/declarative/referenceexamples/methods/main.py b/examples/declarative/referenceexamples/methods/main.py deleted file mode 100644 index 31748ff2b..000000000 --- a/examples/declarative/referenceexamples/methods/main.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/examples/qml/referenceexamples/methods example from Qt v6.x""" - -from pathlib import Path -import sys - -from PySide6.QtCore import QCoreApplication, QUrl -from PySide6.QtQml import QQmlComponent, QQmlEngine - -from person import Person -from birthdayparty import BirthdayParty - - -app = QCoreApplication(sys.argv) -qml_file = Path(__file__).parent / "example.qml" -url = QUrl.fromLocalFile(qml_file) -engine = QQmlEngine() -component = QQmlComponent(engine, url) -party = component.create() -if not party: - print(component.errors()) - del engine - sys.exit(-1) -host = party.host -print(f"{host.name} is having a birthday!\nThey are inviting:") -for g in range(party.guestCount()): - name = party.guest(g).name - print(f" {name}") -del engine -sys.exit(0) diff --git a/examples/declarative/referenceexamples/methods/methods.pyproject b/examples/declarative/referenceexamples/methods/methods.pyproject deleted file mode 100644 index 3c01c40c2..000000000 --- a/examples/declarative/referenceexamples/methods/methods.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "birthdayparty.py", "person.py", "example.qml"] -} diff --git a/examples/declarative/referenceexamples/methods/person.py b/examples/declarative/referenceexamples/methods/person.py deleted file mode 100644 index b5e0bd899..000000000 --- a/examples/declarative/referenceexamples/methods/person.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property -from PySide6.QtQml import QmlElement - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.methods.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class Person(QObject): - def __init__(self, parent=None): - super().__init__(parent) - self._name = '' - self._shoe_size = 0 - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, n): - self._name = n - - @Property(int) - def shoe_size(self): - return self._shoe_size - - @shoe_size.setter - def shoe_size(self, s): - self._shoe_size = s diff --git a/examples/declarative/referenceexamples/properties/birthdayparty.py b/examples/declarative/referenceexamples/properties/birthdayparty.py deleted file mode 100644 index 1a115101b..000000000 --- a/examples/declarative/referenceexamples/properties/birthdayparty.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property -from PySide6.QtQml import QmlElement, ListProperty - -from person import Person - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.properties.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class BirthdayParty(QObject): - - def __init__(self, parent=None): - super().__init__(parent) - self._host = None - self._guests = [] - - @Property(Person) - def host(self): - return self._host - - @host.setter - def host(self, h): - self._host = h - - def guest(self, n): - return self._guests[n] - - def guestCount(self): - return len(self._guests) - - def appendGuest(self, guest): - self._guests.append(guest) - - guests = ListProperty(Person, appendGuest) diff --git a/examples/declarative/referenceexamples/properties/doc/properties.rst b/examples/declarative/referenceexamples/properties/doc/properties.rst deleted file mode 100644 index 909434c3c..000000000 --- a/examples/declarative/referenceexamples/properties/doc/properties.rst +++ /dev/null @@ -1,89 +0,0 @@ -.. _qml-object-and-list-property-types-example: - -Extending QML - Object and List Property Types Example -====================================================== - -Exporting C++ Properties. - -This example builds on :ref:`qml-adding-types-example`. - -The Object and List Property Types example shows how to add object and list -properties in QML. This example adds a BirthdayParty type that specifies a -birthday party, consisting of a celebrant and a list of guests. People are -specified using the People QML type built in the previous example. - -import examples.properties.people - -.. code-block:: javascript - - BirthdayParty { - host: Person { - name: "Bob Jones" - shoe_size: 12 - } - guests: [ - Person { name: "Leo Hodges" }, - Person { name: "Jack Smith" }, - Person { name: "Anne Brown" } - ] - } - -Declare the BirthdayParty -------------------------- - -The BirthdayParty class is declared like this: - -.. code-block:: python - - from person import Person - - - # To be used on the @QmlElement decorator - # (QML_IMPORT_MINOR_VERSION is optional) - QML_IMPORT_NAME = "examples.properties.people" - QML_IMPORT_MAJOR_VERSION = 1 - - - @QmlElement - class BirthdayParty(QObject): - - def __init__(self, parent=None): - super().__init__(parent) - self._host = None - self._guests = [] - - @Property(Person) - def host(self): - return self._host - - @host.setter - def host(self, h): - self._host = h - - def guest(self, n): - return self._guests[n] - - def guestCount(self): - return len(self._guests) - - def appendGuest(self, guest): - self._guests.append(guest) - - guests = ListProperty(Person, appendGuest) - -The class contains a member to store the celebrant object, and also a -list member storing the Person instances. - -In QML, the type of a list properties - and the guests property is a list of -people - are all of type ListProperty. ListProperty is simple value -type that contains a set of functions. QML calls these functions -whenever it needs to read from, write to or otherwise interact with -the list. In addition to concrete lists like the people list used in this -example, the use of QQmlListProperty allows for "virtual lists" and other advanced -scenarios. - -Running the Example -------------------- - -The main.py file in the example includes a simple shell application that -loads and runs the QML snippet shown at the beginning of this page. diff --git a/examples/declarative/referenceexamples/properties/example.qml b/examples/declarative/referenceexamples/properties/example.qml deleted file mode 100644 index 1486a0f92..000000000 --- a/examples/declarative/referenceexamples/properties/example.qml +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import examples.properties.people - -BirthdayParty { - host: Person { - name: "Bob Jones" - shoe_size: 12 - } - guests: [ - Person { name: "Leo Hodges" }, - Person { name: "Jack Smith" }, - Person { name: "Anne Brown" } - ] -} diff --git a/examples/declarative/referenceexamples/properties/main.py b/examples/declarative/referenceexamples/properties/main.py deleted file mode 100644 index a980b25aa..000000000 --- a/examples/declarative/referenceexamples/properties/main.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/examples/qml/referenceexamples/properties example from Qt v6.x""" - -from pathlib import Path -import sys - -from PySide6.QtCore import QCoreApplication, QUrl -from PySide6.QtQml import QQmlComponent, QQmlEngine - -from person import Person -from birthdayparty import BirthdayParty - - -if __name__ == '__main__': - app = QCoreApplication(sys.argv) - - qml_file = Path(__file__).parent / "example.qml" - url = QUrl.fromLocalFile(qml_file) - engine = QQmlEngine() - component = QQmlComponent(engine, url) - - party = component.create() - if party: - print(f"{party.host} is having a birthday!\nThey are inviting:") - for g in range(party.guestCount()): - name = party.guest(g).name - print(f" {name}") - else: - print(component.errors()) - - del engine - sys.exit(0) diff --git a/examples/declarative/referenceexamples/properties/person.py b/examples/declarative/referenceexamples/properties/person.py deleted file mode 100644 index 4cc54260a..000000000 --- a/examples/declarative/referenceexamples/properties/person.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property -from PySide6.QtQml import QmlElement - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.properties.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class Person(QObject): - def __init__(self, parent=None): - super().__init__(parent) - self._name = '' - self._shoe_size = 0 - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, n): - self._name = n - - @Property(int) - def shoe_size(self): - return self._shoe_size - - @shoe_size.setter - def shoe_size(self, s): - self._shoe_size = s - diff --git a/examples/declarative/referenceexamples/properties/properties.pyproject b/examples/declarative/referenceexamples/properties/properties.pyproject deleted file mode 100644 index 0f5958fc3..000000000 --- a/examples/declarative/referenceexamples/properties/properties.pyproject +++ /dev/null @@ -1,6 +0,0 @@ -{ - "files": ["example.qml", - "main.py", - "person.py", - "birthdayparty.py"] -} diff --git a/examples/declarative/referenceexamples/valuesource/birthdayparty.py b/examples/declarative/referenceexamples/valuesource/birthdayparty.py deleted file mode 100644 index 3bc75e819..000000000 --- a/examples/declarative/referenceexamples/valuesource/birthdayparty.py +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QDate, QObject, ClassInfo, Property, QTime, Signal -from PySide6.QtQml import QmlAnonymous, QmlAttached, QmlElement, ListProperty - -from person import Person - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.valuesource.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlAnonymous -class BirthdayPartyAttached(QObject): - - def __init__(self, parent=None): - super().__init__(parent) - self._rsvp = QDate() - - @Property(QDate) - def rsvp(self): - return self._rsvp - - @rsvp.setter - def rsvp(self, d): - self._rsvp = d - - -@QmlElement -@ClassInfo(DefaultProperty="guests") -@QmlAttached(BirthdayPartyAttached) -class BirthdayParty(QObject): - - partyStarted = Signal(QTime) - - def __init__(self, parent=None): - super().__init__(parent) - self._host = None - self._guests = [] - - def startParty(self): - self.partyStarted.emit(QTime.currentTime()) - - @Property(Person) - def host(self): - return self._host - - @host.setter - def host(self, h): - self._host = h - - @Property(str) - def announcement(self): - return "" - - @announcement.setter - def announcement(self, a): - print(a) - - def guest(self, n): - return self._guests[n] - - def guestCount(self): - return len(self._guests) - - def appendGuest(self, guest): - self._guests.append(guest) - - @staticmethod - def qmlAttachedProperties(self, o): - return BirthdayPartyAttached(o) - - guests = ListProperty(Person, appendGuest) diff --git a/examples/declarative/referenceexamples/valuesource/doc/valuesource.rst b/examples/declarative/referenceexamples/valuesource/doc/valuesource.rst deleted file mode 100644 index 81fbc827f..000000000 --- a/examples/declarative/referenceexamples/valuesource/doc/valuesource.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. _qml-valuesource-example: - -Extending QML - Value Source Example -==================================== - -This example builds on the :ref:`qml-adding-types-example`, -the :ref:`qml-attached-properties-example`, -the :ref:`qml-default-property-example`, -the :ref:`qml-inheritance-and-coercion-example` and -the :ref:`qml-object-and-list-property-types-example`. - -It demonstrates implementing a -`property value source `_ -in Python. - -Running the Example -------------------- - -The main.py file in the example includes a simple shell application that -loads and runs the QML snippet shown below. diff --git a/examples/declarative/referenceexamples/valuesource/example.qml b/examples/declarative/referenceexamples/valuesource/example.qml deleted file mode 100644 index cb9683f3a..000000000 --- a/examples/declarative/referenceexamples/valuesource/example.qml +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import examples.valuesource.people - -BirthdayParty { - HappyBirthdaySong on announcement { name: "Bob Jones" } - - onPartyStarted: (time) => { console.log("This party started rockin' at " + time); } - - host: Boy { - name: "Bob Jones" - shoe_size: 12 - } - - Boy { - name: "Leo Hodges" - BirthdayParty.rsvp: "2009-07-06" - } - Boy { - name: "Jack Smith" - } - Girl { - name: "Anne Brown" - BirthdayParty.rsvp: "2009-07-01" - } -} diff --git a/examples/declarative/referenceexamples/valuesource/happybirthdaysong.py b/examples/declarative/referenceexamples/valuesource/happybirthdaysong.py deleted file mode 100644 index cffddd39e..000000000 --- a/examples/declarative/referenceexamples/valuesource/happybirthdaysong.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, QTimer, Property, Slot -from PySide6.QtQml import QmlElement, QPyQmlPropertyValueSource - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.valuesource.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class HappyBirthdaySong(QPyQmlPropertyValueSource): - - def __init__(self, parent=None): - super().__init__(parent) - - self.m_target = None - self.m_name = "" - self.m_line = -1 - self.m_lyrics = [] - - self.m_timer = QTimer(self) - self.m_timer.timeout.connect(self.advance) - self.m_timer.start(1000) - - def setTarget(self, property): - self.m_target = property - - @Property(str) - def name(self): - return self.m_name - - @name.setter - def name(self, n): - self.m_name = n - self.m_lyrics = ["Happy birthday to you,", - "Happy birthday to you,", - f"Happy birthday dear {self.m_name},", - "Happy birthday to you!", - ""] - - @Slot() - def advance(self): - self.m_line = (self.m_line + 1) % len(self.m_lyrics) - self.m_target.write(self.m_lyrics[self.m_line]) diff --git a/examples/declarative/referenceexamples/valuesource/main.py b/examples/declarative/referenceexamples/valuesource/main.py deleted file mode 100644 index c3ded4be9..000000000 --- a/examples/declarative/referenceexamples/valuesource/main.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -"""PySide6 port of the qml/examples/qml/referenceexamples/valuesource example from Qt v6.x""" - -from pathlib import Path -import sys - -from PySide6.QtCore import QCoreApplication, QUrl -from PySide6.QtQml import QQmlComponent, QQmlEngine, qmlAttachedPropertiesObject - -from person import Boy, Girl -from birthdayparty import BirthdayParty -from happybirthdaysong import HappyBirthdaySong - - -app = QCoreApplication(sys.argv) -qml_file = Path(__file__).parent / "example.qml" -url = QUrl.fromLocalFile(qml_file) -engine = QQmlEngine() -component = QQmlComponent(engine, url) -party = component.create() -if not party: - print(component.errors()) - del engine - sys.exit(-1) -host = party.host -print(f"{host.name} is having a birthday!") -if isinstance(host, Boy): - print("He is inviting:") -else: - print("She is inviting:") -for g in range(party.guestCount()): - guest = party.guest(g) - name = guest.name - - rsvp_date = None - attached = qmlAttachedPropertiesObject(BirthdayParty, guest, False) - if attached: - rsvp_date = attached.rsvp.toString() - if rsvp_date: - print(f" {name} RSVP date: {rsvp_date}") - else: - print(f" {name} RSVP date: Hasn't RSVP'd") - -party.startParty() - -r = app.exec() - -del engine -sys.exit(r) diff --git a/examples/declarative/referenceexamples/valuesource/person.py b/examples/declarative/referenceexamples/valuesource/person.py deleted file mode 100644 index 5cd04e38a..000000000 --- a/examples/declarative/referenceexamples/valuesource/person.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from PySide6.QtCore import QObject, Property -from PySide6.QtQml import QmlAnonymous, QmlElement - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.valuesource.people" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlAnonymous -class Person(QObject): - def __init__(self, parent=None): - super().__init__(parent) - self._name = '' - self._shoe_size = 0 - - @Property(str) - def name(self): - return self._name - - @name.setter - def name(self, n): - self._name = n - - @Property(int) - def shoe_size(self): - return self._shoe_size - - @shoe_size.setter - def shoe_size(self, s): - self._shoe_size = s - - -@QmlElement -class Boy(Person): - def __init__(self, parent=None): - super().__init__(parent) - - -@QmlElement -class Girl(Person): - def __init__(self, parent=None): - super().__init__(parent) diff --git a/examples/declarative/referenceexamples/valuesource/valuesource.pyproject b/examples/declarative/referenceexamples/valuesource/valuesource.pyproject deleted file mode 100644 index a782d5c8a..000000000 --- a/examples/declarative/referenceexamples/valuesource/valuesource.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "birthdayparty.py", "happybirthdaysong.py", "person.py", "example.qml"] -} diff --git a/examples/declarative/rendercontrol/rendercontrol_opengl/cuberenderer.py b/examples/declarative/rendercontrol/rendercontrol_opengl/cuberenderer.py deleted file mode 100644 index 4a3bf737c..000000000 --- a/examples/declarative/rendercontrol/rendercontrol_opengl/cuberenderer.py +++ /dev/null @@ -1,186 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import ctypes -import numpy -from OpenGL.GL import (GL_COLOR_BUFFER_BIT, GL_CULL_FACE, GL_CW, - GL_DEPTH_BUFFER_BIT, GL_DEPTH_TEST, GL_FALSE, GL_FLOAT, - GL_TEXTURE_2D, GL_TRIANGLES) - -from PySide6.QtGui import (QMatrix4x4, QOffscreenSurface, QOpenGLContext, - QOpenGLFunctions, QWindow) -from PySide6.QtOpenGL import (QOpenGLBuffer, QOpenGLShader, - QOpenGLShaderProgram, QOpenGLVertexArrayObject) -from shiboken6 import VoidPtr - - -VERTEXSHADER_SOURCE = """attribute highp vec4 vertex; -attribute lowp vec2 coord; -varying lowp vec2 v_coord; -uniform highp mat4 matrix; -void main() { - v_coord = coord; - gl_Position = matrix * vertex; -} -""" - - -FRAGMENTSHADER_SOURCE = """varying lowp vec2 v_coord; -uniform sampler2D sampler; -void main() { - gl_FragColor = vec4(texture2D(sampler, v_coord).rgb, 1.0); -} -""" - - -FLOAT_SIZE = ctypes.sizeof(ctypes.c_float) - - -VERTEXES = numpy.array([-0.5, 0.5, 0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, - 0.5, -0.5, 0.5, -0.5, 0.5, 0.5, 0.5, 0.5, 0.5, - -0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, -0.5, - 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, -0.5, - - 0.5, -0.5, -0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5, - 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, -0.5, 0.5, - -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, - -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, - - 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, - -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, - -0.5, -0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, - 0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5], - dtype=numpy.float32) - - -TEX_COORDS = numpy.array([0.0, 0.0, 1.0, 1.0, 1.0, 0.0, - 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, - 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, - 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, - - 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, - 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, - 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, - 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, - - 0.0, 1.0, 1.0, 0.0, 1.0, 1.0, - 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, - 1.0, 0.0, 1.0, 1.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, 1.0, 1.0], dtype=numpy.float32) - - -class CubeRenderer(): - def __init__(self, offscreenSurface): - self.m_angle = 0 - self.m_offscreenSurface = offscreenSurface - self.m_context = None - self.m_program = None - self.m_vbo = None - self.m_vao = None - self.m_matrixLoc = 0 - self.m_proj = QMatrix4x4() - - def __del__(self): - # Use a temporary offscreen surface to do the cleanup. There may not - # be a native window surface available anymore at self stage. - self.m_context.makeCurrent(self.m_offscreenSurface) - del self.m_program - del self.m_vbo - del self.m_vao - self.m_context.doneCurrent() - - def init(self, w, share): - self.m_context = QOpenGLContext() - self.m_context.setShareContext(share) - self.m_context.setFormat(w.requestedFormat()) - self.m_context.create() - if not self.m_context.makeCurrent(w): - return - - f = self.m_context.functions() - f.glClearColor(0.0, 0.1, 0.25, 1.0) - f.glViewport(0, 0, w.width() * w.devicePixelRatio(), - w.height() * w.devicePixelRatio()) - - self.m_program = QOpenGLShaderProgram() - self.m_program.addCacheableShaderFromSourceCode(QOpenGLShader.Vertex, - VERTEXSHADER_SOURCE) - self.m_program.addCacheableShaderFromSourceCode(QOpenGLShader.Fragment, - FRAGMENTSHADER_SOURCE) - self.m_program.bindAttributeLocation("vertex", 0) - self.m_program.bindAttributeLocation("coord", 1) - self.m_program.link() - self.m_matrixLoc = self.m_program.uniformLocation("matrix") - - self.m_vao = QOpenGLVertexArrayObject() - self.m_vao.create() - vaoBinder = QOpenGLVertexArrayObject.Binder(self.m_vao) - - self.m_vbo = QOpenGLBuffer() - self.m_vbo.create() - self.m_vbo.bind() - - vertexCount = 36 - self.m_vbo.allocate(FLOAT_SIZE * vertexCount * 5) - vertex_data = VERTEXES.tobytes() - tex_coord_data = TEX_COORDS.tobytes() - self.m_vbo.write(0, VoidPtr(vertex_data), - FLOAT_SIZE * vertexCount * 3) - self.m_vbo.write(FLOAT_SIZE * vertexCount * 3, - VoidPtr(tex_coord_data), - FLOAT_SIZE * vertexCount * 2) - self.m_vbo.release() - - if self.m_vao.isCreated(): - self.setupVertexAttribs() - - def resize(self, w, h): - self.m_proj.setToIdentity() - self.m_proj.perspective(45, w / float(h), 0.01, 100.0) - - def setupVertexAttribs(self): - self.m_vbo.bind() - self.m_program.enableAttributeArray(0) - self.m_program.enableAttributeArray(1) - f = self.m_context.functions() - - null = VoidPtr(0) - pointer = VoidPtr(36 * 3 * FLOAT_SIZE) - f.glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, null) - f.glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, pointer) - self.m_vbo.release() - - def render(self, w, share, texture): - if not self.m_context: - self.init(w, share) - - if not self.m_context.makeCurrent(w): - return - - f = self.m_context.functions() - f.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) - - if texture: - f.glBindTexture(GL_TEXTURE_2D, texture) - f.glFrontFace(GL_CW) # because our cube's vertex data is such - f.glEnable(GL_CULL_FACE) - f.glEnable(GL_DEPTH_TEST) - - self.m_program.bind() - vaoBinder = QOpenGLVertexArrayObject.Binder(self.m_vao) - # If VAOs are not supported, set the vertex attributes every time. - if not self.m_vao.isCreated(): - self.setupVertexAttribs() - - m = QMatrix4x4() - m.translate(0, 0, -2) - m.rotate(90, 0, 0, 1) - m.rotate(self.m_angle, 0.5, 1, 0) - self.m_angle += 0.5 - - self.m_program.setUniformValue(self.m_matrixLoc, self.m_proj * m) - - # Draw the cube. - f.glDrawArrays(GL_TRIANGLES, 0, 36) - - self.m_context.swapBuffers(w) diff --git a/examples/declarative/rendercontrol/rendercontrol_opengl/demo.qml b/examples/declarative/rendercontrol/rendercontrol_opengl/demo.qml deleted file mode 100644 index 185c52c5f..000000000 --- a/examples/declarative/rendercontrol/rendercontrol_opengl/demo.qml +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick 2.0 -import QtQuick.Particles 2.0 - -Rectangle { - id: root - - gradient: Gradient { - GradientStop { position: 0; color: mouse.pressed ? "lightsteelblue" : "steelblue" } - GradientStop { position: 1; color: "black" } - } - - Text { - anchors.centerIn: parent - text: "Qt Quick in a texture" - font.pointSize: 40 - color: "white" - - SequentialAnimation on rotation { - PauseAnimation { duration: 2500 } - NumberAnimation { from: 0; to: 360; duration: 5000; easing.type: Easing.InOutCubic } - loops: Animation.Infinite - } - } - - ParticleSystem { - id: particles - anchors.fill: parent - - ImageParticle { - id: smoke - system: particles - anchors.fill: parent - groups: ["A", "B"] - source: "qrc:///particleresources/glowdot.png" - colorVariation: 0 - color: "#00111111" - } - ImageParticle { - id: flame - anchors.fill: parent - system: particles - groups: ["C", "D"] - source: "qrc:///particleresources/glowdot.png" - colorVariation: 0.1 - color: "#00ff400f" - } - - Emitter { - id: fire - system: particles - group: "C" - - y: parent.height - width: parent.width - - emitRate: 350 - lifeSpan: 3500 - - acceleration: PointDirection { y: -17; xVariation: 3 } - velocity: PointDirection {xVariation: 3} - - size: 24 - sizeVariation: 8 - endSize: 4 - } - - TrailEmitter { - id: fireSmoke - group: "B" - system: particles - follow: "C" - width: root.width - height: root.height - 68 - - emitRatePerParticle: 1 - lifeSpan: 2000 - - velocity: PointDirection {y:-17*6; yVariation: -17; xVariation: 3} - acceleration: PointDirection {xVariation: 3} - - size: 36 - sizeVariation: 8 - endSize: 16 - } - - TrailEmitter { - id: fireballFlame - anchors.fill: parent - system: particles - group: "D" - follow: "E" - - emitRatePerParticle: 120 - lifeSpan: 180 - emitWidth: TrailEmitter.ParticleSize - emitHeight: TrailEmitter.ParticleSize - emitShape: EllipseShape{} - - size: 16 - sizeVariation: 4 - endSize: 4 - } - - TrailEmitter { - id: fireballSmoke - anchors.fill: parent - system: particles - group: "A" - follow: "E" - - emitRatePerParticle: 128 - lifeSpan: 2400 - emitWidth: TrailEmitter.ParticleSize - emitHeight: TrailEmitter.ParticleSize - emitShape: EllipseShape{} - - velocity: PointDirection {yVariation: 16; xVariation: 16} - acceleration: PointDirection {y: -16} - - size: 24 - sizeVariation: 8 - endSize: 8 - } - - Emitter { - id: balls - system: particles - group: "E" - - y: parent.height - width: parent.width - - emitRate: 2 - lifeSpan: 7000 - - velocity: PointDirection {y:-17*4*2; xVariation: 6*6} - acceleration: PointDirection {y: 17*2; xVariation: 6*6} - - size: 8 - sizeVariation: 4 - } - - Turbulence { //A bit of turbulence makes the smoke look better - anchors.fill: parent - groups: ["A","B"] - strength: 32 - system: particles - } - } - - onWidthChanged: particles.reset() - onHeightChanged: particles.reset() - - MouseArea { - id: mouse - anchors.fill: parent - } -} diff --git a/examples/declarative/rendercontrol/rendercontrol_opengl/doc/rendercontrol_opengl.rst b/examples/declarative/rendercontrol/rendercontrol_opengl/doc/rendercontrol_opengl.rst deleted file mode 100644 index f47567f52..000000000 --- a/examples/declarative/rendercontrol/rendercontrol_opengl/doc/rendercontrol_opengl.rst +++ /dev/null @@ -1,5 +0,0 @@ -QQuickRenderControl OpenGL Example -================================== - -The QQuickRenderControl OpenGL Example shows how to render a Qt Quick scene into a -texture that is then used by a non-Quick based OpenGL renderer. diff --git a/examples/declarative/rendercontrol/rendercontrol_opengl/main.py b/examples/declarative/rendercontrol/rendercontrol_opengl/main.py deleted file mode 100644 index ee885ae6d..000000000 --- a/examples/declarative/rendercontrol/rendercontrol_opengl/main.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import sys -from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickWindow, QSGRendererInterface - -from window_singlethreaded import WindowSingleThreaded - - -if __name__ == "__main__": - app = QGuiApplication(sys.argv) - # only functional when Qt Quick is also using OpenGL - QQuickWindow.setGraphicsApi(QSGRendererInterface.OpenGLRhi) - window = WindowSingleThreaded() - window.resize(1024, 768) - window.show() - ex = app.exec() - del window - sys.exit(ex) diff --git a/examples/declarative/rendercontrol/rendercontrol_opengl/rendercontrol_opengl.pyproject b/examples/declarative/rendercontrol/rendercontrol_opengl/rendercontrol_opengl.pyproject deleted file mode 100644 index b2e80ab23..000000000 --- a/examples/declarative/rendercontrol/rendercontrol_opengl/rendercontrol_opengl.pyproject +++ /dev/null @@ -1,6 +0,0 @@ -{ - "files": ["cuberenderer.py", - "main.py", - "window_singlethreaded.py", - "demo.qml"] -} diff --git a/examples/declarative/rendercontrol/rendercontrol_opengl/window_singlethreaded.py b/examples/declarative/rendercontrol/rendercontrol_opengl/window_singlethreaded.py deleted file mode 100644 index 164d6a08c..000000000 --- a/examples/declarative/rendercontrol/rendercontrol_opengl/window_singlethreaded.py +++ /dev/null @@ -1,275 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import numpy -from pathlib import Path -import sys -import weakref -from OpenGL.GL import (GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, - GL_NEAREST, GL_RGBA, GL_TEXTURE_2D, GL_UNSIGNED_BYTE) - -from PySide6.QtGui import (QMatrix4x4, QMouseEvent, QOffscreenSurface, - QOpenGLContext, QOpenGLFunctions, QScreen, QSurface, - QSurfaceFormat, QWindow) -from PySide6.QtOpenGL import (QOpenGLFramebufferObject, QOpenGLTexture, - QOpenGLShaderProgram, QOpenGLVertexArrayObject, - QOpenGLBuffer) -from PySide6.QtQml import QQmlComponent, QQmlEngine -from PySide6.QtQuick import (QQuickGraphicsDevice, - QQuickItem, QQuickRenderControl, - QQuickRenderTarget, QQuickWindow) -from PySide6.QtCore import QCoreApplication, QTimer, QUrl, Slot -from shiboken6 import VoidPtr - -from cuberenderer import CubeRenderer - - -class RenderControl(QQuickRenderControl): - def __init__(self, window=None): - super().__init__() - self._window = window - - def renderWindow(self, offset): - return self._window() # Dereference the weak reference - - -class WindowSingleThreaded(QWindow): - - def __init__(self): - super().__init__() - self.m_rootItem = None - self.m_device = None - self.m_texture_ids = numpy.array([0], dtype=numpy.uint32) - - self.m_quickInitialized = False - self.m_quickReady = False - self.m_dpr = 0 - self.m_status_conn_id = None - self.setSurfaceType(QSurface.OpenGLSurface) - - format = QSurfaceFormat() - # Qt Quick may need a depth and stencil buffer. Always make sure these - # are available. - format.setDepthBufferSize(16) - format.setStencilBufferSize(8) - self.setFormat(format) - - self.m_context = QOpenGLContext() - self.m_context.setFormat(format) - self.m_context.create() - - self.m_offscreenSurface = QOffscreenSurface() - # Pass m_context.format(), not format. Format does not specify and - # color buffer sizes, while the context, that has just been created, - # reports a format that has these values filled in. Pass self to the - # offscreen surface to make sure it will be compatible with the - # context's configuration. - self.m_offscreenSurface.setFormat(self.m_context.format()) - self.m_offscreenSurface.create() - - self.m_cubeRenderer = CubeRenderer(self.m_offscreenSurface) - - self.m_renderControl = RenderControl(weakref.ref(self)) - - # Create a QQuickWindow that is associated with out render control. - # Note that this window never gets created or shown, meaning that - # will never get an underlying native (platform) window. - self.m_quickWindow = QQuickWindow(self.m_renderControl) - - # Create a QML engine. - self.m_qmlEngine = QQmlEngine() - if not self.m_qmlEngine.incubationController(): - c = self.m_quickWindow.incubationController() - self.m_qmlEngine.setIncubationController(c) - - # When Quick says there is a need to render, we will not render - # immediately. Instead, a timer with a small interval is used - # to get better performance. - self.m_updateTimer = QTimer() - self.m_updateTimer.setSingleShot(True) - self.m_updateTimer.setInterval(5) - self.m_updateTimer.timeout.connect(self.render) - - # Now hook up the signals. For simplicy we don't differentiate between - # renderRequested (only render is needed, no sync) and sceneChanged - # (polish and sync is needed too). - self.m_quickWindow.sceneGraphInitialized.connect(self.createTexture) - self.m_quickWindow.sceneGraphInvalidated.connect(self.destroyTexture) - self.m_renderControl.renderRequested.connect(self.requestUpdate) - self.m_renderControl.sceneChanged.connect(self.requestUpdate) - - # Just recreating the texture on resize is not sufficient, when moving - # between screens with different devicePixelRatio the QWindow size may - # remain the same but the texture dimension is to change regardless. - self.screenChanged.connect(self.handleScreenChange) - - def __del__(self): - # Make sure the context is current while doing cleanup. Note that - # we use the offscreen surface here because passing 'self' at self - # point is not safe: the underlying platform window may already be - # destroyed. To avoid all the trouble, use another surface that is - # valid for sure. - self.m_context.makeCurrent(self.m_offscreenSurface) - - del self.m_qmlComponent - del self.m_qmlEngine - del self.m_quickWindow - del self.m_renderControl - - if self.texture_id(): - self.m_context.functions().glDeleteTextures(1, self.m_texture_ids) - - self.m_context.doneCurrent() - - def texture_id(self): - return self.m_texture_ids[0] - - def set_texture_id(self, texture_id): - self.m_texture_ids[0] = texture_id - - @Slot() - def createTexture(self): - # The scene graph has been initialized. It is now time to create a - # texture and associate it with the QQuickWindow. - self.m_dpr = self.devicePixelRatio() - self.m_textureSize = self.size() * self.m_dpr - f = self.m_context.functions() - f.glGenTextures(1, self.m_texture_ids) - f.glBindTexture(GL_TEXTURE_2D, self.texture_id()) - - f.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST) - f.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) - null = VoidPtr(0) - f.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, self.m_textureSize.width(), - self.m_textureSize.height(), 0, - GL_RGBA, GL_UNSIGNED_BYTE, null) - target = QQuickRenderTarget.fromOpenGLTexture(self.texture_id(), - self.m_textureSize) - self.m_quickWindow.setRenderTarget(target) - - @Slot() - def destroyTexture(self): - self.m_context.functions().glDeleteTextures(1, self.m_texture_ids) - self.set_texture_id(0) - - @Slot() - def render(self): - if not self.m_context.makeCurrent(self.m_offscreenSurface): - return - - # Polish, synchronize and render the next frame (into our texture). - # In this example everything happens on the same thread and therefore - # all three steps are performed in succession from here. In a threaded - # setup the render() call would happen on a separate thread. - self.m_renderControl.beginFrame() - self.m_renderControl.polishItems() - self.m_renderControl.sync() - self.m_renderControl.render() - self.m_renderControl.endFrame() - - QOpenGLFramebufferObject.bindDefault() - self.m_context.functions().glFlush() - - self.m_quickReady = True - - # Get something onto the screen. - texture_id = self.texture_id() if self.m_quickReady else 0 - self.m_cubeRenderer.render(self, self.m_context, texture_id) - - def requestUpdate(self): - if not self.m_updateTimer.isActive(): - self.m_updateTimer.start() - - def run(self): - if self.m_status_conn_id: - self.m_qmlComponent.statusChanged.disconnect(self.m_status_conn_id) - self.m_status_conn_id = None - - if self.m_qmlComponent.isError(): - for error in self.m_qmlComponent.errors(): - print(error.url().toString(), error.line(), error.toString()) - return - - self.m_rootItem = self.m_qmlComponent.create() - if self.m_qmlComponent.isError(): - for error in self.m_qmlComponent.errors(): - print(error.url().toString(), error.line(), error.toString()) - return - - if not self.m_rootItem: - print("run: Not a QQuickItem") - del self.m_rootItem - - # The root item is ready. Associate it with the window. - self.m_rootItem.setParentItem(self.m_quickWindow.contentItem()) - - # Update item and rendering related geometries. - self.updateSizes() - - # Initialize the render control and our OpenGL resources. - self.m_context.makeCurrent(self.m_offscreenSurface) - self.m_device = QQuickGraphicsDevice.fromOpenGLContext(self.m_context) - self.m_quickWindow.setGraphicsDevice(self.m_device) - self.m_renderControl.initialize() - self.m_quickInitialized = True - - def updateSizes(self): - # Behave like SizeRootObjectToView. - w = self.width() - h = self.height() - self.m_rootItem.setWidth(w) - self.m_rootItem.setHeight(h) - self.m_quickWindow.setGeometry(0, 0, w, h) - self.m_cubeRenderer.resize(w, h) - - def startQuick(self, filename): - url = QUrl.fromLocalFile(filename) - self.m_qmlComponent = QQmlComponent(self.m_qmlEngine, url) - if self.m_qmlComponent.isLoading(): - self.m_status_conn_id = self.m_qmlComponent.statusChanged.connect(self.run) - else: - self.run() - - def exposeEvent(self, event): - if self.isExposed() and not self.m_quickInitialized: - texture_id = self.texture_id() if self.m_quickReady else 0 - self.m_cubeRenderer.render(self, self.m_context, texture_id) - qml_file = Path(__file__).parent / "demo.qml" - self.startQuick(qml_file) - - def resizeTexture(self): - if self.m_rootItem and self.m_context.makeCurrent(self.m_offscreenSurface): - self.m_context.functions().glDeleteTextures(1, self.m_texture_ids) - self.set_texture_id(0) - self.createTexture() - self.m_context.doneCurrent() - self.updateSizes() - self.render() - - def resizeEvent(self, event): - # If self is a resize after the scene is up and running, recreate the - # texture and the Quick item and scene. - if (self.texture_id() - and self.m_textureSize != self.size() * self.devicePixelRatio()): - self.resizeTexture() - - @Slot() - def handleScreenChange(self): - if self.m_dpr != self.devicePixelRatio(): - self.resizeTexture() - - def mousePressEvent(self, e): - # Use the constructor taking position and globalPosition. That puts - # position into the event's position and scenePosition, and - # globalPosition into the event's globalPosition. This way the - # scenePosition in `e` is ignored and is replaced by position. - # This is necessary because QQuickWindow thinks of itself as - # a top-level window always. - mappedEvent = QMouseEvent(e.type(), e.position(), e.globalPosition(), - e.button(), e.buttons(), e.modifiers()) - QCoreApplication.sendEvent(self.m_quickWindow, mappedEvent) - - def mouseReleaseEvent(self, e): - mappedEvent = QMouseEvent(e.type(), e.position(), e.globalPosition(), - e.button(), e.buttons(), e.modifiers()) - QCoreApplication.sendEvent(self.m_quickWindow, mappedEvent) diff --git a/examples/declarative/shared/Button.qml b/examples/declarative/shared/Button.qml deleted file mode 100644 index bee0ae28e..000000000 --- a/examples/declarative/shared/Button.qml +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick 2.12 -import QtQuick.Window 2.1 - -Item { - id: container - - property alias text: buttonLabel.text - property alias label: buttonLabel - signal clicked - property alias containsMouse: hoverHandler.hovered - property alias pressed: tapHandler.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: tapHandler.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 - } - - TapHandler { - id: tapHandler - onTapped: container.clicked(); - } - HoverHandler { - id: hoverHandler - } - - Text { - id: buttonLabel - text: container.text - color: palette.buttonText - anchors.centerIn: parent - } -} diff --git a/examples/declarative/shared/CheckBox.qml b/examples/declarative/shared/CheckBox.qml deleted file mode 100644 index ed93d708d..000000000 --- a/examples/declarative/shared/CheckBox.qml +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick 2.12 - -Item { - id: root - implicitHeight: frame.height - implicitWidth: row.implicitWidth - width: implicitWidth - height: implicitHeight - property alias text: label.text - property bool checked - property alias pressed: tapHandler.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: tapHandler.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: root.checked - } - } - Text { - id: label - color: palette.text - anchors.verticalCenter: frame.verticalCenter - } - } - TapHandler { - id: tapHandler - onTapped: { - parent.checked = !parent.checked - parent.clicked() - } - } -} diff --git a/examples/declarative/shared/FlickrRssModel.qml b/examples/declarative/shared/FlickrRssModel.qml deleted file mode 100644 index 66f53b8ef..000000000 --- a/examples/declarative/shared/FlickrRssModel.qml +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick 2.12 - -ListModel { - id: flickrImages - property string tags : "" - readonly property string queryUrl : "http://api.flickr.com/services/feeds/photos_public.gne?" - - function encodeParams(x) { - return encodeURIComponent(x.replace(" ",",")); - } - function fetchImages(format) { - var requestURL = queryUrl + (tags ? "tags="+encodeParams(tags)+"&" : "") + "format=" + format + "&nojsoncallback=1"; - var xhr = new XMLHttpRequest; - xhr.onreadystatechange = function() { - if (xhr.readyState === XMLHttpRequest.DONE) { - - if (xhr.status !== 200) { - console.log("Failed to get images from flickr. status code: " + xhr.status); - return; - } - - var jsonText = xhr.responseText; - var objArray = JSON.parse(jsonText.replace(/\'/g,"'")) - if (objArray.errors !== undefined) - console.log("Error fetching tweets: " + objArray.errors[0].message) - else { - for (var key in objArray.items) { - var rssItem = objArray.items[key]; - var jsonObject = "{ \"title\": \"" + rssItem.title +"\",\"media\": \"" + rssItem.media.m + "\", \"thumbnail\": \"" + rssItem.media.m.replace(/\_m\.jpg/,"_s.jpg") +"\"}" - flickrImages.append(JSON.parse(jsonObject)); - } - } - } - } - xhr.open("GET", requestURL, true); - xhr.send(); - } - Component.onCompleted: { - fetchImages("json"); - } -} - diff --git a/examples/declarative/shared/Images.qml b/examples/declarative/shared/Images.qml deleted file mode 100644 index ade3619d8..000000000 --- a/examples/declarative/shared/Images.qml +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -pragma Singleton -import QtQml - -QtObject { - readonly property url back: Qt.resolvedUrl("images/back.png") - readonly property url checkmark: Qt.resolvedUrl("images/checkmark.png") - readonly property url next: Qt.resolvedUrl("images/next.png") - readonly property url qtLogo: Qt.resolvedUrl("images/qt-logo.png") - readonly property url sliderHandle: Qt.resolvedUrl("images/slider_handle.png") - readonly property url tab: Qt.resolvedUrl("images/tab.png") -} diff --git a/examples/declarative/shared/Label.qml b/examples/declarative/shared/Label.qml deleted file mode 100644 index 77ec53f5c..000000000 --- a/examples/declarative/shared/Label.qml +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick 2.0 - -Text { - SystemPalette { id: palette } - color: palette.text -} diff --git a/examples/declarative/shared/LauncherList.qml b/examples/declarative/shared/LauncherList.qml deleted file mode 100644 index 323ed529f..000000000 --- a/examples/declarative/shared/LauncherList.qml +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (C) 2017 Crimson AS -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQml 2.12 -import QtQml.Models 2.12 -import QtQuick 2.12 - -Rectangle { - id: root - 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{ - required property url url - onClicked: root.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" - TapHandler { - //Eats mouse events - } - Loader{ - focus: true - source: parent.exampleUrl - anchors.fill: parent - } - - function show() { - showAnim.start() - } - - function exit() { - exitAnim.start() - } - - ParallelAnimation { - id: showAnim - ScriptAction { - script: root.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: root.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: root.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 - - TapHandler { - id: tapHandler - enabled: root.activePageCount > 0 - onTapped: { - pageContainer.children[pageContainer.children.length - 1].exit() - } - } - Rectangle { - anchors.centerIn: back - width: 38 - height: 31 - anchors.verticalCenterOffset: -1 - opacity: tapHandler.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/declarative/shared/README b/examples/declarative/shared/README deleted file mode 100644 index 2bf26d7c8..000000000 --- a/examples/declarative/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/declarative/shared/SimpleLauncherDelegate.qml b/examples/declarative/shared/SimpleLauncherDelegate.qml deleted file mode 100644 index 68860edbc..000000000 --- a/examples/declarative/shared/SimpleLauncherDelegate.qml +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -import QtQuick 2.12 - -Rectangle { - id: container - required property string name - required property string description - - 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: tapHandler.pressed ? "#e0e0e0" : "#fff" - } - GradientStop { - position: 1 - Behavior on color {ColorAnimation { duration: 100 }} - color: tapHandler.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 - property alias containsMouse: hoverHandler.hovered - - TapHandler { - id: tapHandler - onTapped: container.clicked() - } - HoverHandler { - id: hoverHandler - } - - 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: container.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: container.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/declarative/shared/Slider.qml b/examples/declarative/shared/Slider.qml deleted file mode 100644 index 7b331ab1c..000000000 --- a/examples/declarative/shared/Slider.qml +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick 2.12 - -Item { - id: slider - height: 26 - // default drag range is 180: divisible by 2, 3, 4, 5, 6, 9, 10, ... - width: sliderName.width + 223 + handle.width / 2 - - property real min: 0 - property real max: 1 - property real value: min + (max - min) * dragHandler.value - property real init: min+(max-min)/2 - property string name: "Slider" - property color color: "#0066cc" - property real minLabelWidth: 44 - - DragHandler { - id: dragHandler - target: handle - xAxis.minimum: Math.round(-handle.width / 2 + 3) - xAxis.maximum: Math.round(groove.width - handle.width / 2 - 3) - property real value: (handle.x - xAxis.minimum) / (xAxis.maximum - xAxis.minimum) - } - - Component.onCompleted: setValue(init) - function setValue(v) { - if (min < max) { - handle.x = Math.round( v / (max - min) * - (dragHandler.xAxis.maximum - dragHandler.xAxis.minimum) - + dragHandler.xAxis.minimum); -// console.log(name, v, "-> handle.x", handle.x, "from fraction", (v / (max - min)), -// "of drag range", (dragHandler.xAxis.maximum - dragHandler.xAxis.minimum), "px", min, ":", max) - } - } - Rectangle { - id:sliderName - anchors.left: parent.left - anchors.leftMargin: 16 - height: childrenRect.height - width: Math.max(slider.minLabelWidth, childrenRect.width) - anchors.verticalCenter: parent.verticalCenter - Text { - text: slider.name + ":" - font.pointSize: 12 - color: "#333" - } - } - - Rectangle { - id: groove - 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 - } - } -} diff --git a/examples/declarative/shared/TabSet.qml b/examples/declarative/shared/TabSet.qml deleted file mode 100644 index 633521af8..000000000 --- a/examples/declarative/shared/TabSet.qml +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick 2.12 -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 { - required property int index - 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 == parent.index - } - Text { - id: label - horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter - anchors.fill: parent - text: stack.children[parent.index].title - elide: Text.ElideRight - font.bold: tabWidget.current == parent.index - } - TapHandler { - onTapped: tabWidget.current = parent.index - } - } - } - } - - Item { - id: stack - width: tabWidget.width - anchors.top: header.bottom; anchors.bottom: tabWidget.bottom - } -} diff --git a/examples/declarative/shared/TextField.qml b/examples/declarative/shared/TextField.qml deleted file mode 100644 index 01addb2e9..000000000 --- a/examples/declarative/shared/TextField.qml +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -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/declarative/shared/images/back.png b/examples/declarative/shared/images/back.png deleted file mode 100644 index 53402096b..000000000 Binary files a/examples/declarative/shared/images/back.png and /dev/null differ diff --git a/examples/declarative/shared/images/checkmark.png b/examples/declarative/shared/images/checkmark.png deleted file mode 100644 index 821aafccd..000000000 Binary files a/examples/declarative/shared/images/checkmark.png and /dev/null differ diff --git a/examples/declarative/shared/images/next.png b/examples/declarative/shared/images/next.png deleted file mode 100644 index cdef8db6e..000000000 Binary files a/examples/declarative/shared/images/next.png and /dev/null differ diff --git a/examples/declarative/shared/images/qt-logo.png b/examples/declarative/shared/images/qt-logo.png deleted file mode 100644 index 30c621c9c..000000000 Binary files a/examples/declarative/shared/images/qt-logo.png and /dev/null differ diff --git a/examples/declarative/shared/images/slider_handle.png b/examples/declarative/shared/images/slider_handle.png deleted file mode 100644 index 63c518be7..000000000 Binary files a/examples/declarative/shared/images/slider_handle.png and /dev/null differ diff --git a/examples/declarative/shared/images/tab.png b/examples/declarative/shared/images/tab.png deleted file mode 100644 index 2ea989b68..000000000 Binary files a/examples/declarative/shared/images/tab.png and /dev/null differ diff --git a/examples/declarative/shared/qmldir b/examples/declarative/shared/qmldir deleted file mode 100644 index 5ccdf6021..000000000 --- a/examples/declarative/shared/qmldir +++ /dev/null @@ -1,11 +0,0 @@ -module shared -Button 2.0 Button.qml -CheckBox 2.1 CheckBox.qml -FlickrRssModel 2.0 FlickrRssModel.qml -Label 2.0 Label.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 -singleton Images 2.2 Images.qml diff --git a/examples/declarative/shared/quick_shared.qrc b/examples/declarative/shared/quick_shared.qrc deleted file mode 100644 index 21f393a64..000000000 --- a/examples/declarative/shared/quick_shared.qrc +++ /dev/null @@ -1,15 +0,0 @@ - - - LauncherList.qml - SimpleLauncherDelegate.qml - Button.qml - CheckBox.qml - Label.qml - TextField.qml - images/back.png - images/next.png - images/checkmark.png - Slider.qml - images/slider_handle.png - - diff --git a/examples/declarative/shared/shared.qrc b/examples/declarative/shared/shared.qrc deleted file mode 100644 index c19063a58..000000000 --- a/examples/declarative/shared/shared.qrc +++ /dev/null @@ -1,21 +0,0 @@ - - - Button.qml - CheckBox.qml - FlickrRssModel.qml - Images.qml - Label.qml - LauncherList.qml - SimpleLauncherDelegate.qml - Slider.qml - TabSet.qml - TextField.qml - images/back.png - images/checkmark.png - images/next.png - images/qt-logo.png - images/slider_handle.png - images/tab.png - qmldir - - diff --git a/examples/declarative/shared/shared_rc.py b/examples/declarative/shared/shared_rc.py deleted file mode 100644 index 97e5ecb87..000000000 --- a/examples/declarative/shared/shared_rc.py +++ /dev/null @@ -1,1884 +0,0 @@ -# Resource object code (Python 3) -# Created by: object code -# Created by: The Resource Compiler for Qt version 6.5.0 -# WARNING! All changes made in this file will be lost! - -from PySide6 import QtCore - -qt_resource_data = b"\ -\x00\x00\x06\x9b\ -/\ -/ Copyright (C) \ -2017 The Qt Comp\ -any Ltd.\x0a// SPDX\ --License-Identif\ -ier: LicenseRef-\ -Qt-Commercial OR\ - BSD-3-Clause\x0a\x0ai\ -mport QtQuick 2.\ -12\x0a\x0aItem {\x0a i\ -d: root\x0a impl\ -icitHeight: fram\ -e.height\x0a imp\ -licitWidth: row.\ -implicitWidth\x0a \ - width: implici\ -tWidth\x0a heigh\ -t: implicitHeigh\ -t\x0a property a\ -lias text: label\ -.text\x0a proper\ -ty bool checked\x0a\ - property ali\ -as pressed: tapH\ -andler.pressed\x0a \ - property alia\ -s row: row\x0a s\ -ignal clicked\x0a\x0a \ - SystemPalette\ - { id: palette }\ -\x0a\x0a Row {\x0a \ - id: row\x0a \ - anchors.vert\ -icalCenter: pare\ -nt.verticalCente\ -r\x0a spacin\ -g: 6\x0a Rec\ -tangle {\x0a \ - id: frame\x0a \ - gradi\ -ent: Gradient {\x0a\ - \ -GradientStop { p\ -osition: 0.0; co\ -lor: tapHandler.\ -pressed ? Qt.dar\ -ker(palette.butt\ -on, 1.3) : palet\ -te.button }\x0a \ - Grad\ -ientStop { posit\ -ion: 1.0; color:\ - Qt.darker(palet\ -te.button, 1.3) \ -}\x0a }\x0a\ - heig\ -ht: label.implic\ -itHeight * 1.5\x0a \ - width\ -: height\x0a \ - anchors.mar\ -gins: 1\x0a \ - radius: 3\x0a \ - antial\ -iasing: true\x0a \ - border.\ -color: Qt.darker\ -(palette.button,\ - 1.5)\x0a \ - Image {\x0a \ - id: th\ -eX\x0a \ - source: \x22imag\ -es/checkmark.png\ -\x22\x0a \ - anchors.fill: \ -frame\x0a \ - anchors.ma\ -rgins: frame.wid\ -th / 5\x0a \ - fillMode:\ - Image.PreserveA\ -spectFit\x0a \ - smooth:\ - true\x0a \ - visible: r\ -oot.checked\x0a \ - }\x0a \ - }\x0a Text\ - {\x0a i\ -d: label\x0a \ - color: pale\ -tte.text\x0a \ - anchors.ver\ -ticalCenter: fra\ -me.verticalCente\ -r\x0a }\x0a \ -}\x0a TapHandler\ - {\x0a id: t\ -apHandler\x0a \ - onTapped: {\x0a \ - parent\ -.checked = !pare\ -nt.checked\x0a \ - parent.cl\ -icked()\x0a \ -}\x0a }\x0a}\x0a\ -\x00\x00\x04\x1c\ -/\ -/ Copyright (C) \ -2017 The Qt Comp\ -any Ltd.\x0a// SPDX\ --License-Identif\ -ier: LicenseRef-\ -Qt-Commercial OR\ - BSD-3-Clause\x0a\x0ai\ -mport QtQuick 2.\ -1\x0a\x0aItem {\x0a id\ -: root\x0a\x0a prop\ -erty alias textI\ -nput: textInput\x0a\ - property ali\ -as text: textInp\ -ut.text\x0a sign\ -al accepted\x0a \ -signal downPress\ -ed\x0a implicitW\ -idth: textInput.\ -implicitWidth + \ -rect.radius * 2\x0a\ - implicitHeig\ -ht: textInput.im\ -plicitHeight\x0a\x0a \ - function copyA\ -ll() {\x0a t\ -extInput.selectA\ -ll()\x0a tex\ -tInput.copy()\x0a \ - }\x0a\x0a SystemP\ -alette { id: pal\ -ette }\x0a heigh\ -t: textInput.imp\ -licitHeight + 8\x0a\ - clip: true\x0a\x0a\ - Rectangle {\x0a\ - id: rect\ -\x0a anchors\ -.fill: parent\x0a \ - radius: he\ -ight / 4\x0a \ - color: palette.\ -button\x0a b\ -order.color: Qt.\ -darker(palette.b\ -utton, 1.5)\x0a \ -}\x0a\x0a TextInput\ - {\x0a id: t\ -extInput\x0a \ - color: palette.\ -text\x0a anc\ -hors.fill: paren\ -t\x0a anchor\ -s.leftMargin: re\ -ct.radius\x0a \ - anchors.rightM\ -argin: rect.radi\ -us\x0a verti\ -calAlignment: Te\ -xt.AlignVCenter\x0a\ - onAccept\ -ed: root.accepte\ -d()\x0a Keys\ -.onDownPressed: \ -root.downPressed\ -()\x0a }\x0a}\x0a\ -\x00\x00\x00\xc7\ -/\ -/ Copyright (C) \ -2017 The Qt Comp\ -any Ltd.\x0a// SPDX\ --License-Identif\ -ier: LicenseRef-\ -Qt-Commercial OR\ - BSD-3-Clause\x0a\x0ai\ -mport QtQuick 2.\ -0\x0a\x0aText {\x0a Sy\ -stemPalette { id\ -: palette }\x0a \ -color: palette.t\ -ext\x0a}\x0a\ -\x00\x00\x0ax\ -/\ -/ Copyright (C) \ -2017 The Qt Comp\ -any Ltd.\x0a// SPDX\ --License-Identif\ -ier: LicenseRef-\ -Qt-Commercial OR\ - BSD-3-Clause\x0aim\ -port QtQuick 2.1\ -2\x0a\x0aRectangle {\x0a \ - id: container\ -\x0a required pr\ -operty string na\ -me\x0a required \ -property string \ -description\x0a\x0a \ - property Item e\ -xampleItem\x0a w\ -idth: ListView.v\ -iew.width\x0a he\ -ight: button.imp\ -licitHeight + 22\ -\x0a\x0a signal cli\ -cked()\x0a\x0a grad\ -ient: Gradient {\ -\x0a Gradien\ -tStop {\x0a \ - position: 0\x0a\ - Beha\ -vior on color {C\ -olorAnimation { \ -duration: 100 }}\ -\x0a col\ -or: tapHandler.p\ -ressed ? \x22#e0e0e\ -0\x22 : \x22#fff\x22\x0a \ - }\x0a Gr\ -adientStop {\x0a \ - positio\ -n: 1\x0a \ - Behavior on col\ -or {ColorAnimati\ -on { duration: 1\ -00 }}\x0a \ - color: tapHand\ -ler.pressed ? \x22#\ -e0e0e0\x22 : button\ -.containsMouse ?\ - \x22#f5f5f5\x22 : \x22#e\ -ee\x22\x0a }\x0a \ - }\x0a\x0a Image {\ -\x0a id: ima\ -ge\x0a opaci\ -ty: 0.7\x0a \ -Behavior on opac\ -ity {NumberAnima\ -tion {duration: \ -100}}\x0a so\ -urce: \x22images/ne\ -xt.png\x22\x0a \ -anchors.vertical\ -Center: parent.v\ -erticalCenter\x0a \ - anchors.ri\ -ght: parent.righ\ -t\x0a anchor\ -s.rightMargin: 1\ -6\x0a }\x0a\x0a Ite\ -m {\x0a id: \ -button\x0a a\ -nchors.top: pare\ -nt.top\x0a a\ -nchors.left: par\ -ent.left\x0a \ - anchors.bottom:\ - parent.bottom\x0a \ - anchors.r\ -ight:image.left\x0a\ - implicit\ -Height: col.heig\ -ht\x0a heigh\ -t: implicitHeigh\ -t\x0a width:\ - buttonLabel.wid\ -th + 20\x0a \ -property alias c\ -ontainsMouse: ho\ -verHandler.hover\ -ed\x0a\x0a TapH\ -andler {\x0a \ - id: tapHand\ -ler\x0a \ -onTapped: contai\ -ner.clicked()\x0a \ - }\x0a \ -HoverHandler {\x0a \ - id: h\ -overHandler\x0a \ - }\x0a\x0a C\ -olumn {\x0a \ - spacing: 2\x0a \ - id: c\ -ol\x0a a\ -nchors.verticalC\ -enter: parent.ve\ -rticalCenter\x0a \ - width: \ -parent.width\x0a \ - Text {\x0a\ - \ -id: buttonLabel\x0a\ - \ -anchors.left: pa\ -rent.left\x0a \ - anchor\ -s.leftMargin: 10\ -\x0a \ - anchors.right: \ -parent.right\x0a \ - anc\ -hors.rightMargin\ -: 10\x0a \ - text: conta\ -iner.name\x0a \ - color:\ - \x22black\x22\x0a \ - font.pi\ -xelSize: 22\x0a \ - wrap\ -Mode: Text.WrapA\ -tWordBoundaryOrA\ -nywhere\x0a \ - styleCol\ -or: \x22white\x22\x0a \ - styl\ -e: Text.Raised\x0a\x0a\ - }\x0a \ - Text {\ -\x0a \ - id: buttonLabel\ -2\x0a \ - anchors.left: \ -parent.left\x0a \ - anch\ -ors.leftMargin: \ -10\x0a \ - text: contain\ -er.description\x0a \ - w\ -rapMode: Text.Wr\ -apAtWordBoundary\ -OrAnywhere\x0a \ - color\ -: \x22#666\x22\x0a \ - font.pi\ -xelSize: 12\x0a \ - }\x0a \ - }\x0a }\x0a\x0a R\ -ectangle {\x0a \ - height: 1\x0a \ - color: \x22#cc\ -c\x22\x0a ancho\ -rs.bottom: paren\ -t.bottom\x0a \ - anchors.left: p\ -arent.left\x0a \ - anchors.right\ -: parent.right\x0a \ - }\x0a}\x0a\ -\x00\x00\x05\xac\ -\x00\ -\x00\x16\xecx\x9c\xd5\x18ko\xdb6\xf0\xbb\x7f\x05\xa1\ -~q\xd0X\xb2\x9d\xee\x01om\x97\xbaE\x17 ]\ -\x93\xba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/ Copyright (C) \ -2016 The Qt Comp\ -any Ltd.\x0a// SPDX\ --License-Identif\ -ier: LicenseRef-\ -Qt-Commercial OR\ - BSD-3-Clause\x0a\x0ai\ -mport QtQuick 2.\ -12\x0a\x0aItem {\x0a i\ -d: slider\x0a he\ -ight: 26\x0a // \ -default drag ran\ -ge is 180: divis\ -ible by 2, 3, 4,\ - 5, 6, 9, 10, ..\ -.\x0a width: sli\ -derName.width + \ -223 + handle.wid\ -th / 2\x0a\x0a prop\ -erty real min: 0\ -\x0a property re\ -al max: 1\x0a pr\ -operty real valu\ -e: min + (max - \ -min) * dragHandl\ -er.value\x0a pro\ -perty real init:\ - min+(max-min)/2\ -\x0a property st\ -ring name: \x22Slid\ -er\x22\x0a property\ - color color: \x22#\ -0066cc\x22\x0a prop\ -erty real minLab\ -elWidth: 44\x0a\x0a \ - DragHandler {\x0a \ - id: dragH\ -andler\x0a t\ -arget: handle\x0a \ - xAxis.mini\ -mum: Math.round(\ --handle.width / \ -2 + 3)\x0a x\ -Axis.maximum: Ma\ -th.round(groove.\ -width - handle.w\ -idth / 2 - 3)\x0a \ - property r\ -eal value: (hand\ -le.x - xAxis.min\ -imum) / (xAxis.m\ -aximum - xAxis.m\ -inimum)\x0a }\x0a\x0a \ - Component.onC\ -ompleted: setVal\ -ue(init)\x0a fun\ -ction setValue(v\ -) {\x0a if (\ -min < max) {\x0a \ - handle.\ -x = Math.round( \ -v / (max - min) \ -*\x0a \ - \ - (dragHandler.x\ -Axis.maximum - d\ -ragHandler.xAxis\ -.minimum)\x0a \ - \ - + drag\ -Handler.xAxis.mi\ -nimum);\x0a// \ - console.lo\ -g(name, v, \x22-> h\ -andle.x\x22, handle\ -.x, \x22from fracti\ -on\x22, (v / (max -\ - min)),\x0a// \ - \x22of dr\ -ag range\x22, (drag\ -Handler.xAxis.ma\ -ximum - dragHand\ -ler.xAxis.minimu\ -m), \x22px\x22, min, \x22\ -:\x22, max)\x0a \ - }\x0a }\x0a Rec\ -tangle {\x0a \ - id:sliderName\x0a \ - anchors.l\ -eft: parent.left\ -\x0a anchors\ -.leftMargin: 16\x0a\ - height: \ -childrenRect.hei\ -ght\x0a widt\ -h: Math.max(slid\ -er.minLabelWidth\ -, childrenRect.w\ -idth)\x0a an\ -chors.verticalCe\ -nter: parent.ver\ -ticalCenter\x0a \ - Text {\x0a \ - text: sli\ -der.name + \x22:\x22\x0a \ - font.\ -pointSize: 12\x0a \ - color:\ - \x22#333\x22\x0a \ -}\x0a }\x0a\x0a Rec\ -tangle {\x0a \ - id: groove\x0a \ - width: paren\ -t.width - 8 - sl\ -iderName.width\x0a \ - color: \x22#\ -eee\x22\x0a hei\ -ght: 7\x0a r\ -adius: 3\x0a \ - antialiasing: t\ -rue\x0a bord\ -er.color: Qt.dar\ -ker(color, 1.2)\x0a\ - anchors.\ -left: sliderName\ -.right\x0a a\ -nchors.right: pa\ -rent.right\x0a \ - anchors.leftM\ -argin: 10\x0a \ - anchors.rightM\ -argin: 24\x0a \ - anchors.vertic\ -alCenter: parent\ -.verticalCenter\x0a\ -\x0a Rectang\ -le {\x0a \ - height: parent.\ -height\x0a \ - anchors.left:\ - parent.left\x0a \ - anchors\ -.right: handle.h\ -orizontalCenter\x0a\ - colo\ -r: slider.color\x0a\ - radi\ -us: 3\x0a \ - border.width: \ -1\x0a bo\ -rder.color: Qt.d\ -arker(color, 1.3\ -)\x0a op\ -acity: 0.8\x0a \ - }\x0a Ima\ -ge {\x0a \ - id: handle\x0a \ - source: \ -\x22images/slider_h\ -andle.png\x22\x0a \ - anchors.v\ -erticalCenter: p\ -arent.verticalCe\ -nter\x0a }\x0a \ - }\x0a}\x0a\ -\x00\x00\x06\xc5\ -/\ -/ Copyright (C) \ -2017 The Qt Comp\ -any Ltd.\x0a// SPDX\ --License-Identif\ -ier: LicenseRef-\ -Qt-Commercial OR\ - BSD-3-Clause\x0a\x0ai\ -mport QtQuick 2.\ -12\x0a\x0aListModel {\x0a\ - id: flickrIm\ -ages\x0a propert\ -y string tags : \ -\x22\x22\x0a readonly \ -property string \ -queryUrl : \x22http\ -://api.flickr.co\ -m/services/feeds\ -/photos_public.g\ -ne?\x22\x0a\x0a functi\ -on encodeParams(\ -x) {\x0a ret\ -urn encodeURICom\ -ponent(x.replace\ -(\x22 \x22,\x22,\x22));\x0a \ -}\x0a function f\ -etchImages(forma\ -t) {\x0a var\ - requestURL = qu\ -eryUrl + (tags ?\ - \x22tags=\x22+encodeP\ -arams(tags)+\x22&\x22 \ -: \x22\x22) + \x22format=\ -\x22 + format + \x22&n\ -ojsoncallback=1\x22\ -;\x0a var xh\ -r = new XMLHttpR\ -equest;\x0a \ -xhr.onreadystate\ -change = functio\ -n() {\x0a \ - if (xhr.readyS\ -tate === XMLHttp\ -Request.DONE) {\x0a\ -\x0a \ - if (xhr.status \ -!== 200) {\x0a \ - c\ -onsole.log(\x22Fail\ -ed to get images\ - from flickr. st\ -atus code: \x22 + x\ -hr.status);\x0a \ - \ -return;\x0a \ - }\x0a\x0a \ - var j\ -sonText = xhr.re\ -sponseText;\x0a \ - var \ -objArray = JSON.\ -parse(jsonText.r\ -eplace(/\x5c'/g,\x22'\x22\ -))\x0a \ - if (objArray.\ -errors !== undef\ -ined)\x0a \ - consol\ -e.log(\x22Error fet\ -ching tweets: \x22 \ -+ objArray.error\ -s[0].message)\x0a \ - el\ -se {\x0a \ - for (va\ -r key in objArra\ -y.items) {\x0a \ - \ - var rssItem =\ - objArray.items[\ -key];\x0a \ - va\ -r jsonObject = \x22\ -{ \x5c\x22title\x5c\x22: \x5c\x22\x22\ - + rssItem.title\ - +\x22\x5c\x22,\x5c\x22media\x5c\x22:\ - \x5c\x22\x22 + rssItem.m\ -edia.m + \x22\x5c\x22, \x5c\x22\ -thumbnail\x5c\x22: \x5c\x22\x22\ - + rssItem.media\ -.m.replace(/\x5c_m\x5c\ -.jpg/,\x22_s.jpg\x22) \ -+\x22\x5c\x22}\x22\x0a \ - f\ -lickrImages.appe\ -nd(JSON.parse(js\ -onObject));\x0a \ - \ -}\x0a \ - }\x0a \ -}\x0a }\x0a \ - xhr.open(\x22GE\ -T\x22, requestURL, \ -true);\x0a x\ -hr.send();\x0a }\ -\x0a Component.o\ -nCompleted: {\x0a \ - fetchImage\ -s(\x22json\x22);\x0a }\ -\x0a}\x0a\x0a\ -\x00\x00\x018\ -m\ -odule shared\x0aBut\ -ton 2.0 Button.q\ -ml\x0aCheckBox 2.1 \ -CheckBox.qml\x0aFli\ -ckrRssModel 2.0 \ -FlickrRssModel.q\ -ml\x0aLabel 2.0 Lab\ -el.qml\x0aLauncherL\ -ist 2.0 Launcher\ -List.qml\x0aSimpleL\ -auncherDelegate \ -2.0 SimpleLaunch\ -erDelegate.qml\x0aS\ -lider 2.0 Slider\ -.qml\x0aTabSet 2.1 \ -TabSet.qml\x0aTextF\ -ield 2.1 TextFie\ -ld.qml\x0asingleton\ - Images 2.2 Imag\ -es.qml\x0a\ -\x00\x00\x08\xdc\ -/\ -/ Copyright (C) \ -2017 The Qt Comp\ -any Ltd.\x0a// SPDX\ --License-Identif\ -ier: LicenseRef-\ -Qt-Commercial OR\ - BSD-3-Clause\x0a\x0ai\ -mport QtQuick 2.\ -12\x0aimport QtQuic\ -k.Window 2.1\x0a\x0aIt\ -em {\x0a id: tab\ -Widget\x0a\x0a // S\ -etting the defau\ -lt property to s\ -tack.children me\ -ans any child it\ -ems\x0a // of th\ -e TabWidget are \ -actually added t\ -o the 'stack' it\ -em's children.\x0a \ - // See the \x22P\ -roperty Binding\x22\ -\x0a // document\ -ation for detail\ -s on default pro\ -perties.\x0a def\ -ault property al\ -ias content: sta\ -ck.children\x0a\x0a \ - property int cu\ -rrent: 0\x0a\x0a on\ -CurrentChanged: \ -setZOrders()\x0a \ - Component.onCom\ -pleted: setZOrde\ -rs()\x0a\x0a functi\ -on setZOrders() \ -{\x0a for (v\ -ar i = 0; i < st\ -ack.children.len\ -gth; ++i) {\x0a \ - stack.ch\ -ildren[i].z = (i\ - == current ? 1 \ -: 0)\x0a \ - stack.children[\ -i].enabled = (i \ -== current)\x0a \ - }\x0a }\x0a\x0a \ - Row {\x0a i\ -d: header\x0a\x0a \ - Repeater {\x0a \ - model:\ - stack.children.\ -length\x0a \ - delegate: Rec\ -tangle {\x0a \ - require\ -d property int i\ -ndex\x0a \ - width: tabW\ -idget.width / st\ -ack.children.len\ -gth\x0a \ - height: Math\ -.max(Screen.pixe\ -lDensity * 7, la\ -bel.implicitHeig\ -ht * 1.2)\x0a\x0a \ - Recta\ -ngle {\x0a \ - width\ -: parent.width; \ -height: 1\x0a \ - an\ -chors { bottom: \ -parent.bottom; b\ -ottomMargin: 1 }\ -\x0a \ - color: \x22#ac\ -b2c2\x22\x0a \ - }\x0a \ - BorderIm\ -age {\x0a \ - anchor\ -s { fill: parent\ -; leftMargin: 2;\ - topMargin: 5; r\ -ightMargin: 1 }\x0a\ - \ - border { lef\ -t: 7; right: 7 }\ -\x0a \ - source: \x22im\ -ages/tab.png\x22\x0a \ - \ - visible: tabWi\ -dget.current == \ -parent.index\x0a \ - }\x0a \ - T\ -ext {\x0a \ - id: la\ -bel\x0a \ - horizont\ -alAlignment: Qt.\ -AlignHCenter; ve\ -rticalAlignment:\ - Qt.AlignVCenter\ -\x0a \ - anchors.fil\ -l: parent\x0a \ - te\ -xt: stack.childr\ -en[parent.index]\ -.title\x0a \ - elide\ -: Text.ElideRigh\ -t\x0a \ - font.bold:\ - tabWidget.curre\ -nt == parent.ind\ -ex\x0a \ - }\x0a \ - TapHandler \ -{\x0a \ - onTapped: \ -tabWidget.curren\ -t = parent.index\ -\x0a \ - }\x0a }\ -\x0a }\x0a }\ -\x0a\x0a Item {\x0a \ - id: stack\x0a \ - width: ta\ -bWidget.width\x0a \ - anchors.to\ -p: header.bottom\ -; anchors.bottom\ -: tabWidget.bott\ -om\x0a }\x0a}\x0a\ -\x00\x00\x02h\ -/\ -/ Copyright (C) \ -2021 The Qt Comp\ -any Ltd.\x0a// SPDX\ --License-Identif\ -ier: LicenseRef-\ -Qt-Commercial OR\ - BSD-3-Clause\x0a\x0ap\ -ragma Singleton\x0a\ -import QtQml\x0a\x0aQt\ -Object {\x0a rea\ -donly property u\ -rl back: \ - Qt.resolvedUrl(\ -\x22images/back.png\ -\x22)\x0a readonly \ -property url che\ -ckmark: Qt.re\ -solvedUrl(\x22image\ -s/checkmark.png\x22\ -)\x0a readonly p\ -roperty url next\ -: Qt.res\ -olvedUrl(\x22images\ -/next.png\x22)\x0a \ -readonly propert\ -y url qtLogo: \ - Qt.resolvedU\ -rl(\x22images/qt-lo\ -go.png\x22)\x0a rea\ -donly property u\ -rl sliderHandle:\ - Qt.resolvedUrl(\ -\x22images/slider_h\ -andle.png\x22)\x0a \ -readonly propert\ -y url tab: \ - Qt.resolvedU\ -rl(\x22images/tab.p\ -ng\x22)\x0a}\x0a\ -\x00\x00\x05t\ -/\ -/ Copyright (C) \ -2017 The Qt Comp\ -any Ltd.\x0a// SPDX\ --License-Identif\ -ier: LicenseRef-\ -Qt-Commercial OR\ - BSD-3-Clause\x0a\x0ai\ -mport QtQuick 2.\ -12\x0aimport QtQuic\ -k.Window 2.1\x0a\x0aIt\ -em {\x0a id: con\ -tainer\x0a\x0a prop\ -erty alias text:\ - buttonLabel.tex\ -t\x0a property a\ -lias label: butt\ -onLabel\x0a sign\ -al clicked\x0a p\ -roperty alias co\ -ntainsMouse: hov\ -erHandler.hovere\ -d\x0a property a\ -lias pressed: ta\ -pHandler.pressed\ -\x0a implicitHei\ -ght: Math.max(Sc\ -reen.pixelDensit\ -y * 7, buttonLab\ -el.implicitHeigh\ -t * 1.2)\x0a imp\ -licitWidth: Math\ -.max(Screen.pixe\ -lDensity * 11, b\ -uttonLabel.impli\ -citWidth * 1.3)\x0a\ - height: impl\ -icitHeight\x0a w\ -idth: implicitWi\ -dth\x0a\x0a SystemP\ -alette { id: pal\ -ette }\x0a\x0a Rect\ -angle {\x0a \ -id: frame\x0a \ - anchors.fill: \ -parent\x0a c\ -olor: palette.bu\ -tton\x0a gra\ -dient: Gradient \ -{\x0a Gr\ -adientStop { pos\ -ition: 0.0; colo\ -r: tapHandler.pr\ -essed ? Qt.darke\ -r(palette.button\ -, 1.3) : palette\ -.button }\x0a \ - GradientSt\ -op { position: 1\ -.0; color: Qt.da\ -rker(palette.but\ -ton, 1.3) }\x0a \ - }\x0a an\ -tialiasing: true\ -\x0a radius:\ - height / 6\x0a \ - border.color\ -: Qt.darker(pale\ -tte.button, 1.5)\ -\x0a border.\ -width: 1\x0a }\x0a\x0a\ - TapHandler {\ -\x0a id: tap\ -Handler\x0a \ -onTapped: contai\ -ner.clicked();\x0a \ - }\x0a HoverHa\ -ndler {\x0a \ -id: hoverHandler\ -\x0a }\x0a\x0a Text\ - {\x0a id: b\ -uttonLabel\x0a \ - text: contain\ -er.text\x0a \ -color: palette.b\ -uttonText\x0a \ - anchors.center\ -In: parent\x0a }\ -\x0a}\x0a\ -\x00\x00\x03)\ -\x89\ -PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ -\x00\x00@\x00\x00\x00@\x08\x06\x00\x00\x00\xaaiq\xde\ -\x00\x00\x02\xf0IDATx\xda\xe5\x9b_h\xcda\ -\x18\xc7?\x9bm1\xab\x91\xc2\xd0Y+5\xbb`h\ -\xc9\x85\x0b7HJ\x93H))\xe5\xc2\xcd\xb0\x91R\ -\xdc(7\xbbP\xae\x88\x5cXI[v%\xc9\x9fb\ -.\xfc\xbd\xc0(\xffN\xc8\xc6\xd9p16\x8c9.\ -~?u\xac\xe3\x9c\xf3}\xb7\xc3\xfb{\xce\xb7\xde\xab\ -\xd3\xef=\xef\xe7y\xdf\xe7\xf7{\xde\xe7}^\xb0\xa7\ -\x12\xa0\x1aX\x03\xb4\x02W\x8080\x00\x0c\x03\x83@\ -w\xf8\xbb9m\x04n\x03\x9f\x80d\x96v\xc3\x12x\ -\x05p1\x07\xe8\xd4\xb6\xc2\x0a|5\xf0Z\x84?\x0f\ -L\xb0\x00_\x16\xfa\xb6\x02\xff\xde\xca\xccO\x04\xee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8a\xc4\xa5\xdf\xe2\xcb'\xaf\ -\xdd\xc1\x00;\xd2\xf4\xa3$7;}\x0aV\x9a\x1c\x0c\ -p\x8b?ko\xe6\x0a\xef\x91^`\xbaO\x06X\xec\ -`\x80a`~J\x1f\x0f\x84g\xb7\xfa\x16\xaeV\x85\ -A\x8ej\x84\xc7\x0e.\xe4eb\xb3$\x5c\xd2\xc9<\ -\xb77\xc0$\x9f\xc0\x7f\x87\x9e?\x80\xcb\xff\xe0\xff\x9a\ -\x81/\xbe\xee\xdaj\xf3<\xfb\xedQ\xd8\xba\xbe\xca\x13\ -\xfc\x8b\x1c\xc2g/\xb4+O\x06\x88LZ;\x86^\ -\x88\x9c\xad\x9d\x89R\xf6\xa6\x1c\xfd\x12B\xa6\xf6\xd6w\ -\xe0\xd1\x09\x88!\xa0k\x1c\xfb\xdf\x19\xc5\x1c\xde\xc2q\ -\x9a\xfd.\x22\xac'c\x84\xef'\xe2\x15\x9b\xab\xc7\x00\ -?\x02l&\xe2*\x03^:\x1a\xe0f\x94@\xffv\ -yp\x04\x98AP\xba\xa6\xaa.\xdc)F^\x95\xe8\ -%\xab\xdb1\xa6\xa5\x02\xfc)\x8c\xdc\xcc\x1a\xad\xf5a\ -\xce0\x1efr\xfa\x08\xae\x9f&\x08.'t:\xba\ -\x8a\x17\xfa\x05\xc1\xf2\xa6\x01\x10\xe5*G\x00\x00\x00\x00\ -IEND\xaeB`\x82\ -\x00\x00\x015\ -\x89\ -PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ -\x00\x00\x10\x00\x00\x00\x1f\x08\x00\x00\x00\x00\xcb\xce\x12h\ -\x00\x00\x00\xfcIDAT(\x15\x05\xc1AjTa\ -\x10\x06\xc0\xea\x9e\x7fF\x12\x17\x22(\xe8\x01t#\xf1\ -\x12\x9e\xdc\xadk\x97\x0a\x0aB\x5cj\x22$\x99y\xaf\ -?\xabj\xeb\xbbo\x7f\x1f\x8e[e\xbd}\xf5&U\ -\xf3\xfd\xc7\xcd\xcbc\x0a\xbf\x7f\x9d>V\xfd\xf9\xf2i\ -{\x08\xb8:|}\xfe\xae\x7f~\xd8\xee\x0a\xd8\xee\xdf\ -\xdfN\xff{vn@\xf4<\xae\xfb\xeb\xc7\x9e\x80\xbd\ -\xfa\xf2\xd4\xe7\x95\x00Fm\xb3ZK\x81\xe9\x9a\xee\xde\ -;\x80JJ\xc7\x000\x95\x85t\x80\x99\xb2jT\x88\ -\xa8\xb2[\x95)AIfY\x22\x22\xe8\x12\x0bB)\ -\xfb!,\x12\x80$\x96\x1a*%\xe20\x16Q#J\ -\xd2m\x91\xda+\x85\xba\xecc\xc5t\x22\xe8\xde\x97%\ -\x00b\xc6\x22\x09P\x11-\x00Bi\x00D\xd3I\x12\ -\x01I,\x92\x10\xa8\xa2\x8bD\x00t\x0e\xba\x04\xb2\x1d\ -j\xfa\xf0\x94\xcbX\xe0x\xc9iM\x9f\xe6\x9cKc\ -j{\xfd\xb9\xce\xe7\xdb\xab\x9a\x14\xb6\xd3\x8b\xe3\xf1?\ -V\x8e\x9e\xad\xee\x91\x1e\xc8\x00\x00\x00\x00IEND\ -\xaeB`\x82\ -\x00\x00\x066\ -\x89\ -PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ -\x00\x00\x0d\x00\x00\x00\x17\x08\x06\x00\x00\x00\xd0\xa6\xc5\x81\ -\x00\x00\x00\x19tEXtSoftware\ -\x00Adobe ImageRead\ -yq\xc9e<\x00\x00\x03$iTXtXML\ -:com.adobe.xmp\x00\x00\ -\x00\x00\x00 \ - \x97\xa0=\xd8\x00\x00\x02\xa8IDATx\xda\x8c\ -\x94_HSQ\x1c\xc7\xcf\xbd\xbb\xd7;\xb7\xdd\xddQ\ -\x90\xbe\x0cb\x9b\x93\xd4\xf5\x10\xc1\x0a\xf4\xc5)\xd8\x1f\ -)Fd\xd4C\xeaK\xe4CB\xf6\x98\xb4\xb5\xad=\ -\xc8\xe8\xc9\xf5\x1e\xf4\x92\xd2\x96E\xeb!Y\x96\xc5\x94\ -\xc2\x94\x05\xb2\xf9\x10H\xed\xa1\x8767\xc1\xfd\xf3\xf6\ -=\xd7ML\x97z\xe0\xcb\xdd\xef\xdc}8\xbf\xf3\xfd\ -\x9es\x19Y\x96\xc9A\xc3j\xb5\x0ep\x1c\xf7\x98\xc8\ -r\xa1P,\xde`\x0e\x82\xdaZ[\xefiu\xba1\ -\xb5 \x90r\xb9Lr\xeb\xeb1n?\xc0f\xb3\xb9\ -\x0c\x06\xc3\x03Q\xaf'u \ - \xd9\x0c\xdf\xc0\x00\x00\x01\xcdIDATx\xda\xac\ -\x95;K\x03A\x14\x857\x994\xdaF1>@\xc5\ -\x88A\x8c,*\x16b#XZ\x08\x06\x04\x0b\xa3\xad\ -\x85\x9d`\x13\x0b\x1bm,5\x8d\x88\x89\xd8(B4\ ->@B\x88\x16\x16\x22b:\xff\x86 X\x04]\xcf\ -\x95+\x84e\xe6\xee\xaef\xe0\xec\xcc\xee\x1c\xbey\xec\ -\xbd3\x91\xa5t\xba\xd9\xb2\xac\x03h\x0ez\x832\x87\ -\xb9\x5c\xd6\x0aX\xc2\xd0\x064\x0fE\xa0(\xb4\x07\xf8\ -\xfa_@\xe3\x9a\xef[\x80e\x82\x82\x1e\x0d}\x9b\x80\ -m\xfb\x05)\xdb\xb6\x1fPO@\xbd\x9a\xfeI\xf47\ -\xbdT\xab%/P\x88\x1e\xbc\xe1\x97\xd0\x94\xc1\xb7\x03\ -\xad\xe1'8\xc6\x19\xd1\x03#\xd60\xf2\xa903\xfa\ -\xde\x06\xcf5\xbcf\x90\x0b6\x0c\x0dh\xbcc\x12L\ -\xd5\xbf0\xec\x0cM[\x80\xb5\xc3s\x03\xafc\x041\ -\xec\xd3\x036\x0a\xc5\xe19\xaf\x87)\xddz\xeb`q\ -(\xa9\xb1$\xdd0e\xfa\x0b\x0c+x\xc0\xfa\xe1)\ -\x927\xe4\x15\x1f\x08\x0d\x1a,\x0f-\x18,E(\xa5\ -\xbc@4uZ\x02\x9a1\xde\x1fw\xa1}\x8c)?\ -\xe1\xcf\xb0+4;\xa1\x11\xdd2\xc3\x01\xf22\xca1\ -\xa6+\xef!?\x04\xecS+\xaa24d\xb0\xac\xa8\ -\x06@V\x91\x83\xbb\xca\x03\xd2\x81\xaa$\xcd\x84 b\ -\x1c\x01\xd2\x85\xea\x0eJ\x08\x90\xac\x18\xd9\x0c\xa9@}\ -\x9a\xee/h\x19\x90}1\xd7\x00\xe9\xe1=1A\x16\ -\x019\x12\xb3\x1f\x10J\x87{\xa8[\x80\x1c\x8b\xe7\x11\ -C*\x1ct\xeeR\xa3\x9b\x06\x90\x13\xf1\x84\x04$\xc1\ -\xcb1AR\x80\x14\xc4\xc3\x1f\x90A^NL\x80\x5c\ -x\xc5\x1b]\x8a\xb4q-\x9a\xbe\x0fh\x16\x90[?\ -\xd1\x1f1$!Af\x00)\x07\xb9 \x9f\xff\x0b\xf9\ -\x05\xd1\x81\xf5\xc4\xef\xaf\xd0tP\xc8\xcf\x05\xe98\x8e\ -\xd5\x88\xf2-\xc0\x00\xaa\xfa\xae\x1fG|9m\x00\x00\ -\x00\x00IEND\xaeB`\x82\ -\x00\x00\x03w\ -\x89\ -PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ -\x00\x00\x1b\x00\x00\x00\x1c\x08\x06\x00\x00\x00\x90\xd1\xc4\xed\ -\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\ -\x01\x00\x9a\x9c\x18\x00\x00\x03)IDATH\x0d\xbd\ -V=LZQ\x14\x06\xa4\xd1PE\x03\x14\x08\x83\xc8\ -fL\xd3\x10\x93\x06\x97\xa6\xdd\xbb3th\x8c\xa1\x1b\ -\x9d\x18\xbauaj\x22k'6\x17\x87v\xec\xd6\xa5\ -\x1b.\x84\x04\x02&\x18\x15\x02\x89\xd2\x8a\xfc$\xb6D\ -y\xaf\xdfw\xfb\xde\xf5\xf9\xfa\xe4\xa76\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\x88;L\ -~\x03}U80w\xf4\xee\xee\x00\x00\x00\x00IE\ -ND\xaeB`\x82\ -\x00\x00\x18@\ -\x89\ -PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ -\x00\x01\x00\x00\x00\x01\x00\x08\x06\x00\x00\x00\x5cr\xa8f\ -\x00\x00\x00\x19tEXtSoftware\ -\x00Adobe ImageRead\ -yq\xc9e<\x00\x00\x03*iTXtXML\ -:com.adobe.xmp\x00\x00\ -\x00\x00\x00 j\x12\xd3\xd3\x00\x00\x14\xacI\ -DATx\xda\xec\x9d\x09\x98V\xd5y\x80\xbf\x7f\xf6\ -}\x83\x19\x96a\x97m\x10A\xa1\xb8\x00\x06p\xc1h\ -]\xaaF\xf3XS5\x1a\xd7\xb4Q\xa3\xb1\xb1\xc6G\ -\xd3j%mS\x97<\xd5\x94j\x88q\x97 (\x06\ -\x97\x22ZqEPQ\x04\x14\x10d\x86\xd9g\x98}\ -\x9f\xf9{\xbf\x9bj\x091d\x06\xbe\x7f\xe6.\xef;\ -\xcf\xff\x8c\xe3\xa3\xe7\xbf\xf7\xdc\xfb\xbd\xf7\x9cs\xcf\xf9\ -N$\x1a\x8d\x0a\x00\x84\x938\xaa\x00\x00\x01\x00\x00\x02\ -\x00\x00\x04\x00\x00\x08\x00\x00\x10\x00\x00 \x00\x00@\x00\ -\x00\x80\x00\x00\x00\x01\x00\x00\x02\x00\x00\x04\x00\x00\x08\x00\ -\x00\x10\x00\x00 \x00\x00@\x00\x00\x80\x00\x00\x00\x01\x00\ -\x00\x02\x00\x00\x04\x00\x00\x08\x00\x00\x10\x00\x00 \x00\x00\ -@\x00\x00\x80\x00\x00\x00\x01\x00\x00\x02\x00\x00\x04\x00\x00\ -\x08\x00\x00\x10\x00\x00 \x00\x00@\x00\x00\x80\x00\x00\xe0\ -O\x13\xf1\xca\x81,\xd8p\xce\x11\xce\xaf5\xceg0\ -\x97\x05 D\x02 \xf8\x01B*\x00\x82\x1f \xa4\x02\ - \xf8\x01B*\x00\x82\x1f \xa4\x02 \xf8\x01B*\ -\x00\x82\x1f \xa4\x02 \xf8\x01B*\x00\x82\x1f \xa4\ -\x02 \xf8\x01B*\x00\x82\x1f \xa4\x02 \xf8\x01B\ -*\x00\x82\x1f \xa4\x02 \xf8\x01B*\x00\x82\x1f \ -\xa4\x02 \xf8\x01B*\x00\x82\x1f \xa4\x02 \xf8\x01\ -B*\x00\x82\x1f \xa4\x02 \xf8\x01B*\x00'\xf8\ -\x8fq~\xbd\xec|\xb2\xa8F\x80\x10\x09\x80\xe0\x07\x08\ -\xa9\x00\x08~\x80\x90\x0a\x80\xe0\x07\x08\xa9\x00\x08~\x80\ -\x90\x0a\x80\xe0\x07\x08\xa9\x00\x08~\x80\x90\x0a\x80\xe0\x07\ -\x08\xa9\x00\x08~\x80\x90\x0a\x80\xe0\x07\x08\xa9\x00\x08~\ -\x80\x90\x0a\x80\xe0\x07\x08\xa9\x00\x08\xfe\xfe!#>\xfd\ -\xf7\x15\x1f\x89Hj\x5c\x8a\xb4t\xb7\xba\x7fwE\xbb\ -\xa4\xad\xa7\x9d\x0a\x82\xfe\x17\x00\xc1\x7f\xe8\xc4E\xe2d\ -d\xf2p\x19\x99R(\x85\xc9C\x9d\xcf0)H\x1a\ -$9\x09\xd9\x92\x97\x98+iq\xa9\x92\x16\x9fz\xc0\ -2\xa2\xceOsw\x8b4t5J]W\xbdTw\ -\xee\x95\xaa\x8ej\xd9\xd3^.\xa5\xce\xe7\xf3\xd6/\x9c\ -\x7fWKe\x83\x9d\x00\x08\xfe\x83#3>C\xa6g\ -N\x91\xa9\xe9ErDF\x91\x8cK\x1d-\xc9qI\ -1\xff\xde\xba\xae\x06\xf9\xace\x87lj\xda\x22\x1b\x9b\ -6\xcb\x96\xe6\xcf\x9c\xd6C7\x17\x04\x0eZ\x00\xf5\x04\ -\x7f\xef\x18\xe4<\xc9\xe7\xe7\xce\x919\xd9G\xcb4'\ -\xe8\xf5\xa9?\xd0h\x8b\xe1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95\xd5\x0c\xc6\xd1)#%>\x12O\xc4\ - \x00\xef2*e\x04-\x80\xfd\xf8\xcch\x01\x93&\ -\x09\xb1\xd8\xbe\x1b\x10@\xcc(L\x1efV\xd6\x17m\ -%\x81\xa8\x93\xdd\x86\xe71\xc2\xb0~\x01\x01\x9832\ -\xc5\xe6\x06\xd5T_\x96\x0bj\x06V\x00\xa5\x9e\x14,\ - \x00St\x0a\xb0U\x22\xcb\xe2\xf6\xd2\xc0\x5c\xe0=\ -\x86\xe72$i0\x11\x83\x00\xbcI\xbea\x16\xdb\x92\ -@\x09\xa0\xdc\xae\x8e\x11\x00\x02\xf0*\x05\x86\x03T\x95\ -\x1d5\x81\xb9\xc0U\x9d5f\xfb\x07\x14 \x80\xc0\x11\ -\x98\xd5\x80\xb9\x89v\xa9\xab\xfc>\x01h_4\x97a\ -]g\xbdS?\x87>A\xaa/[\x88\x17\xb7\xedq\ -wL\xea\xfd\x8d\x98`\xb2w\xa3&n\xdd\xddn?\ -\x80\xabu\x88\x00\xdd\xd1\ -nf\x5c\x22\x00\x8f\xb6\x00\x0cw\xf3\xcd\x0b\x9a\x00\x0c\ -6\x05\xb1\xaec@\x00\xa6\xec5l\x9aZ\x05L\xd0\ -\x04\xb0\x97\xe6?\x02\xf0*\x95\x1d\xd5fe\x0d6\xdc\ -ix\xa0I\x8c$\x9a%L\xad\x0a\xd0\xa6\xa9\x100\ -\x01\x94\xb7W\x9a\x95U\x98<,0\x17\xb80y\xa8\ -\x9dd;\xab\x89\x18\x04\xe0MZ{\xda\xcc\xb6\xf4\x1a\ -\x992<@\x02\xb0\x93YU\x07\x02@\x00\x1e\xa6\xa2\ -\xc3\xa6\x150$)?0)\xc6\x0aS\x86\x1a\xd6/\ -\x02@\x00!\xe8\x06\xe8&\x98#\x02\xd2\x0d\x18\x91l\ -\xd7\x9a\xd9\xddVB\xc4 \x00\xef\xb2\xa7\xbd\xdc\xac\xac\ -\x89i\x87\x05\xa2N&\xa4\x8d3+\xab\xb8\x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xaaW\xbb\xf3\x03,\xd1\ -W\x95\x7f;\xe2R*7D\xc1\xff\xea\xccg\xdeE\ -\x00>D\xe7\xf1\xdf\xb3{\xb1y\x22\x13\xddF\xcbz\ -\xc2\x11x7\xf8\x19\x03\xf01\xdb[w\xca\xf2\x18\xcc\ -\xe7\xbfn\xe4\x15\xee4Z\x08~\xf0#\x00\x9f\xb3\xa4\ -\xec\x09\xf3\xd5i\xba\x90\xe6\xe2a\xe7S\xb9!\x08~\ -\x04\xe0stQ\xcf\xfd%K\xcc\xcb=\x8f\xb9\x01\xa1\ -\x08~\x04\x10\x00^\xdd\xfb\xa6lh\xb4\xddNK\xb7\ - \xd7MN\x99\x1b\x10\xec\xe0G\x00\x01\xe1\xde\xdd\x8b\ -\xdd\x15\x84\x96\xe8\xce\xc4\xa7\x0f^H\xe5\x068\xf8\x11\ -@@\xd0\x04\x16\x8f\x97/7/\xf7\x8a\xc2\xef\xb8\xdb\ -\x94C0\x83\x1f\x01\x04\x88\xc7+\x96IY{\x85\xe9\ -\xf8\x82\xe6F\x0c\xd3\x9e\x09a\x0b~%\x81\xba\x0a\x06\ -\x1d=\x9dro\xf1\x7f\xc9\xa2\xf1?9\xa4rj;\ -\xebdY\xd5\xf3\xb2\xb2\xeaei\xean\xa6b\x03\x1c\ -\xfc\x08 `\xack\xf8@\xfe\xa7\xeem\x99\x97s\xdc\ -Au#\x9e\xaexV^\xaayM:\xa3\x9dTf\ -\x08\x82\x1f\x01\x04\x90\xfb\x8b\x97\xc8\xd1YG\xf5:{\ -\x90f\x09~\xb2|\x85\x9b\x22\xcc\xcf\x99\x82\xa1\xef\xc1\ -\x8f\x00\x02\x88\xee\xfc\xa3\xbb\xe9\x5cUx\xf1\x01\xff\xbb\ -\xf5\x0d\x1b\xe5\x89\x8a\xe5\xf2A\xe3\xc7TZH\x83\x1f\ -\x01\x04\x94e\x95\xbf\x93\x85y\xf3\xffh2\x8f\x0e\xe8\ -\xbdV\xf7\x96\xfb\xc4\xd7\xa9\xc4\x10\xee\xe0G\x00\x01\xe5\ -\xcb\xecA\xf7M\xbc\xd3\xfd[\x07\x08W\xd5\xac\x96\xa5\ -\x15\xcfIYG%\x15\x14\x1c\xaa\x9d\xcf\x89N\xf0\x1f\ -\xf4L0\x04\x10Pt\x0b\xab\xa5\x95+\xa5\xad\xbbM\ -\x9e\xa9Z\xe5\xe6\x11\x80\xc0\x05\xff\x09N\xf0\x1fR\x1f\ -\x8e\xac\xc0\x00!\x0d~\x85\x89@\x00!\x0d~\x04\x00\ -\x10\xe2\xe0G\x00\x00!\x0e~\x04\x00\x10\xe2\xe0G\x00\ -\x00!\x0e~\x04\x00\x10\xe2\xe0G\x00\x00!\x0e~\x04\ -\x00\x10\xe2\xe0G\x00\x00!\x0e~\x04\x00\x10\xe2\xe0G\ -\x00\x00!\x0e~\x04\x00\x10\xe2\xe0G\x00\x00!\x0e~\ -\x04\x00\x10\xe2\xe0G\x00\x00!\x0e~\x04\x00\x10\xe2\xe0\ -G\x00\x00!\x0e~%\x12\x8d\x92\x10\x08 \xac\xd0\x02\ -\x00@\x00\x00\x80\x00\x00\x00\x01\x00\x00\x02\x00\x00\x04\x00\ -\x00\x08\x00\x00\x10\x00\x00 \x00\x00@\x00\x00\x80\x00\x00\ -\x00\x01\x00\x00\x02\x00\x00\x04\x00\x00\x08\x00\x00\x10\x00\x00\ - \x00\x00@\x00\x00\x80\x00\x00\x00\x01\x00\x00\x02\x00\x00\ -\x04\x00\x00\x08\x00\x00\x10\x00\x00 \x00\x00@\x00\x00\x80\ -\x00\x00\x00\x01\x00\x00\x02\x00\x00\x04\x00\x00\x08\x00\x00\x10\ -\x00\x00 \x00\x008\x00\xff+\xc0\x00\x1c{0\x19G\ -\x03\xd4k\x00\x00\x00\x00IEND\xaeB`\x82\ -" - -qt_resource_name = b"\ -\x00\x06\ -\x07\x9e\x88\xb4\ -\x00s\ -\x00h\x00a\x00r\x00e\x00d\ -\x00\x0c\ -\x00V'\xdc\ -\x00C\ -\x00h\x00e\x00c\x00k\x00B\x00o\x00x\x00.\x00q\x00m\x00l\ -\x00\x0d\ -\x01\xb8P\x9c\ -\x00T\ -\x00e\x00x\x00t\x00F\x00i\x00e\x00l\x00d\x00.\x00q\x00m\x00l\ -\x00\x09\ -\x08\xbf\xf4\xdc\ -\x00L\ -\x00a\x00b\x00e\x00l\x00.\x00q\x00m\x00l\ -\x00\x1a\ -\x04'S\xdc\ -\x00S\ -\x00i\x00m\x00p\x00l\x00e\x00L\x00a\x00u\x00n\x00c\x00h\x00e\x00r\x00D\x00e\x00l\ -\x00e\x00g\x00a\x00t\x00e\x00.\x00q\x00m\x00l\ -\x00\x10\ -\x09\x8e}\x5c\ -\x00L\ -\x00a\x00u\x00n\x00c\x00h\x00e\x00r\x00L\x00i\x00s\x00t\x00.\x00q\x00m\x00l\ -\x00\x0a\ -\x0a\xce\x15\xdc\ -\x00S\ -\x00l\x00i\x00d\x00e\x00r\x00.\x00q\x00m\x00l\ -\x00\x12\ -\x06\xc0(<\ -\x00F\ -\x00l\x00i\x00c\x00k\x00r\x00R\x00s\x00s\x00M\x00o\x00d\x00e\x00l\x00.\x00q\x00m\ -\x00l\ -\x00\x06\ -\x07\x03}\xc3\ -\x00i\ -\x00m\x00a\x00g\x00e\x00s\ -\x00\x06\ -\x07\x84+\x02\ -\x00q\ -\x00m\x00l\x00d\x00i\x00r\ -\x00\x0a\ -\x09\xcc\x1a\xdc\ -\x00T\ -\x00a\x00b\x00S\x00e\x00t\x00.\x00q\x00m\x00l\ -\x00\x0a\ -\x0d\xd0R\xdc\ -\x00I\ -\x00m\x00a\x00g\x00e\x00s\x00.\x00q\x00m\x00l\ -\x00\x0a\ -\x0bhq\x5c\ -\x00B\ -\x00u\x00t\x00t\x00o\x00n\x00.\x00q\x00m\x00l\ -\x00\x0d\ -\x0b]\x12\x87\ -\x00c\ -\x00h\x00e\x00c\x00k\x00m\x00a\x00r\x00k\x00.\x00p\x00n\x00g\ -\x00\x07\ -\x0auW\xa7\ -\x00t\ -\x00a\x00b\x00.\x00p\x00n\x00g\ -\x00\x08\ -\x07\x9eZG\ -\x00b\ -\x00a\x00c\x00k\x00.\x00p\x00n\x00g\ -\x00\x08\ -\x0c\xf7Y\xc7\ -\x00n\ -\x00e\x00x\x00t\x00.\x00p\x00n\x00g\ -\x00\x11\ -\x02G!g\ -\x00s\ -\x00l\x00i\x00d\x00e\x00r\x00_\x00h\x00a\x00n\x00d\x00l\x00e\x00.\x00p\x00n\x00g\ -\ -\x00\x0b\ -\x05R\xbf'\ -\x00q\ -\x00t\x00-\x00l\x00o\x00g\x00o\x00.\x00p\x00n\x00g\ -" - -qt_resource_struct = b"\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0c\x00\x00\x00\x02\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x12\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x000\x00\x00\x00\x00\x00\x01\x00\x00\x06\x9f\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x00h\x00\x00\x00\x00\x00\x01\x00\x00\x0b\x8a\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x00\xe2\x00\x00\x00\x00\x00\x01\x00\x00&\x02\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x01\x0c\x00\x02\x00\x00\x00\x06\x00\x00\x00\x0e\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x01\x1e\x00\x00\x00\x00\x00\x01\x00\x00,\xcb\ -\x00\x00\x01\x82_\xc7\xcc\xde\ -\x00\x00\x00P\x00\x00\x00\x00\x00\x01\x00\x00\x0a\xbf\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x00\xa2\x00\x01\x00\x00\x00\x01\x00\x00\x16\x06\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x010\x00\x00\x00\x00\x00\x01\x00\x00.\x07\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x01\x00\x00\x1b\xb6\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x01d\x00\x00\x00\x00\x00\x01\x00\x009S\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x01J\x00\x00\x00\x00\x00\x01\x00\x006\xe7\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x01\xde\x00\x00\x00\x00\x00\x01\x00\x00N\xca\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x02\x06\x00\x00\x00\x00\x00\x01\x00\x00RE\ -\x00\x00\x01\x82_\xc1\xa7\xb9\ -\x00\x00\x01\xb2\x00\x00\x00\x00\x00\x01\x00\x00C1\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x01\x9e\x00\x00\x00\x00\x00\x01\x00\x00A\xf8\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x01~\x00\x00\x00\x00\x00\x01\x00\x00>\xcb\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x01\xc8\x00\x00\x00\x00\x00\x01\x00\x00Ik\ -\x00\x00\x01\x82Y\xad^\x0f\ -" - -def qInitResources(): - QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -def qCleanupResources(): - QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -qInitResources() diff --git a/examples/declarative/signals/pytoqml1/main.py b/examples/declarative/signals/pytoqml1/main.py deleted file mode 100644 index 5bc27a521..000000000 --- a/examples/declarative/signals/pytoqml1/main.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import os -from pathlib import Path -import sys -from PySide6.QtCore import QTimer, QUrl -from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickView - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - - timer = QTimer() - timer.start(2000) - - view = QQuickView() - qml_file = os.fspath(Path(__file__).resolve().parent / 'view.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - root = view.rootObject() - - timer.timeout.connect(root.updateRotater) - - view.show() - res = app.exec() - # Deleting the view before it goes out of scope is required to make sure all child QML instances - # are destroyed in the correct order. - del view - sys.exit(res) diff --git a/examples/declarative/signals/pytoqml1/pytoqml1.pyproject b/examples/declarative/signals/pytoqml1/pytoqml1.pyproject deleted file mode 100644 index e6f087cce..000000000 --- a/examples/declarative/signals/pytoqml1/pytoqml1.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "view.qml"] -} diff --git a/examples/declarative/signals/pytoqml1/view.qml b/examples/declarative/signals/pytoqml1/view.qml deleted file mode 100644 index af2d966be..000000000 --- a/examples/declarative/signals/pytoqml1/view.qml +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -Rectangle { - id: page - - function updateRotater() { - rotater.angle = rotater.angle + 45 - } - - width: 500; height: 200 - color: "lightgray" - - Rectangle { - id: rotater - property real angle : 0 - x: 240 - width: 100; height: 10 - color: "black" - y: 95 - - transform: Rotation { - origin.x: 10; origin.y: 5 - angle: rotater.angle - Behavior on angle { - SpringAnimation { - spring: 1.4 - damping: .05 - } - } - } - } - -} diff --git a/examples/declarative/signals/pytoqml2/main.py b/examples/declarative/signals/pytoqml2/main.py deleted file mode 100644 index 3a3650aba..000000000 --- a/examples/declarative/signals/pytoqml2/main.py +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import os -from pathlib import Path -import sys -from PySide6.QtCore import QObject, QTimer, QUrl, Signal, Slot -from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickView -from PySide6.QtQml import QmlElement - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.signals.pytoqml2" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class RotateValue(QObject): - valueChanged = Signal(int, arguments=['val']) - - def __init__(self): - super().__init__() - self.r = 0 - - @Slot() - def increment(self): - self.r = self.r + 10 - self.valueChanged.emit(self.r) - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - view = QQuickView() - - rotatevalue = RotateValue() - timer = QTimer() - timer.start(2000) - view.setInitialProperties({"rotatevalue": rotatevalue}) - - qml_file = os.fspath(Path(__file__).resolve().parent / 'view.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - - timer.timeout.connect(rotatevalue.increment) - - view.show() - res = app.exec() - # Deleting the view before it goes out of scope is required to make - # sure all child QML instances are destroyed in the correct order. - del view - sys.exit(res) diff --git a/examples/declarative/signals/pytoqml2/pytoqml2.pyproject b/examples/declarative/signals/pytoqml2/pytoqml2.pyproject deleted file mode 100644 index e6f087cce..000000000 --- a/examples/declarative/signals/pytoqml2/pytoqml2.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "view.qml"] -} diff --git a/examples/declarative/signals/pytoqml2/view.qml b/examples/declarative/signals/pytoqml2/view.qml deleted file mode 100644 index 2e9128f53..000000000 --- a/examples/declarative/signals/pytoqml2/view.qml +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import QtQml - -import examples.signals.pytoqml2 1.0 - -Rectangle { - id: page - - width: 500; height: 200 - color: "lightgray" - required property RotateValue rotatevalue - - Text { - id: helloText - text: "Hello world!" - anchors.horizontalCenter: page.horizontalCenter - y: 30 - font.pointSize: 24; font.bold: true - } - - Connections { - target: rotatevalue - function onValueChanged(val) { - helloText.rotation = val - } - } -} diff --git a/examples/declarative/signals/qmltopy1/main.py b/examples/declarative/signals/qmltopy1/main.py deleted file mode 100644 index 83966903c..000000000 --- a/examples/declarative/signals/qmltopy1/main.py +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import os -from pathlib import Path -import sys -from PySide6.QtCore import QObject, QUrl, Slot -from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickView -from PySide6.QtQml import QmlElement - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.signals.qmltopy1" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class Console(QObject): - """Output stuff on the console.""" - - @Slot(str) - @Slot('double') - def output(self, s): - print(s) - - @Slot(str) - def outputStr(self, s): - print(s) - - @Slot('double') - def outputFloat(self, x): - print(x) - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - view = QQuickView() - - qml_file = os.fspath(Path(__file__).resolve().parent / 'view.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - view.show() - res = app.exec() - # Deleting the view before it goes out of scope is required to make sure all child QML instances - # are destroyed in the correct order. - del view - sys.exit(res) diff --git a/examples/declarative/signals/qmltopy1/qmltopy1.pyproject b/examples/declarative/signals/qmltopy1/qmltopy1.pyproject deleted file mode 100644 index e6f087cce..000000000 --- a/examples/declarative/signals/qmltopy1/qmltopy1.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "view.qml"] -} diff --git a/examples/declarative/signals/qmltopy1/view.qml b/examples/declarative/signals/qmltopy1/view.qml deleted file mode 100644 index b10e2e77d..000000000 --- a/examples/declarative/signals/qmltopy1/view.qml +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - - -import QtQuick - -import examples.signals.qmltopy1 1.0 - -Rectangle { - id: page - - width: 500; height: 200 - color: "lightgray" - - Console { - id: pyConsole - } - - Text { - id: helloText - text: "Hello world!" - anchors.horizontalCenter: page.horizontalCenter - y: 30 - font.pointSize: 24; font.bold: true - } - - Rectangle { - id: button - width: 150; height: 40 - color: "darkgray" - anchors.horizontalCenter: page.horizontalCenter - y: 120 - MouseArea { - id: buttonMouseArea - objectName: "buttonMouseArea" - anchors.fill: parent - onClicked: { - // once the "console" context has been declared, - // slots can be called like functions - pyConsole.outputFloat(123) - pyConsole.outputStr("foobar") - pyConsole.output(helloText.x) - pyConsole.output(helloText.text) - } - } - Text { - id: buttonText - text: "Press me!" - anchors.horizontalCenter: button.horizontalCenter - anchors.verticalCenter: button.verticalCenter - font.pointSize: 16 - } - } -} diff --git a/examples/declarative/signals/qmltopy2/main.py b/examples/declarative/signals/qmltopy2/main.py deleted file mode 100644 index bc2e8d3ed..000000000 --- a/examples/declarative/signals/qmltopy2/main.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import os -from pathlib import Path -import sys -from PySide6.QtCore import QObject, QUrl, Slot -from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickView -from PySide6.QtQml import QmlElement - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "examples.signals.qmltopy2" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class RotateValue(QObject): - def __init__(self): - super().__init__() - self.r = 0 - - # If a slot returns a value, the return value type must be explicitly - # defined in the decorator. - @Slot(result=int) - def val(self): - self.r = self.r + 10 - return self.r - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - view = QQuickView() - - qml_file = os.fspath(Path(__file__).resolve().parent / 'view.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - view.show() - res = app.exec() - # Deleting the view before it goes out of scope is required to make sure all child QML instances - # are destroyed in the correct order. - del view - sys.exit(res) diff --git a/examples/declarative/signals/qmltopy2/qmltopy2.pyproject b/examples/declarative/signals/qmltopy2/qmltopy2.pyproject deleted file mode 100644 index e6f087cce..000000000 --- a/examples/declarative/signals/qmltopy2/qmltopy2.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "view.qml"] -} diff --git a/examples/declarative/signals/qmltopy2/view.qml b/examples/declarative/signals/qmltopy2/view.qml deleted file mode 100644 index 4bbda574c..000000000 --- a/examples/declarative/signals/qmltopy2/view.qml +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -import examples.signals.qmltopy2 1.0 - -Rectangle { - id: page - - width: 500; height: 200 - color: "lightgray" - - RotateValue { - id: rotatevalue - } - - Text { - id: helloText - text: "Hello world!" - anchors.horizontalCenter: page.horizontalCenter - y: 30 - font.pointSize: 24; font.bold: true - } - - - Rectangle { - id: button - width: 150; height: 40 - color: "darkgray" - anchors.horizontalCenter: page.horizontalCenter - y: 120 - MouseArea { - id: buttonMouseArea - objectName: "buttonMouseArea" - anchors.fill: parent - onClicked: { - helloText.rotation = rotatevalue.val() - } - } - Text { - id: buttonText - text: "Press me!" - anchors.horizontalCenter: button.horizontalCenter - anchors.verticalCenter: button.verticalCenter - font.pointSize: 16 - } - } -} diff --git a/examples/declarative/signals/qmltopy3/main.py b/examples/declarative/signals/qmltopy3/main.py deleted file mode 100644 index 6a5554842..000000000 --- a/examples/declarative/signals/qmltopy3/main.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import os -from pathlib import Path -import sys -from PySide6.QtCore import QUrl -from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickView - - -def sayThis(s): - print(s) - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - view = QQuickView() - qml_file = os.fspath(Path(__file__).resolve().parent / 'view.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - - root = view.rootObject() - root.textRotationChanged.connect(sayThis) - root.buttonClicked.connect(lambda: sayThis("clicked button (QML top-level signal)")) - - view.show() - res = app.exec() - # Deleting the view before it goes out of scope is required to make sure all child QML instances - # are destroyed in the correct order. - del view - sys.exit(res) diff --git a/examples/declarative/signals/qmltopy3/qmltopy3.pyproject b/examples/declarative/signals/qmltopy3/qmltopy3.pyproject deleted file mode 100644 index e6f087cce..000000000 --- a/examples/declarative/signals/qmltopy3/qmltopy3.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "view.qml"] -} diff --git a/examples/declarative/signals/qmltopy3/view.qml b/examples/declarative/signals/qmltopy3/view.qml deleted file mode 100644 index 3e8a0f564..000000000 --- a/examples/declarative/signals/qmltopy3/view.qml +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -Rectangle { - id: page - - signal buttonClicked - signal textRotationChanged(double rot) - - width: 500; height: 200 - color: "lightgray" - - Text { - id: helloText - text: "Hello world!" - y: 30 - x: page.width/2-width/2 - font.pointSize: 24; font.bold: true - onRotationChanged: textRotationChanged(rotation) - - states: State { - name: "down"; when: buttonMouseArea.pressed === true - PropertyChanges { - target: helloText; - rotation: 180; - y: 100; - } - } - - transitions: Transition { - from: ""; to: "down"; reversible: true - ParallelAnimation { - NumberAnimation { - properties: "y,rotation" - duration: 500 - easing.type: Easing.InOutQuad - } - } - } - } - - Rectangle { - id: button - width: 150; height: 40 - color: "darkgray" - anchors.horizontalCenter: page.horizontalCenter - y: 120 - MouseArea { - id: buttonMouseArea - objectName: "buttonMouseArea" - anchors.fill: parent - onClicked: { - buttonClicked() - } - } - Text { - id: buttonText - text: "Press me!" - anchors.horizontalCenter: button.horizontalCenter - anchors.verticalCenter: button.verticalCenter - font.pointSize: 16 - } - } -} diff --git a/examples/declarative/signals/qmltopy4/main.py b/examples/declarative/signals/qmltopy4/main.py deleted file mode 100644 index 8a56073d1..000000000 --- a/examples/declarative/signals/qmltopy4/main.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import os -from pathlib import Path -import sys -from PySide6.QtCore import QObject, QUrl -from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickView - - -def sayThis(s): - print(s) - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - view = QQuickView() - qml_file = os.fspath(Path(__file__).resolve().parent / 'view.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - - root = view.rootObject() - button = root.findChild(QObject, "buttonMouseArea") - button.clicked.connect(lambda: sayThis("clicked button (signal directly connected)")) - - view.show() - res = app.exec() - # Deleting the view before it goes out of scope is required to make sure all child QML instances - # are destroyed in the correct order. - del view - sys.exit(res) diff --git a/examples/declarative/signals/qmltopy4/qmltopy4.pyproject b/examples/declarative/signals/qmltopy4/qmltopy4.pyproject deleted file mode 100644 index e6f087cce..000000000 --- a/examples/declarative/signals/qmltopy4/qmltopy4.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "view.qml"] -} diff --git a/examples/declarative/signals/qmltopy4/view.qml b/examples/declarative/signals/qmltopy4/view.qml deleted file mode 100644 index 771b14c47..000000000 --- a/examples/declarative/signals/qmltopy4/view.qml +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -Rectangle { - id: page - - width: 500; height: 200 - color: "lightgray" - - Rectangle { - id: button - width: 150; height: 40 - color: "darkgray" - anchors.horizontalCenter: page.horizontalCenter - anchors.verticalCenter: page.verticalCenter - MouseArea { - id: buttonMouseArea - objectName: "buttonMouseArea" - anchors.fill: parent - } - Text { - id: buttonText - text: "Press me!" - anchors.horizontalCenter: button.horizontalCenter - anchors.verticalCenter: button.verticalCenter - font.pointSize: 16 - } - } -} diff --git a/examples/declarative/stringlistmodel/doc/stringlistmodel.png b/examples/declarative/stringlistmodel/doc/stringlistmodel.png deleted file mode 100644 index eeb9b518a..000000000 Binary files a/examples/declarative/stringlistmodel/doc/stringlistmodel.png and /dev/null differ diff --git a/examples/declarative/stringlistmodel/doc/stringlistmodel.rst b/examples/declarative/stringlistmodel/doc/stringlistmodel.rst deleted file mode 100644 index 4c00ed130..000000000 --- a/examples/declarative/stringlistmodel/doc/stringlistmodel.rst +++ /dev/null @@ -1,9 +0,0 @@ -String List Model Example -========================= - -A model may be a simple 'list', -which provides the contents of the list via the modelData role. - -.. image:: stringlistmodel.png - :width: 400 - :alt: String List Model Screenshot diff --git a/examples/declarative/stringlistmodel/stringlistmodel.py b/examples/declarative/stringlistmodel/stringlistmodel.py deleted file mode 100644 index a7a1807bb..000000000 --- a/examples/declarative/stringlistmodel/stringlistmodel.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -from pathlib import Path -import sys -from PySide6.QtCore import QUrl -from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickView - -# This example illustrates exposing a QStringList as a model in QML - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - - dataList = ["Item 1", "Item 2", "Item 3", "Item 4"] - - view = QQuickView() - view.setInitialProperties({"model": dataList }) - - qml_file = Path(__file__).parent / "view.qml" - view.setSource(QUrl.fromLocalFile(qml_file)) - view.show() - - r = app.exec() - del view - sys.exit(r) diff --git a/examples/declarative/stringlistmodel/stringlistmodel.pyproject b/examples/declarative/stringlistmodel/stringlistmodel.pyproject deleted file mode 100644 index 5ec3e85d1..000000000 --- a/examples/declarative/stringlistmodel/stringlistmodel.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["stringlistmodel.py", "view.qml"] -} diff --git a/examples/declarative/stringlistmodel/view.qml b/examples/declarative/stringlistmodel/view.qml deleted file mode 100644 index 5db5576f4..000000000 --- a/examples/declarative/stringlistmodel/view.qml +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -ListView { - width: 100 - height: 100 - required model - - delegate: Rectangle { - required property string modelData - height: 25 - width: 100 - Text { text: parent.modelData } - } -} diff --git a/examples/declarative/textproperties/doc/textproperties.png b/examples/declarative/textproperties/doc/textproperties.png deleted file mode 100644 index b14bb73d7..000000000 Binary files a/examples/declarative/textproperties/doc/textproperties.png and /dev/null differ diff --git a/examples/declarative/textproperties/doc/textproperties.rst b/examples/declarative/textproperties/doc/textproperties.rst deleted file mode 100644 index 81829dfdc..000000000 --- a/examples/declarative/textproperties/doc/textproperties.rst +++ /dev/null @@ -1,9 +0,0 @@ -Text Properties Example -======================= - -A Python application that demonstrates how to load a qml file -using Material design, to change the look of text. - -.. image:: textproperties.png - :width: 400 - :alt: Text Properties Screenshot diff --git a/examples/declarative/textproperties/main.py b/examples/declarative/textproperties/main.py deleted file mode 100644 index 4e6afc9ff..000000000 --- a/examples/declarative/textproperties/main.py +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import sys -from pathlib import Path - -from PySide6.QtCore import QObject, Slot -from PySide6.QtGui import QGuiApplication -from PySide6.QtQml import QQmlApplicationEngine, QmlElement -from PySide6.QtQuickControls2 import QQuickStyle - - -# To be used on the @QmlElement decorator -# (QML_IMPORT_MINOR_VERSION is optional) -QML_IMPORT_NAME = "io.qt.textproperties" -QML_IMPORT_MAJOR_VERSION = 1 - - -@QmlElement -class Bridge(QObject): - - @Slot(str, result=str) - def getColor(self, s): - if s.lower() == "red": - return "#ef9a9a" - elif s.lower() == "green": - return "#a5d6a7" - elif s.lower() == "blue": - return "#90caf9" - else: - return "white" - - @Slot(float, result=int) - def getSize(self, s): - size = int(s * 34) - if size <= 0: - return 1 - else: - return size - - @Slot(str, result=bool) - def getItalic(self, s): - if s.lower() == "italic": - return True - else: - return False - - @Slot(str, result=bool) - def getBold(self, s): - if s.lower() == "bold": - return True - else: - return False - - @Slot(str, result=bool) - def getUnderline(self, s): - if s.lower() == "underline": - return True - else: - return False - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - QQuickStyle.setStyle("Material") - engine = QQmlApplicationEngine() - - # Get the path of the current directory, and then add the name - # of the QML file, to load it. - qml_file = Path(__file__).parent / 'view.qml' - engine.load(qml_file) - - if not engine.rootObjects(): - sys.exit(-1) - - sys.exit(app.exec()) diff --git a/examples/declarative/textproperties/textproperties.pyproject b/examples/declarative/textproperties/textproperties.pyproject deleted file mode 100644 index e6f087cce..000000000 --- a/examples/declarative/textproperties/textproperties.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "view.qml"] -} diff --git a/examples/declarative/textproperties/view.qml b/examples/declarative/textproperties/view.qml deleted file mode 100644 index c722eb4eb..000000000 --- a/examples/declarative/textproperties/view.qml +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - - -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import QtQuick.Window -import QtQuick.Controls.Material - -import io.qt.textproperties - -ApplicationWindow { - id: page - width: 800 - height: 400 - visible: true - Material.theme: Material.Dark - Material.accent: Material.Red - - Bridge { - id: bridge - } - - GridLayout { - id: grid - columns: 2 - rows: 3 - - ColumnLayout { - spacing: 2 - Layout.columnSpan: 1 - Layout.preferredWidth: 400 - - Text { - id: leftlabel - Layout.alignment: Qt.AlignHCenter - color: "white" - font.pointSize: 16 - text: "Qt for Python" - Layout.preferredHeight: 100 - Material.accent: Material.Green - } - - RadioButton { - id: italic - Layout.alignment: Qt.AlignLeft - text: "Italic" - onToggled: { - leftlabel.font.italic = bridge.getItalic(italic.text) - leftlabel.font.bold = bridge.getBold(italic.text) - leftlabel.font.underline = bridge.getUnderline(italic.text) - - } - } - RadioButton { - id: bold - Layout.alignment: Qt.AlignLeft - text: "Bold" - onToggled: { - leftlabel.font.italic = bridge.getItalic(bold.text) - leftlabel.font.bold = bridge.getBold(bold.text) - leftlabel.font.underline = bridge.getUnderline(bold.text) - } - } - RadioButton { - id: underline - Layout.alignment: Qt.AlignLeft - text: "Underline" - onToggled: { - leftlabel.font.italic = bridge.getItalic(underline.text) - leftlabel.font.bold = bridge.getBold(underline.text) - leftlabel.font.underline = bridge.getUnderline(underline.text) - } - } - RadioButton { - id: noneradio - Layout.alignment: Qt.AlignLeft - text: "None" - checked: true - onToggled: { - leftlabel.font.italic = bridge.getItalic(noneradio.text) - leftlabel.font.bold = bridge.getBold(noneradio.text) - leftlabel.font.underline = bridge.getUnderline(noneradio.text) - } - } - } - - ColumnLayout { - id: rightcolumn - spacing: 2 - Layout.columnSpan: 1 - Layout.preferredWidth: 400 - Layout.preferredHeight: 400 - Layout.fillWidth: true - - RowLayout { - Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter - - - Button { - id: red - text: "Red" - highlighted: true - Material.accent: Material.Red - onClicked: { - leftlabel.color = bridge.getColor(red.text) - } - } - Button { - id: green - text: "Green" - highlighted: true - Material.accent: Material.Green - onClicked: { - leftlabel.color = bridge.getColor(green.text) - } - } - Button { - id: blue - text: "Blue" - highlighted: true - Material.accent: Material.Blue - onClicked: { - leftlabel.color = bridge.getColor(blue.text) - } - } - Button { - id: nonebutton - text: "None" - highlighted: true - Material.accent: Material.BlueGrey - onClicked: { - leftlabel.color = bridge.getColor(nonebutton.text) - } - } - } - RowLayout { - Layout.fillWidth: true - Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter - Text { - id: rightlabel - color: "white" - Layout.alignment: Qt.AlignLeft - text: "Font size" - Material.accent: Material.White - } - Slider { - width: rightcolumn.width*0.6 - Layout.alignment: Qt.AlignRight - id: slider - value: 0.5 - onValueChanged: { - leftlabel.font.pointSize = bridge.getSize(value) - } - } - } - } - } -} diff --git a/examples/declarative/usingmodel/doc/usingmodel.png b/examples/declarative/usingmodel/doc/usingmodel.png deleted file mode 100644 index b4240951b..000000000 Binary files a/examples/declarative/usingmodel/doc/usingmodel.png and /dev/null differ diff --git a/examples/declarative/usingmodel/doc/usingmodel.rst b/examples/declarative/usingmodel/doc/usingmodel.rst deleted file mode 100644 index 11b476d09..000000000 --- a/examples/declarative/usingmodel/doc/usingmodel.rst +++ /dev/null @@ -1,9 +0,0 @@ -Using Model Example -=================== - -A Python application that demonstrates how to use a :ref:`QAbstractListModel` -with QML. - -.. image:: usingmodel.png - :width: 400 - :alt: Using Model Screenshot diff --git a/examples/declarative/usingmodel/usingmodel.py b/examples/declarative/usingmodel/usingmodel.py deleted file mode 100644 index 6f8ea5a21..000000000 --- a/examples/declarative/usingmodel/usingmodel.py +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import os -from pathlib import Path -import sys -from PySide6.QtCore import QAbstractListModel, Qt, QUrl, QByteArray -from PySide6.QtGui import QGuiApplication -from PySide6.QtQuick import QQuickView -from PySide6.QtQml import qmlRegisterSingletonType - - -class PersonModel (QAbstractListModel): - MyRole = Qt.UserRole + 1 - - def __init__(self, parent=None): - QAbstractListModel.__init__(self, parent) - self._data = [] - - def roleNames(self): - roles = { - PersonModel.MyRole: QByteArray(b'modelData'), - Qt.DisplayRole: QByteArray(b'display') - } - return roles - - def rowCount(self, index): - return len(self._data) - - def data(self, index, role): - d = self._data[index.row()] - - if role == Qt.DisplayRole: - return d['name'] - elif role == Qt.DecorationRole: - return Qt.black - elif role == PersonModel.MyRole: - return d['myrole'] - return None - - def populate(self, data=None): - for item in data: - self._data.append(item) - - -def model_callback(engine): - my_model = PersonModel() - data = [{'name': 'Qt', 'myrole': 'role1'}, - {'name': 'PySide', 'myrole': 'role2'}] - my_model.populate(data) - return my_model - - -if __name__ == '__main__': - app = QGuiApplication(sys.argv) - view = QQuickView() - view.setResizeMode(QQuickView.SizeRootObjectToView) - - qmlRegisterSingletonType(PersonModel, "PersonModel", 1, 0, "MyModel", model_callback) - qml_file = os.fspath(Path(__file__).resolve().parent / 'view.qml') - view.setSource(QUrl.fromLocalFile(qml_file)) - if view.status() == QQuickView.Error: - sys.exit(-1) - view.show() - - r = app.exec() - # Deleting the view before it goes out of scope is required to make sure all child QML instances - # are destroyed in the correct order. - del view - sys.exit(r) diff --git a/examples/declarative/usingmodel/usingmodel.pyproject b/examples/declarative/usingmodel/usingmodel.pyproject deleted file mode 100644 index 600cdb409..000000000 --- a/examples/declarative/usingmodel/usingmodel.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["view.qml", "usingmodel.py"] -} diff --git a/examples/declarative/usingmodel/view.qml b/examples/declarative/usingmodel/view.qml deleted file mode 100644 index c5aa7e0fc..000000000 --- a/examples/declarative/usingmodel/view.qml +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import PersonModel - -ListView { - width: 100 - height: 100 - anchors.fill: parent - model: MyModel - delegate: Component { - Rectangle { - height: 25 - width: 100 - Text { - function displayText() { - var result = "" - if (typeof display !== "undefined") - result = display + ": " - result += modelData - return result - } - - text: displayText() - } - } - } -} diff --git a/examples/declarative/window/AllScreens.qml b/examples/declarative/window/AllScreens.qml deleted file mode 100644 index 25438f21a..000000000 --- a/examples/declarative/window/AllScreens.qml +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import QtQuick.Controls - -Column { - id: root - spacing: 8 - - Label { - text: "Total number of screens: " + screenInfo.count - font.bold: true - } - - Flow { - spacing: 12 - width: parent.width - - Repeater { - id: screenInfo - model: (Qt.application as Application).screens - Label { - required property string name - required property int virtualX - required property int virtualY - required property var modelData // avoid shadowing Label.width and height - - lineHeight: 1.5 - text: name + "\n" + virtualX + ", " + virtualY + " " + modelData.width + "x" + modelData.height - } - } - } - - Component.onCompleted: { - var screens = (Qt.application as Application).screens; - for (var i = 0; i < screens.length; ++i) - console.log("screen " + screens[i].name + " has geometry " + - screens[i].virtualX + ", " + screens[i].virtualY + " " + - screens[i].width + "x" + screens[i].height) - } -} diff --git a/examples/declarative/window/CurrentScreen.qml b/examples/declarative/window/CurrentScreen.qml deleted file mode 100644 index 1f4da7f0b..000000000 --- a/examples/declarative/window/CurrentScreen.qml +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import QtQuick.Controls - -Item { - id: root - width: 400 - height: propertyGrid.implicitHeight + 16 - - function orientationToString(o) { - switch (o) { - case Qt.PrimaryOrientation: - return "primary"; - case Qt.PortraitOrientation: - return "portrait"; - case Qt.LandscapeOrientation: - return "landscape"; - case Qt.InvertedPortraitOrientation: - return "inverted portrait"; - case Qt.InvertedLandscapeOrientation: - return "inverted landscape"; - } - return "unknown"; - } - - Grid { - id: propertyGrid - columns: 2 - spacing: 8 - x: spacing - y: spacing - - //! [screen] - Label { - text: "Screen \"" + Screen.name + "\":" - font.bold: true - } - Item { width: 1; height: 1 } // spacer - - Label { text: "manufacturer" } - Label { text: Screen.manufacturer ? Screen.manufacturer : "unknown" } - - Label { text: "model" } - Label { text: Screen.model ? Screen.model : "unknown" } - - Label { text: "serial number" } - Label { text: Screen.serialNumber ? Screen.serialNumber : "unknown" } - - Label { text: "dimensions" } - Label { text: Screen.width + "x" + Screen.height } - - Label { text: "pixel density" } - Label { text: Screen.pixelDensity.toFixed(2) + " dots/mm (" + (Screen.pixelDensity * 25.4).toFixed(2) + " dots/inch)" } - - Label { text: "logical pixel density" } - Label { text: Screen.logicalPixelDensity.toFixed(2) + " dots/mm (" + (Screen.logicalPixelDensity * 25.4).toFixed(2) + " dots/inch)" } - - Label { text: "device pixel ratio" } - Label { text: Screen.devicePixelRatio.toFixed(2) } - - Label { text: "available virtual desktop" } - Label { text: Screen.desktopAvailableWidth + "x" + Screen.desktopAvailableHeight } - - Label { text: "position in virtual desktop" } - Label { text: Screen.virtualX + ", " + Screen.virtualY } - - Label { text: "orientation" } - Label { text: root.orientationToString(Screen.orientation) + " (" + Screen.orientation + ")" } - - Label { text: "primary orientation" } - Label { text: root.orientationToString(Screen.primaryOrientation) + " (" + Screen.primaryOrientation + ")" } - //! [screen] - - Label { text: "10mm rectangle" } - Rectangle { - color: "red" - width: Screen.pixelDensity * 10 - height: width - } - } -} diff --git a/examples/declarative/window/Splash.qml b/examples/declarative/window/Splash.qml deleted file mode 100644 index 0a7da219d..000000000 --- a/examples/declarative/window/Splash.qml +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import shared - -//! [splash-properties] -Window { - id: splash - color: "transparent" - title: "Splash Window" - modality: Qt.ApplicationModal - flags: Qt.SplashScreen - property int timeoutInterval: 2000 - signal timeout -//! [splash-properties] -//! [screen-properties] - x: (Screen.width - splashImage.width) / 2 - y: (Screen.height - splashImage.height) / 2 -//! [screen-properties] - width: splashImage.width - height: splashImage.height - - Image { - id: splashImage - source: Images.qtLogo - MouseArea { - anchors.fill: parent - onClicked: Qt.quit() - } - } - //! [timer] - Timer { - interval: splash.timeoutInterval; running: true; repeat: false - onTriggered: { - splash.visible = false - splash.timeout() - } - } - //! [timer] - Component.onCompleted: visible = true -} diff --git a/examples/declarative/window/doc/window.png b/examples/declarative/window/doc/window.png deleted file mode 100644 index 72487b4d9..000000000 Binary files a/examples/declarative/window/doc/window.png and /dev/null differ diff --git a/examples/declarative/window/doc/window.rst b/examples/declarative/window/doc/window.rst deleted file mode 100644 index 8736bb629..000000000 --- a/examples/declarative/window/doc/window.rst +++ /dev/null @@ -1,35 +0,0 @@ -Qt Quick Examples - Window and Screen -===================================== - -This example demonstrates the Window and Screen types in QML. - -.. image:: window.png - :width: 392 - :alt: Window and Screen screenshot - -In addition, this example demonstrates the usage of the Qt Resource System in -Qt for Python for more advanced scenarios. There are several QML files, one of -which imports a module from this sibling directory. Both this "shared" module -and the QML files of the example need to be compiled into Python modules with -the resource compiler rcc. - -For the "shared" module approach to work with QML and rcc, you need: - -* A module definition *qmldir* file -* A Qt Resource Collection file (.qrc) specifying all the QML files and other -resources, plus the *qmldir* file - -The .qrc file is the input to rcc. This will generate a Python module (called -*shared_rc* here) that can then be imported from the Python code. At runtime, -only this Python module is needed, not the .qrc file or any of the .qml files -or even the image resources, as they have all been compiled into the Python -module. - -For the example, rcc needs: - -* A Qt Resource Collection file (.qrc) specifying all the QML files and other -resources. There is no qmldir file here because this is not a module. - -This will generate a Python module (called *window_rc* here) that can then be -imported from the Python code. Again, only the Python module is needed at -runtime. diff --git a/examples/declarative/window/main.py b/examples/declarative/window/main.py deleted file mode 100644 index 8f8260b56..000000000 --- a/examples/declarative/window/main.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import os -from pathlib import Path -import sys - -from PySide6.QtCore import QUrl, qWarning -from PySide6.QtGui import QGuiApplication -from PySide6.QtQml import QQmlComponent, QQmlEngine -from PySide6.QtQuick import QQuickWindow - -import window_rc - -# Append the parent directory of this file so that Python can find and -# import from the "shared" sibling directory. -sys.path.append(os.fspath(Path(__file__).parent.parent)) -from shared import shared_rc - - -if __name__ == "__main__": - app = QGuiApplication(sys.argv) - engine = QQmlEngine() - - # Add the qrc root as QML import path so that the "shared" module - # can be found. - engine.addImportPath(":/") - - component = QQmlComponent(engine) - QQuickWindow.setDefaultAlphaBuffer(True) - component.loadUrl(QUrl("qrc:///window/window.qml")) - if component.isReady(): - component.create() - else: - qWarning(component.errorString()) - app.exit(1) - app.exec() diff --git a/examples/declarative/window/resources/icon.icns b/examples/declarative/window/resources/icon.icns deleted file mode 100644 index 88b4b2444..000000000 Binary files a/examples/declarative/window/resources/icon.icns and /dev/null differ diff --git a/examples/declarative/window/resources/icon.ico b/examples/declarative/window/resources/icon.ico deleted file mode 100644 index 52af30a6c..000000000 Binary files a/examples/declarative/window/resources/icon.ico and /dev/null differ diff --git a/examples/declarative/window/resources/icon.svg b/examples/declarative/window/resources/icon.svg deleted file mode 100644 index 0b6153206..000000000 --- a/examples/declarative/window/resources/icon.svg +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/window/resources/icon64.png b/examples/declarative/window/resources/icon64.png deleted file mode 100644 index 0fa324401..000000000 Binary files a/examples/declarative/window/resources/icon64.png and /dev/null differ diff --git a/examples/declarative/window/window.pyproject b/examples/declarative/window/window.pyproject deleted file mode 100644 index 8ce352cd2..000000000 --- a/examples/declarative/window/window.pyproject +++ /dev/null @@ -1,3 +0,0 @@ -{ - "files": ["main.py", "window.qml", "Splash.qml", "AllScreens.qml", "CurrentScreen.qml"] -} diff --git a/examples/declarative/window/window.qml b/examples/declarative/window/window.qml deleted file mode 100644 index 47cc5257b..000000000 --- a/examples/declarative/window/window.qml +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import QtQuick.Controls - -QtObject { - id: root - property real defaultSpacing: 10 - property SystemPalette palette: SystemPalette { } - - property var controlWindow: Window { - width: col.implicitWidth + root.defaultSpacing * 2 - height: col.implicitHeight + root.defaultSpacing * 2 - color: root.palette.window - title: "Control Window" - Column { - id: col - anchors.fill: parent - anchors.margins: root.defaultSpacing - spacing: root.defaultSpacing - property real cellWidth: col.width / 3 - spacing - Label { text: "Control the second window:" } - Grid { - id: grid - columns: 3 - spacing: root.defaultSpacing - width: parent.width - Button { - id: showButton - width: col.cellWidth - text: root.testWindow.visible ? "Hide" : "Show" - onClicked: root.testWindow.visible = !root.testWindow.visible - } - //! [windowedCheckbox] - CheckBox { - text: "Windowed" - height: showButton.height - width: col.cellWidth - Binding on checked { value: root.testWindow.visibility === Window.Windowed } - onClicked: root.testWindow.visibility = Window.Windowed - } - //! [windowedCheckbox] - CheckBox { - height: showButton.height - width: col.cellWidth - text: "Full Screen" - Binding on checked { value: root.testWindow.visibility === Window.FullScreen } - onClicked: root.testWindow.visibility = Window.FullScreen - } - Button { - id: autoButton - width: col.cellWidth - text: "Automatic" - onClicked: root.testWindow.visibility = Window.AutomaticVisibility - } - CheckBox { - height: autoButton.height - text: "Minimized" - Binding on checked { value: root.testWindow.visibility === Window.Minimized } - onClicked: root.testWindow.visibility = Window.Minimized - } - CheckBox { - height: autoButton.height - text: "Maximized" - Binding on checked { value: root.testWindow.visibility === Window.Maximized } - onClicked: root.testWindow.visibility = Window.Maximized - } - } - function visibilityToString(v) { - switch (v) { - case Window.Windowed: - return "windowed"; - case Window.Minimized: - return "minimized"; - case Window.Maximized: - return "maximized"; - case Window.FullScreen: - return "fullscreen"; - case Window.AutomaticVisibility: - return "automatic"; - case Window.Hidden: - return "hidden"; - } - return "unknown"; - } - Label { - id: visibilityLabel - text: "second window is " + (root.testWindow.visible ? "visible" : "invisible") + - " and has visibility " + parent.visibilityToString(root.testWindow.visibility) - } - Rectangle { - color: root.palette.text - width: parent.width - height: 1 - } - CurrentScreen { } - Rectangle { - color: root.palette.text - width: parent.width - height: 1 - } - AllScreens { width: parent.width } - } - } - - property var testWindow: Window { - width: 320 - height: 240 - color: "#215400" - title: "Test Window with color " + color - flags: Qt.Window | Qt.WindowFullscreenButtonHint - Rectangle { - anchors.fill: parent - anchors.margins: root.defaultSpacing - Label { - anchors.centerIn: parent - text: "Second Window" - } - MouseArea { - anchors.fill: parent - onClicked: root.testWindow.color = "#e0c31e" - } - Button { - anchors.right: parent.right - anchors.top: parent.top - anchors.margins: root.defaultSpacing - text: root.testWindow.visibility === Window.FullScreen ? "exit fullscreen" : "go fullscreen" - width: 150 - onClicked: { - if (root.testWindow.visibility === Window.FullScreen) - root.testWindow.visibility = Window.AutomaticVisibility - else - root.testWindow.visibility = Window.FullScreen - } - } - Button { - anchors.left: parent.left - anchors.top: parent.top - anchors.margins: root.defaultSpacing - text: "X" - width: 30 - onClicked: root.testWindow.close() - } - } - } - - property var splashWindow: Splash { - onTimeout: root.controlWindow.visible = true - } -} diff --git a/examples/declarative/window/window.qrc b/examples/declarative/window/window.qrc deleted file mode 100644 index 89d1de1b1..000000000 --- a/examples/declarative/window/window.qrc +++ /dev/null @@ -1,8 +0,0 @@ - - - window.qml - Splash.qml - CurrentScreen.qml - AllScreens.qml - - diff --git a/examples/declarative/window/window_rc.py b/examples/declarative/window/window_rc.py deleted file mode 100644 index 71a65fc44..000000000 --- a/examples/declarative/window/window_rc.py +++ /dev/null @@ -1,328 +0,0 @@ -# Resource object code (Python 3) -# Created by: object code -# Created by: The Resource Compiler for Qt version 6.5.0 -# WARNING! All changes made in this file will be lost! - -from PySide6 import QtCore - -qt_resource_data = b"\ -\x00\x00\x04\xe8\ -/\ -/ Copyright (C) \ -2021 The Qt Comp\ -any Ltd.\x0a// SPDX\ --License-Identif\ -ier: LicenseRef-\ -Qt-Commercial OR\ - BSD-3-Clause\x0a\x0ai\ -mport QtQuick\x0aim\ -port QtQuick.Con\ -trols\x0a\x0aColumn {\x0a\ - id: root\x0a \ - spacing: 8\x0a\x0a \ - Label {\x0a \ - text: \x22Total nu\ -mber of screens:\ - \x22 + screenInfo.\ -count\x0a fo\ -nt.bold: true\x0a \ - }\x0a\x0a Flow {\x0a\ - spacing:\ - 12\x0a widt\ -h: parent.width\x0a\ -\x0a Repeate\ -r {\x0a \ -id: screenInfo\x0a \ - model\ -: (Qt.applicatio\ -n as Application\ -).screens\x0a \ - Label {\x0a \ - re\ -quired property \ -string name\x0a \ - requ\ -ired property in\ -t virtualX\x0a \ - requi\ -red property int\ - virtualY\x0a \ - requir\ -ed property var \ -modelData // avo\ -id shadowing Lab\ -el.width and hei\ -ght\x0a\x0a \ - lineHeight:\ - 1.5\x0a \ - text: name \ -+ \x22\x5cn\x22 + virtual\ -X + \x22, \x22 + virtu\ -alY + \x22 \x22 + mode\ -lData.width + \x22x\ -\x22 + modelData.he\ -ight\x0a \ - }\x0a }\x0a \ - }\x0a\x0a Componen\ -t.onCompleted: {\ -\x0a var scr\ -eens = (Qt.appli\ -cation as Applic\ -ation).screens;\x0a\ - for (var\ - i = 0; i < scre\ -ens.length; ++i)\ -\x0a con\ -sole.log(\x22screen\ - \x22 + screens[i].\ -name + \x22 has geo\ -metry \x22 +\x0a \ - \ - screens[i].vir\ -tualX + \x22, \x22 + s\ -creens[i].virtua\ -lY + \x22 \x22 +\x0a \ - \ - screens[i].wi\ -dth + \x22x\x22 + scre\ -ens[i].height)\x0a \ - }\x0a}\x0a\ -\x00\x00\x04\x8e\ -\x00\ -\x00\x16\x10x\x9c\xcdXKo\xdb8\x10\xbe\xfbW\xb0\ -\xdaK\xb2\x85\xdf\xed\xc5E\xb0H\x5ctS E\x9b\ -8h\x0a,\xf6\xa0Hc\x8b\x1bZ4H*v6\ -\x9b\xff\xbe#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\xcfC2\x09\x13\ -\x1d`\x12?ODV\x84\x86d\x16\x22\xac\xa8\x90)\ -\xd1{\x95\x97\x09~45\ -\xd4>\xe8\xb2\xb5\xc1\xb8\xda<= ){\xb1\xa2\x02\ -\x7f\xafE\xbc\x05CE\xb1\xf0\xf3\x08\xaf1\x8f\x9f\xe7\ -\xd1\xff\x00N\xd3\xe4.x\x8c\xa5\xbc\xd8\x1dC\x84\xb1\ -\xa8\xd7\x8e\x96\xbf\x98\xdb\xf0_T\xc5\x07?\x0b\x87\xe2\ -\x0e1\x95\xc6\x92\xb46g\x9e\x13>\xe8\xab\xa3!\xd0\ -\x97\x84-B4\xc3'\xa5so*\xa9Y\xc8\xd5\xff\ -\x9b-0\xa8\x8f\x9eb\xa24\xdf\x0c\x83~\x0d[\xce\ -\x9c,foHm\xad\xad\xf5\x17o|\x1ar\ -" - -qt_resource_name = b"\ -\x00\x06\ -\x07\xe0Kg\ -\x00w\ -\x00i\x00n\x00d\x00o\x00w\ -\x00\x0e\ -\x0ei\x17\x5c\ -\x00A\ -\x00l\x00l\x00S\x00c\x00r\x00e\x00e\x00n\x00s\x00.\x00q\x00m\x00l\ -\x00\x0a\ -\x0bi\x98\xbc\ -\x00w\ -\x00i\x00n\x00d\x00o\x00w\x00.\x00q\x00m\x00l\ -\x00\x0a\ -\x08\x90\x1a|\ -\x00S\ -\x00p\x00l\x00a\x00s\x00h\x00.\x00q\x00m\x00l\ -\x00\x11\ -\x02YG\x1c\ -\x00C\ -\x00u\x00r\x00r\x00e\x00n\x00t\x00S\x00c\x00r\x00e\x00e\x00n\x00.\x00q\x00m\x00l\ -\ -" - -qt_resource_struct = b"\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x02\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00h\x00\x01\x00\x00\x00\x01\x00\x00\x0d|\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x00N\x00\x00\x00\x00\x00\x01\x00\x00\x09~\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x004\x00\x01\x00\x00\x00\x01\x00\x00\x04\xec\ -\x00\x00\x01\x82Y\xad^\x0f\ -\x00\x00\x00\x12\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x82Y\xad^\x0f\ -" - -def qInitResources(): - QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -def qCleanupResources(): - QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -qInitResources() -- cgit v1.2.3