aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtQml/typesystem_qml.xml
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/PySide6/QtQml/typesystem_qml.xml')
-rw-r--r--sources/pyside6/PySide6/QtQml/typesystem_qml.xml182
1 files changed, 117 insertions, 65 deletions
diff --git a/sources/pyside6/PySide6/QtQml/typesystem_qml.xml b/sources/pyside6/PySide6/QtQml/typesystem_qml.xml
index 1b855a073..6a739bbdf 100644
--- a/sources/pyside6/PySide6/QtQml/typesystem_qml.xml
+++ b/sources/pyside6/PySide6/QtQml/typesystem_qml.xml
@@ -1,66 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt for Python.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.QtQml">
+<typesystem package="PySide6.QtQml"
+ namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
<load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/>
+ <rejection class="QQmlPrivate"/>
+
<inject-code class="target" position="declaration">
// Volatile Bool Ptr type definition for QQmlIncubationController::incubateWhile(std::atomic&lt;bool&gt; *, int)
#include &lt;atomic&gt;
using AtomicBool = std::atomic&lt;bool&gt;;
- typedef struct {
+ struct QtQml_VolatileBoolObject {
PyObject_HEAD
AtomicBool *flag;
- } QtQml_VolatileBoolObject;
+ };
</inject-code>
<inject-code class="native" position="beginning">
- #include "pysideqmlregistertype.h"
+ #include &lt;pysideqml.h&gt;
+ #include &lt;pysideqmlregistertype.h&gt;
+ #include &lt;pysideqmlattached.h&gt;
+ #include "pysideqmlvolatilebool.h"
</inject-code>
<!-- This is to inform the generator that the VolatileBool python type exists -->
- <custom-type name="VolatileBool"/>
+ <custom-type name="VolatileBool" check-function="VolatileBool_Check"/>
<primitive-type name="bool volatile" target-lang-api-name="VolatileBool">
<!-- No conversion rules are specified here, because the generator does not handle
pointer to primitive types without function adjustment.
@@ -68,44 +38,79 @@
in generator tests folder. -->
</primitive-type>
- <enum-type name="QQmlModuleImportSpecialVersions" since="6.0"/>
+ <enum-type name="QQmlModuleImportSpecialVersions" doc-file="qqmlengine"/>
<!-- expose QQmlIncubationController::incubateWhile() (see
- QtQml_VolatileBoolTypeF/pysideqmlregistertype.h) -->
+ QtQml_VolatileBoolTypeF/pysideqmlvolatilebool.h) -->
<namespace-type name="std" generate="no">
<value-type name="atomic" generate="no"/>
</namespace-type>
- <add-function signature="qmlRegisterType(PyTypeObject,const char*,int,int,const char*)" return-type="int">
+ <add-function signature="qmlAttachedPropertiesObject(PyTypeObject*@type_obj@,QObject*,bool=true)"
+ return-type="QObject*">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlattachedpropertiesobject"/>
+ </add-function>
+
+ <add-function signature="qmlRegisterType(PyTypeObject@type_obj@,const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@)" return-type="int">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistertype"/>
+ <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ snippet="qmlregistertype"/>
+ <modify-argument index="2" pyi-type="str"/>
</add-function>
- <add-function signature="qmlRegisterSingletonType(PyTypeObject,const char*,int,int,const char*,PyObject*)" return-type="int">
+ <add-function signature="qmlRegisterSingletonType(PyTypeObject@type_obj@,const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@,PyObject*@callback@)" return-type="int">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qobject_callback"/>
+ <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ snippet="qmlregistersingletontype_qobject_callback"/>
+ <modify-argument index="2" pyi-type="str"/>
</add-function>
- <add-function signature="qmlRegisterSingletonType(PyTypeObject,const char*,int,int,const char*)" return-type="int">
+ <add-function signature="qmlRegisterSingletonType(PyTypeObject@type_obj@,const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@)" return-type="int">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qobject_nocallback"/>
+ <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ snippet="qmlregistersingletontype_qobject_nocallback"/>
+ <modify-argument index="2" pyi-type="str"/>
</add-function>
- <add-function signature="qmlRegisterSingletonType(const char*,int,int,const char*,PyObject*)" return-type="int">
+ <add-function signature="qmlRegisterSingletonType(const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@,PyObject*@callback@)" return-type="int">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qjsvalue"/>
+ <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ snippet="qmlregistersingletontype_qjsvalue"/>
+ <modify-argument index="1" pyi-type="str"/>
+ </add-function>
+
+ <add-function signature="qmlRegisterSingletonInstance(PyTypeObject@type_obj@,const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@,PyObject*@callback@)" return-type="int">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletoninstance"/>
+ <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ snippet="qmlregistersingletoninstance"/>
+ <modify-argument index="2" pyi-type="str"/>
</add-function>
- <add-function signature="qmlRegisterUncreatableType(PyTypeObject,const char*,int,int,const char*,const char*)" return-type="int">
+ <add-function signature="qmlRegisterUncreatableType(PyTypeObject@type_obj@,const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@,const char*@message@)" return-type="int">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregisteruncreatabletype"/>
+ <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ snippet="qmlregisteruncreatabletype"/>
+ <modify-argument index="2" pyi-type="str"/>
</add-function>
<add-function signature="QmlElement(PyObject*)" return-type="PyObject*">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlelement"/>
</add-function>
+ <add-function signature="QmlAnonymous(PyObject*)" return-type="PyObject*">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlanonymous"/>
+ </add-function>
+
+ <add-function signature="QmlSingleton(PyObject*)" return-type="PyObject*">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlsingleton"/>
+ </add-function>
+
<function signature="qjsEngine(const QObject*)">
<modify-function>
<modify-argument index="return" pyi-type="Optional[PySide6.QtQml.QJSEngine]"/>
</modify-function>
</function>
- <function signature="qmlClearTypeRegistrations()"/>
+ <function signature="qmlClearTypeRegistrations()" doc-file="qqmlengine"/>
<function signature="qmlContext(const QObject*)">
<modify-function>
<modify-argument index="return" pyi-type="Optional[PySide6.QtQml.QQmlContext]"/>
@@ -116,9 +121,11 @@
<modify-argument index="return" pyi-type="Optional[PySide6.QtQml.QQmlEngine]"/>
</modify-function>
</function>
- <function signature="qmlProtectModule(const char*,int)"/>
- <function signature="qmlRegisterModule(const char*,int,int)"/>
- <function signature="qmlTypeId(const char*,int,int,const char*)"/>
+ <function signature="qmlProtectModule(const char*,int)" doc-file="qqmlengine"/>
+ <function signature="qmlRegisterModule(const char*,int,int)" doc-file="qqmlengine"/>
+ <function signature="qmlTypeId(const char*,int,int,const char*)" doc-file="qqmlengine"/>
+ <function signature="qmlRegisterType(const QUrl &amp;,const char *,int,int,const char *)"/>
+ <function signature="qmlRegisterSingletonType(const QUrl &amp;,const char *,int,int,const char *)"/>
<function signature="qmlRegisterUncreatableMetaObject(const QMetaObject&amp;,const char*,int,int, const char*,const QString&amp;)"/>
<enum-type identified-by-value="QML_HAS_ATTACHED_PROPERTIES">
@@ -130,8 +137,8 @@
<inject-code class="target" position="end" file="../glue/qtqml.cpp" snippet="init"/>
<object-type name="QJSEngine">
- <enum-type name="Extension" flags="Extensions" since="5.6"/>
- <enum-type name="ObjectOwnership" since="6.0"/>
+ <enum-type name="Extension" flags="Extensions"/>
+ <enum-type name="ObjectOwnership"/>
<add-function signature="toScriptValue(const QVariant&amp;)" return-type="QJSValue">
<inject-code class="target" position="end" file="../glue/qtqml.cpp" snippet="qjsengine-toscriptvalue"/>
</add-function>
@@ -143,7 +150,7 @@
<enum-type name="Type"/>
</value-type>
<value-type name="QJSValue">
- <enum-type name="ErrorType" since="5.12"/>
+ <enum-type name="ErrorType"/>
<enum-type name="SpecialValue"/>
<enum-type name="ObjectConversionBehavior" since="6.1"/>
</value-type>
@@ -152,10 +159,18 @@
<enum-type name="DataType"/>
</object-type>
<object-type name="QQmlApplicationEngine">
- <modify-function signature="load(const QString &amp;)">
+ <!-- PYSIDE-1681: QQmlApplicationEngine constructor, load() and similar need
+ allow-thread in case there is a message handler installed
+ (qInstallMessageHandler) -->
+ <modify-function signature="^QQmlApplicationEngine\(.*\)$" allow-thread="yes"/>
+ <!-- PYSIDE-1736 In the presence of load(QString)/load(QUrl), check for Path/string
+ first to avoid an implicit conversion from string to QUrl. -->
+ <modify-function signature="load(const QString &amp;)" allow-thread="yes" overload-number="1">
<modify-argument index="1"><replace-type modified-type="PyPathLike"/></modify-argument>
<inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qfile-path-1"/>
</modify-function>
+ <modify-function signature="load(const QUrl &amp;)" allow-thread="yes" overload-number="2"/>
+ <modify-function signature="loadFromModule(QAnyStringView,QAnyStringView)" allow-thread="yes"/>
</object-type>
<object-type name="QQmlComponent">
<enum-type name="CompilationMode"/>
@@ -166,9 +181,19 @@
<modify-function signature="QQmlComponent(QQmlEngine*,QString,QQmlComponent::CompilationMode,QObject*)" allow-thread="yes"/>
<modify-function signature="QQmlComponent(QQmlEngine*,QUrl,QObject*)" allow-thread="yes"/>
<modify-function signature="QQmlComponent(QQmlEngine*,QUrl,QQmlComponent::CompilationMode,QObject*)" allow-thread="yes"/>
+ <modify-function signature="loadFromModule(QAnyStringView,QAnyStringView,QQmlComponent::CompilationMode)" allow-thread="yes"/>
+ <modify-function signature="loadUrl(QUrl)" allow-thread="yes"/>
+ <modify-function signature="loadUrl(QUrl,QQmlComponent::CompilationMode)" allow-thread="yes"/>
+ <modify-function signature="setData(QByteArray,QUrl)" allow-thread="yes"/>
+ </object-type>
+ <object-type name="QQmlContext">
+ <value-type name="PropertyPair"/>
</object-type>
- <object-type name="QQmlContext"/>
- <value-type name="QQmlError"/>
+ <value-type name="QQmlError">
+ <add-function signature="__repr__" return-type="PyObject*">
+ <inject-code class="target" position="beginning" file="../glue/qtqml.cpp" snippet="qmlerrror-repr"/>
+ </add-function>
+ </value-type>
<object-type name="QQmlDebuggingEnabler">
<enum-type name="StartMode"/>
</object-type>
@@ -187,6 +212,30 @@
<modify-argument index="1"><replace-type modified-type="PyPathLike"/></modify-argument>
<inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qfile-path-1"/>
</modify-function>
+ <add-function signature="singletonInstance(int@qmlTypeId@)"
+ return-type="QObject*">
+ <!-- Suppress return value heuristics -->
+ <modify-argument index="return"
+ pyi-type="Union[PySide6.QtCore.QObject, PySide6.QtQml.QJSValue, None]">
+ <define-ownership class="target" owner="default"/>
+ </modify-argument>
+ <inject-code class="target" file="../glue/qtqml.cpp"
+ snippet="qqmlengine-singletoninstance-qmltypeid"/>
+ <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ snippet="qqmlengine-singletoninstance-qmltypeid"/>
+ </add-function>
+ <add-function signature="singletonInstance(QString@uri@,QString@typeName@)"
+ return-type="QObject*">
+ <!-- Suppress return value heuristics -->
+ <modify-argument index="return"
+ pyi-type="Union[PySide6.QtCore.QObject, PySide6.QtQml.QJSValue, None]">
+ <define-ownership class="target" owner="default"/>
+ </modify-argument>
+ <inject-code class="target" file="../glue/qtqml.cpp"
+ snippet="qqmlengine-singletoninstance-typename"/>
+ <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ snippet="qqmlengine-singletoninstance-typename"/>
+ </add-function>
</object-type>
<object-type name="QQmlExpression">
@@ -194,7 +243,7 @@
<modify-argument index="1">
<remove-argument />
</modify-argument>
- <modify-argument index="return">
+ <modify-argument index="return" pyi-type="Tuple[Any, bool]">
<replace-type modified-type="PyTuple"/>
</modify-argument>
<inject-code class="target" position="beginning">
@@ -220,7 +269,7 @@
</object-type>
<object-type name="QQmlIncubationController">
<extra-includes>
- <include file-name="pysideqmlregistertype.h" location="local"/>
+ <include file-name="pysideqmlvolatilebool.h" location="local"/>
</extra-includes>
<modify-function signature="incubateWhile(std::atomic&lt;bool&gt;*,int)" allow-thread="yes">
<modify-argument index="1">
@@ -242,19 +291,21 @@
for the QML parts.
<value-type name="QQmlListProperty"/>-->
<value-type name="QQmlListReference"/>
- <interface-type name="QQmlParserStatus"/>
+ <object-type name="QQmlParserStatus"/>
+ <object-type name="QPyQmlParserStatus"/>
<value-type name="QQmlProperty">
<enum-type name="PropertyTypeCategory"/>
<enum-type name="Type"/>
</value-type>
<object-type name="QQmlPropertyMap"/>
<object-type name="QQmlPropertyValueSource"/>
+ <object-type name="QPyQmlPropertyValueSource"/>
<value-type name="QQmlScriptString">
<modify-function signature="numberLiteral(bool*)const" allow-thread="yes">
<modify-argument index="1">
<remove-argument />
</modify-argument>
- <modify-argument index="return">
+ <modify-argument index="return" pyi-type="Tuple[float, bool]">
<replace-type modified-type="PyTuple"/>
</modify-argument>
<inject-code class="target" position="beginning">
@@ -265,7 +316,7 @@
<modify-argument index="1">
<remove-argument />
</modify-argument>
- <modify-argument index="return">
+ <modify-argument index="return" pyi-type="Tuple[bool, bool]">
<replace-type modified-type="PyTuple"/>
</modify-argument>
<inject-code class="target" position="beginning">
@@ -282,4 +333,5 @@
</object-type>
<!-- Suppress anonymous enum warning -->
<suppress-warning text="Anonymous enum (QmlCurrentSingletonTypeRegistrationVersion) does not have a type entry"/>
+ <suppress-warning text="Enum 'QQmlModuleImportSpecialVersions' does not have a type entry"/>
</typesystem>