aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-11-20 13:11:57 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-11-20 21:39:15 +0000
commit0f825a5fe26693da26707d9ac99af48d0602079b (patch)
tree952b29116213783b929c67b88f869ad3052fbe7d
parent43ea9d456c5215078309300740873b5d7722645f (diff)
Scene Graph Painted Item Example: Prototypically enable QML debugging6.5
Task-number: PYSIDE-2206 Change-Id: I8112a1bd5c6020373d11a70a0043ccd1273735de Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9f33028bfaa45a36a50738e6b8b8f8014f5fbfd9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit d650a09764defb1cf206827485e0be24b34c6075)
-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)