aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-11-20 13:11:57 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-11-20 14:21:12 +0100
commit9f33028bfaa45a36a50738e6b8b8f8014f5fbfd9 (patch)
treef4a5bbf73ae49fbd5b0a42fd0d9d3e15fa28d7b6 /examples/quick
parent2673c5b6ce1b766aab87d6c93cec95056bf34d43 (diff)
Scene Graph Painted Item Example: Prototypically enable QML debugging
Task-number: PYSIDE-2206 Pick-to: 6.6 6.5 Change-Id: I8112a1bd5c6020373d11a70a0043ccd1273735de Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/painteditem/painteditem.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/quick/painteditem/painteditem.py b/examples/quick/painteditem/painteditem.py
index 180e22943..cf5a05ada 100644
--- a/examples/quick/painteditem/painteditem.py
+++ b/examples/quick/painteditem/painteditem.py
@@ -1,12 +1,13 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from argparse import ArgumentParser, RawTextHelpFormatter
from pathlib import Path
import sys
from PySide6.QtGui import QPainter, QBrush, QColor
from PySide6.QtWidgets import QApplication
-from PySide6.QtQml import QmlElement
+from PySide6.QtQml import QmlElement, QQmlDebuggingEnabler
from PySide6.QtCore import QUrl, Property, Signal, Qt, QPointF
from PySide6.QtQuick import QQuickPaintedItem, QQuickView
@@ -62,6 +63,13 @@ class TextBalloon(QQuickPaintedItem):
if __name__ == "__main__":
+ argument_parser = ArgumentParser(description="Scene Graph Painted Item Example",
+ formatter_class=RawTextHelpFormatter)
+ argument_parser.add_argument("-qmljsdebugger", action="store",
+ help="Enable QML debugging")
+ options = argument_parser.parse_args()
+ if options.qmljsdebugger:
+ QQmlDebuggingEnabler.enableDebugging(True)
app = QApplication(sys.argv)
view = QQuickView()
view.setResizeMode(QQuickView.SizeRootObjectToView)