aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/PySide2/QtQml/typesystem_qml.xml')
-rw-r--r--sources/pyside2/PySide2/QtQml/typesystem_qml.xml58
1 files changed, 32 insertions, 26 deletions
diff --git a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
index 0a12d44cf..b2def633f 100644
--- a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
+++ b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
@@ -45,11 +45,14 @@
<load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
<inject-code class="target" position="declaration">
- // Volatile Bool Ptr type definition.
+ // 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 {
PyObject_HEAD
- volatile bool flag;
+ AtomicBool *flag;
} QtQml_VolatileBoolObject;
</inject-code>
@@ -66,32 +69,35 @@
in generator tests folder. -->
</primitive-type>
+ <enum-type name="QQmlModuleImportSpecialVersions" since="6.0"/>
+
<!-- For qmlEngine(const QObject*), qmlContext(const QObject*) in qqml.h -->
<namespace-type name="QtQml"/>
- <add-function signature="qmlRegisterType(PyTypeObject,const char*,int,int,const char*)" return-type="int">
- <inject-documentation format="target" mode="append">
- This function registers the Python type in the QML system with the name qmlName, in the library imported from uri having the version number composed from versionMajor and versionMinor.
- Returns the QML type id.
-
- For example, this registers a Python class MySliderItem as a QML type named Slider for version 1.0 of a module called "com.mycompany.qmlcomponents":
-
- ::
-
- qmlRegisterType(MySliderItem, "com.mycompany.qmlcomponents", 1, 0, "Slider")
-
- Once this is registered, the type can be used in QML by importing the specified module name and version number:
+ <!-- expose QQmlIncubationController::incubateWhile() (see
+ QtQml_VolatileBoolTypeF/pysideqmlregistertype.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">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistertype"/>
+ </add-function>
- import com.mycompany.qmlcomponents 1.0
+ <add-function signature="qmlRegisterSingletonType(PyTypeObject,const char*,int,int,const char*,PyObject*)" return-type="int">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qobject_callback"/>
+ </add-function>
- Slider { ... }
+ <add-function signature="qmlRegisterSingletonType(PyTypeObject,const char*,int,int,const char*)" return-type="int">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qobject_nocallback"/>
+ </add-function>
- Note that it's perfectly reasonable for a library to register types to older versions than the actual version of the library. Indeed, it is normal for the new library to allow QML written to previous versions to continue to work, even if more advanced versions of some of its types are available.
- </inject-documentation>
+ <add-function signature="qmlRegisterSingletonType(const char*,int,int,const char*,PyObject*)" return-type="int">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qjsvalue"/>
+ </add-function>
- <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistertype"/>
+ <add-function signature="qmlRegisterUncreatableType(PyTypeObject,const char*,int,int,const char*,const char*)" return-type="int">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregisteruncreatabletype"/>
</add-function>
<enum-type identified-by-value="QML_HAS_ATTACHED_PROPERTIES">
@@ -104,6 +110,7 @@
<object-type name="QJSEngine">
<enum-type name="Extension" flags="Extensions" since="5.6"/>
+ <enum-type name="ObjectOwnership" since="6.0"/>
<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>
@@ -133,7 +140,6 @@
<enum-type name="StartMode"/>
</object-type>
<object-type name="QQmlEngine">
- <enum-type name="ObjectOwnership"/>
<modify-function signature="addImageProvider(const QString&amp;,QQmlImageProviderBase*)">
<modify-argument index="2">
<define-ownership owner="c++"/>
@@ -173,14 +179,14 @@
<extra-includes>
<include file-name="pysideqmlregistertype.h" location="local"/>
</extra-includes>
- <modify-function signature="incubateWhile(volatile bool*,int)" allow-thread="yes">
+ <modify-function signature="incubateWhile(std::atomic&lt;bool&gt;*,int)" allow-thread="yes">
<modify-argument index="1">
- <!-- The replace type is needed to use the VolatileBool_Check macro instead of
- a template conversion function with "volatile bool" as argument. -->
+ The replace type is needed to use the VolatileBool_Check macro instead of
+ a template conversion function with "volatile bool" as argument.
<replace-type modified-type="VolatileBool"/>
<conversion-rule class="native">
- volatile bool * %out =
- &amp;((reinterpret_cast&lt;QtQml_VolatileBoolObject *&gt;(%PYARG_1))->flag);
+ auto volatileBool = reinterpret_cast&lt;QtQml_VolatileBoolObject *&gt;(%PYARG_1);
+ std::atomic&lt;bool&gt; *%out = volatileBool->flag;
</conversion-rule>
</modify-argument>
</modify-function>