aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/scrolling
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <cmaureirafredes@gmail.com>2021-06-28 16:42:55 +0200
committerCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-07-21 10:01:45 +0200
commitc9330b0acf680d4c2a0933b8bf67dc9b3114de5d (patch)
treef58d82c3ce57f04960e39f3af596e5a010f21a7f /examples/declarative/scrolling
parentb1b2cc2ebed2fcf6e31c1fbbdd3638216e34717b (diff)
qml: replace context properties and code updates
Most of the qml code in the repository was outdated, and followed bad practices, like context properties. Complementary, after the major updates for Qt6 most of the code was not relying on the new ways of register types (singletons, and using the decorator QmlElement). Drop the context property usage in the following examples: - signals/qmltopy1 - signals/qmltopy2 - signals/pytoqml2 - usingmodel - quickcontrols2/gallery - textproperties Additionally: - all the tests related to context properties - tutorials/qmlapp - tutorials/qmlsqlintegration - Removing 'scrolling' example - Fixing some flake8 warnings Change-Id: I649248c0149876bf2bf94e78e27cef7110f42f1d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Keith Kyzivat <keith.kyzivat@qt.io>
Diffstat (limited to 'examples/declarative/scrolling')
-rw-r--r--examples/declarative/scrolling/doc/scrolling.pngbin79 -> 0 bytes
-rw-r--r--examples/declarative/scrolling/doc/scrolling.rst9
-rw-r--r--examples/declarative/scrolling/scrolling.py70
-rw-r--r--examples/declarative/scrolling/scrolling.pyproject3
4 files changed, 0 insertions, 82 deletions
diff --git a/examples/declarative/scrolling/doc/scrolling.png b/examples/declarative/scrolling/doc/scrolling.png
deleted file mode 100644
index 6058c5930..000000000
--- a/examples/declarative/scrolling/doc/scrolling.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/scrolling/doc/scrolling.rst b/examples/declarative/scrolling/doc/scrolling.rst
deleted file mode 100644
index a16e39df7..000000000
--- a/examples/declarative/scrolling/doc/scrolling.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-Scrolling Example
-=================
-
-A Python application that demonstrates how to use a qml view
-and make it scrollable.
-
-.. image:: scrolling.png
- :width: 400
- :alt: Scrolling Screenshot
diff --git a/examples/declarative/scrolling/scrolling.py b/examples/declarative/scrolling/scrolling.py
deleted file mode 100644
index c585cc962..000000000
--- a/examples/declarative/scrolling/scrolling.py
+++ /dev/null
@@ -1,70 +0,0 @@
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: http://www.qt.io/licensing/
-##
-## This file is part of the Qt for Python examples of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:BSD$
-## You may use this file under the terms of the BSD license as follows:
-##
-## "Redistribution and use in source and binary forms, with or without
-## modification, are permitted provided that the following conditions are
-## met:
-## * Redistributions of source code must retain the above copyright
-## notice, this list of conditions and the following disclaimer.
-## * Redistributions in binary form must reproduce the above copyright
-## notice, this list of conditions and the following disclaimer in
-## the documentation and/or other materials provided with the
-## distribution.
-## * Neither the name of The Qt Company Ltd nor the names of its
-## contributors may be used to endorse or promote products derived
-## from this software without specific prior written permission.
-##
-##
-## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-from pathlib import Path
-import sys
-from PySide6.QtCore import QUrl
-from PySide6.QtGui import QGuiApplication
-from PySide6.QtQuick import QQuickView
-
-# This example uses a QML file to show a scrolling list containing
-# all the items listed in dataList.
-
-if __name__ == '__main__':
- dataList = ["Item 1", "Item 2", "Item 3", "Item 4"]
-
- app = QGuiApplication(sys.argv)
- view = QQuickView()
-
- ctxt = view.rootContext()
- ctxt.setContextProperty("myModel", dataList)
-
- qml_file = os.fspath(Path(__file__).resolve().parents[1] / 'usingmodel' / 'view.qml')
- view.setSource(QUrl.fromLocalFile(qml_file))
- if view.status() == QQuickView.Error:
- sys.exit(-1)
- view.show()
-
- 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
diff --git a/examples/declarative/scrolling/scrolling.pyproject b/examples/declarative/scrolling/scrolling.pyproject
deleted file mode 100644
index 105c321ca..000000000
--- a/examples/declarative/scrolling/scrolling.pyproject
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "files": ["scrolling.py"]
-}