aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/tools
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-03-18 13:23:58 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-03-18 14:18:52 +0100
commit26d14c3fc67ca95aa232f2cc7d7bed490c4cf01a (patch)
tree69c1dbdfa0113bc776ec7e2ab507fd0a893125e2 /sources/pyside6/doc/tools
parent9637106a3e1892eaeb5f1d9f48b79729ece8f01a (diff)
doc: add page for pyside6-metaobjectdump
Change-Id: I3a45fe6cd80deb522f0b5da95027e74c582291f7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/doc/tools')
-rw-r--r--sources/pyside6/doc/tools/pyside-metaobjectdump.rst92
1 files changed, 92 insertions, 0 deletions
diff --git a/sources/pyside6/doc/tools/pyside-metaobjectdump.rst b/sources/pyside6/doc/tools/pyside-metaobjectdump.rst
new file mode 100644
index 000000000..1522b7ad5
--- /dev/null
+++ b/sources/pyside6/doc/tools/pyside-metaobjectdump.rst
@@ -0,0 +1,92 @@
+.. _pyside6-metaobjectdump:
+
+pyside6-metaobjectdump
+======================
+
+``pyside6-metaobjectdump`` is a command line tool. It scans Python source
+files and dumps out information on classes to be registered with QML in
+JSON-format. This serves as input for the :ref:`pyside6-qmltyperegistrar` tool.
+
+The tool is the equivalent of the `moc`_ tool in Qt / C++.
+
+It is automatically run by the :ref:`pyside6-project` tool
+when passing the ``qmllint`` argument instructing it to check
+the QML source files.
+
+Usage
+-----
+
+Classes to be registered with QML are indicated by QML decorators
+like :deco:`QmlElement`. Invoking:
+
+.. code-block:: bash
+
+ pyside6-metaobjectdump birthdayparty.py
+
+produces the JSON data on stdout:
+
+.. code-block:: json
+
+ [
+ {
+ "classes": [
+ {
+ "className": "BirthdayParty",
+ "qualifiedClassName": "BirthdayParty",
+ "object": true,
+ "superClasses": [
+ {
+ "access": "public",
+ "name": "QObject"
+ }
+ ],
+ "classInfos": [
+ {
+ "name": "QML.Element",
+ "value": "auto"
+ }
+ ],
+ "properties": [
+ {
+ "name": "host",
+ "type": "Person",
+ "index": 0,
+ "read": "host",
+ "notify": "host_changed",
+ "write": "host"
+ },
+ {
+ "name": "guests",
+ "type": "QQmlListProperty<Person>",
+ "index": 1
+ }
+ ],
+ "signals": [
+ {
+ "access": "public",
+ "name": "host_changed",
+ "arguments": [],
+ "returnType": "void"
+ },
+ {
+ "access": "public",
+ "name": "guests_changed",
+ "arguments": [],
+ "returnType": "void"
+ }
+ ]
+ }
+ ],
+ "outputRevision": 68,
+ "QML_IMPORT_NAME": "People",
+ "QML_IMPORT_MAJOR_VERSION": 1,
+ "QML_IMPORT_MINOR_VERSION": 0,
+ "QT_MODULES": [
+ "QtCore",
+ "QtQml"
+ ],
+ "inputFile": ".../examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/birthdayparty.py"
+ }
+ ]
+
+.. _`moc`: https://doc.qt.io/qt-6/moc.html