aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/QtQml
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/PySide2/QtQml')
-rw-r--r--sources/pyside2/PySide2/QtQml/CMakeLists.txt63
-rw-r--r--sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp506
-rw-r--r--sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h85
-rw-r--r--sources/pyside2/PySide2/QtQml/typesystem_qml.xml216
4 files changed, 0 insertions, 870 deletions
diff --git a/sources/pyside2/PySide2/QtQml/CMakeLists.txt b/sources/pyside2/PySide2/QtQml/CMakeLists.txt
deleted file mode 100644
index 3c5dd43fc..000000000
--- a/sources/pyside2/PySide2/QtQml/CMakeLists.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-project(QtQml)
-
-set(QtQml_registerType "${QtQml_SOURCE_DIR}/pysideqmlregistertype.cpp")
-
-set(QtQml_SRC
-${QtQml_GEN_DIR}/qjsengine_wrapper.cpp
-${QtQml_GEN_DIR}/qjsvalue_wrapper.cpp
-${QtQml_GEN_DIR}/qjsvalueiterator_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlabstracturlinterceptor_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlapplicationengine_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlcomponent_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlcontext_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlerror_wrapper.cpp
-${QtQml_GEN_DIR}/qqmldebuggingenabler_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlengine_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlexpression_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlextensioninterface_wrapper.cpp
-${QtQml_GEN_DIR}/qqmltypesextensioninterface_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlextensionplugin_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlfile_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlfileselector_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlimageproviderbase_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlincubator_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlincubationcontroller_wrapper.cpp
-#${QtQml_GEN_DIR}/qqmllistproperty_wrapper.cpp
-${QtQml_GEN_DIR}/qqmllistreference_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlparserstatus_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlproperty_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlpropertymap_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlpropertyvaluesource_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlscriptstring_wrapper.cpp
-${QtQml_GEN_DIR}/qqmlnetworkaccessmanagerfactory_wrapper.cpp
-${QtQml_GEN_DIR}/qtqml_wrapper.cpp
-# module is always needed
-${QtQml_GEN_DIR}/qtqml_module_wrapper.cpp
-)
-
-set(QtQml_include_dirs ${QtQml_SOURCE_DIR}
- ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}Network_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}Qml_INCLUDE_DIRS}
- ${libpyside_SOURCE_DIR}
- ${QtGui_GEN_DIR}
- ${QtCore_GEN_DIR}
- ${QtNetwork_GEN_DIR}
- ${QtQml_GEN_DIR})
-
-set(QtQml_libraries pyside2
- ${Qt${QT_MAJOR_VERSION}Core_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Gui_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Network_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Qml_LIBRARIES})
-
-set(QtQml_deps QtGui QtNetwork)
-
-create_pyside_module(NAME QtQml
- INCLUDE_DIRS QtQml_include_dirs
- LIBRARIES QtQml_libraries
- DEPS QtQml_deps
- TYPESYSTEM_PATH QtQml_SOURCE_DIR
- SOURCES QtQml_SRC
- STATIC_SOURCES QtQml_registerType)
diff --git a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp
deleted file mode 100644
index efc86a048..000000000
--- a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp
+++ /dev/null
@@ -1,506 +0,0 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
-
-#include "pysideqmlregistertype.h"
-
-// shiboken
-#include <shiboken.h>
-#include <signature.h>
-
-// pyside
-#include <pyside.h>
-#include <pyside_p.h>
-#include <pysideproperty.h>
-
-// auto generated headers
-#include "pyside2_qtcore_python.h"
-#include "pyside2_qtqml_python.h"
-
-#ifndef PYSIDE_MAX_QML_TYPES
-// Maximum number of different Qt QML types the user can export to QML using
-// qmlRegisterType. This limit exists because the QML engine instantiates objects
-// by calling a function with one argument (a void *pointer where the object should
-// be created), and thus does not allow us to choose which object to create. Thus
-// we create a C++ factory function for each new registered type at compile time.
-#define PYSIDE_MAX_QML_TYPES 50
-#endif
-
-// Forward declarations.
-static void propListMetaCall(PySideProperty *pp, PyObject *self, QMetaObject::Call call,
- void **args);
-
-// All registered python types and their creation functions.
-static PyObject *pyTypes[PYSIDE_MAX_QML_TYPES];
-static void (*createFuncs[PYSIDE_MAX_QML_TYPES])(void *);
-
-// Mutex used to avoid race condition on PySide::nextQObjectMemoryAddr.
-static QMutex nextQmlElementMutex;
-
-template<int N>
-struct ElementFactoryBase
-{
- static void createInto(void *memory)
- {
- QMutexLocker locker(&nextQmlElementMutex);
- PySide::setNextQObjectMemoryAddr(memory);
- Shiboken::GilState state;
- PyObject *obj = PyObject_CallObject(pyTypes[N], 0);
- if (!obj || PyErr_Occurred())
- PyErr_Print();
- PySide::setNextQObjectMemoryAddr(0);
- }
-};
-
-template<int N>
-struct ElementFactory : ElementFactoryBase<N>
-{
- static void init()
- {
- createFuncs[N] = &ElementFactoryBase<N>::createInto;
- ElementFactory<N-1>::init();
- }
-};
-
-template<>
-struct ElementFactory<0> : ElementFactoryBase<0>
-{
- static void init()
- {
- createFuncs[0] = &ElementFactoryBase<0>::createInto;
- }
-};
-
-int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor,
- int versionMinor, const char *qmlName)
-{
- using namespace Shiboken;
-
- static PyTypeObject *qobjectType = Shiboken::Conversions::getPythonTypeObject("QObject*");
- assert(qobjectType);
- static int nextType = 0;
-
- if (nextType >= PYSIDE_MAX_QML_TYPES) {
- PyErr_Format(PyExc_TypeError, "You can only export %d custom QML types to QML.",
- PYSIDE_MAX_QML_TYPES);
- return -1;
- }
-
- PyTypeObject *pyObjType = reinterpret_cast<PyTypeObject *>(pyObj);
- if (!PySequence_Contains(pyObjType->tp_mro, reinterpret_cast<PyObject *>(qobjectType))) {
- PyErr_Format(PyExc_TypeError, "A type inherited from %s expected, got %s.",
- qobjectType->tp_name, pyObjType->tp_name);
- return -1;
- }
-
- const QMetaObject *metaObject = PySide::retrieveMetaObject(pyObjType);
- Q_ASSERT(metaObject);
-
- QQmlPrivate::RegisterType type;
- type.version = 0;
-
- // Allow registering Qt Quick items.
- bool registered = false;
-#ifdef PYSIDE_QML_SUPPORT
- QuickRegisterItemFunction quickRegisterItemFunction = getQuickRegisterItemFunction();
- if (quickRegisterItemFunction) {
- registered = quickRegisterItemFunction(pyObj, uri, versionMajor, versionMinor,
- qmlName, &type);
- }
-#endif
-
- // Register as simple QObject rather than Qt Quick item.
- if (!registered) {
- // Incref the type object, don't worry about decref'ing it because
- // there's no way to unregister a QML type.
- Py_INCREF(pyObj);
-
- pyTypes[nextType] = pyObj;
-
- // FIXME: Fix this to assign new type ids each time.
- type.typeId = qMetaTypeId<QObject *>();
- type.listId = qMetaTypeId<QQmlListProperty<QObject> >();
- type.attachedPropertiesFunction = QQmlPrivate::attachedPropertiesFunc<QObject>();
- type.attachedPropertiesMetaObject = QQmlPrivate::attachedPropertiesMetaObject<QObject>();
-
- type.parserStatusCast =
- QQmlPrivate::StaticCastSelector<QObject, QQmlParserStatus>::cast();
- type.valueSourceCast =
- QQmlPrivate::StaticCastSelector<QObject, QQmlPropertyValueSource>::cast();
- type.valueInterceptorCast =
- QQmlPrivate::StaticCastSelector<QObject, QQmlPropertyValueInterceptor>::cast();
-
- int objectSize = static_cast<int>(PySide::getSizeOfQObject(
- reinterpret_cast<SbkObjectType *>(pyObj)));
- type.objectSize = objectSize;
- type.create = createFuncs[nextType];
- type.uri = uri;
- type.versionMajor = versionMajor;
- type.versionMinor = versionMinor;
- type.elementName = qmlName;
-
- type.extensionObjectCreate = 0;
- type.extensionMetaObject = 0;
- type.customParser = 0;
- ++nextType;
- }
- type.metaObject = metaObject; // Snapshot may have changed.
-
- int qmlTypeId = QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type);
- if (qmlTypeId == -1) {
- PyErr_Format(PyExc_TypeError, "QML meta type registration of \"%s\" failed.",
- qmlName);
- }
- return qmlTypeId;
-}
-
-extern "C"
-{
-
-// This is the user data we store in the property.
-struct QmlListProperty
-{
- PyTypeObject *type;
- PyObject *append;
- PyObject *at;
- PyObject *clear;
- PyObject *count;
-};
-
-static int propListTpInit(PyObject *self, PyObject *args, PyObject *kwds)
-{
- static const char *kwlist[] = {"type", "append", "at", "clear", "count", 0};
- PySideProperty *pySelf = reinterpret_cast<PySideProperty *>(self);
- QmlListProperty *data = new QmlListProperty;
- memset(data, 0, sizeof(QmlListProperty));
-
- if (!PyArg_ParseTupleAndKeywords(args, kwds,
- "OO|OOO:QtQml.ListProperty", (char **) kwlist,
- &data->type,
- &data->append,
- &data->at,
- &data->clear,
- &data->count)) {
- return -1;
- }
- PySide::Property::setMetaCallHandler(pySelf, &propListMetaCall);
- PySide::Property::setTypeName(pySelf, "QQmlListProperty<QObject>");
- PySide::Property::setUserData(pySelf, data);
-
- return 0;
-}
-
-void propListTpFree(void *self)
-{
- auto pySelf = reinterpret_cast<PySideProperty *>(self);
- delete reinterpret_cast<QmlListProperty *>(PySide::Property::userData(pySelf));
- // calls base type constructor
- Py_TYPE(pySelf)->tp_base->tp_free(self);
-}
-
-static PyType_Slot PropertyListType_slots[] = {
- {Py_tp_init, (void *)propListTpInit},
- {Py_tp_free, (void *)propListTpFree},
- {Py_tp_dealloc, (void *)Sbk_object_dealloc},
- {0, 0}
-};
-static PyType_Spec PropertyListType_spec = {
- "2:PySide2.QtQml.ListProperty",
- sizeof(PySideProperty),
- 0,
- Py_TPFLAGS_DEFAULT,
- PropertyListType_slots,
-};
-
-
-PyTypeObject *PropertyListTypeF(void)
-{
- static PyTypeObject *type = nullptr;
- if (!type) {
- PyObject *bases = Py_BuildValue("(O)", PySidePropertyTypeF());
- type = (PyTypeObject *)SbkType_FromSpecWithBases(&PropertyListType_spec, bases);
- Py_XDECREF(bases);
- }
- return type;
-}
-
-} // extern "C"
-
-// Implementation of QQmlListProperty<T>::AppendFunction callback
-void propListAppender(QQmlListProperty<QObject> *propList, QObject *item)
-{
- Shiboken::GilState state;
-
- Shiboken::AutoDecRef args(PyTuple_New(2));
- PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
- PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], item));
-
- auto data = reinterpret_cast<QmlListProperty *>(propList->data);
- Shiboken::AutoDecRef retVal(PyObject_CallObject(data->append, args));
-
- if (PyErr_Occurred())
- PyErr_Print();
-}
-
-// Implementation of QQmlListProperty<T>::CountFunction callback
-int propListCount(QQmlListProperty<QObject> *propList)
-{
- Shiboken::GilState state;
-
- Shiboken::AutoDecRef args(PyTuple_New(1));
- PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
-
- auto data = reinterpret_cast<QmlListProperty *>(propList->data);
- Shiboken::AutoDecRef retVal(PyObject_CallObject(data->count, args));
-
- // Check return type
- int cppResult = 0;
- PythonToCppFunc pythonToCpp = 0;
- if (PyErr_Occurred())
- PyErr_Print();
- else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<int>(), retVal)))
- pythonToCpp(retVal, &cppResult);
- return cppResult;
-}
-
-// Implementation of QQmlListProperty<T>::AtFunction callback
-QObject *propListAt(QQmlListProperty<QObject> *propList, int index)
-{
- Shiboken::GilState state;
-
- Shiboken::AutoDecRef args(PyTuple_New(2));
- PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
- PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &index));
-
- auto data = reinterpret_cast<QmlListProperty *>(propList->data);
- Shiboken::AutoDecRef retVal(PyObject_CallObject(data->at, args));
-
- QObject *result = 0;
- if (PyErr_Occurred())
- PyErr_Print();
- else if (PyType_IsSubtype(Py_TYPE(retVal), data->type))
- Shiboken::Conversions::pythonToCppPointer((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], retVal, &result);
- return result;
-}
-
-// Implementation of QQmlListProperty<T>::ClearFunction callback
-void propListClear(QQmlListProperty<QObject> * propList)
-{
- Shiboken::GilState state;
-
- Shiboken::AutoDecRef args(PyTuple_New(1));
- PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
-
- auto data = reinterpret_cast<QmlListProperty *>(propList->data);
- Shiboken::AutoDecRef retVal(PyObject_CallObject(data->clear, args));
-
- if (PyErr_Occurred())
- PyErr_Print();
-}
-
-// qt_metacall specialization for ListProperties
-static void propListMetaCall(PySideProperty *pp, PyObject *self, QMetaObject::Call call, void **args)
-{
- if (call != QMetaObject::ReadProperty)
- return;
-
- auto data = reinterpret_cast<QmlListProperty *>(PySide::Property::userData(pp));
- QObject *qobj;
- Shiboken::Conversions::pythonToCppPointer((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], self, &qobj);
- QQmlListProperty<QObject> declProp(qobj, data, &propListAppender, &propListCount, &propListAt, &propListClear);
-
- // Copy the data to the memory location requested by the meta call
- void *v = args[0];
- *reinterpret_cast<QQmlListProperty<QObject> *>(v) = declProp;
-}
-
-// VolatileBool (volatile bool) type definition.
-
-static PyObject *
-QtQml_VolatileBoolObject_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
-{
- static const char *kwlist[] = {"x", 0};
- PyObject *x = Py_False;
- long ok;
-
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:bool", const_cast<char **>(kwlist), &x))
- return Q_NULLPTR;
- ok = PyObject_IsTrue(x);
- if (ok < 0)
- return Q_NULLPTR;
-
- QtQml_VolatileBoolObject *self
- = reinterpret_cast<QtQml_VolatileBoolObject *>(type->tp_alloc(type, 0));
-
- if (self != Q_NULLPTR)
- self->flag = ok;
-
- return reinterpret_cast<PyObject *>(self);
-}
-
-static PyObject *
-QtQml_VolatileBoolObject_get(QtQml_VolatileBoolObject *self)
-{
- if (self->flag)
- return Py_True;
- return Py_False;
-}
-
-static PyObject *
-QtQml_VolatileBoolObject_set(QtQml_VolatileBoolObject *self, PyObject *args)
-{
- PyObject *value = Py_False;
- long ok;
-
- if (!PyArg_ParseTuple(args, "O:bool", &value)) {
- return Q_NULLPTR;
- }
-
- ok = PyObject_IsTrue(value);
- if (ok < 0) {
- PyErr_SetString(PyExc_TypeError, "Not a boolean value.");
- return Q_NULLPTR;
- }
-
- if (ok > 0)
- self->flag = true;
- else
- self->flag = false;
-
- Py_RETURN_NONE;
-}
-
-static PyMethodDef QtQml_VolatileBoolObject_methods[] = {
- {"get", reinterpret_cast<PyCFunction>(QtQml_VolatileBoolObject_get), METH_NOARGS,
- "B.get() -> Bool. Returns the value of the volatile boolean"
- },
- {"set", reinterpret_cast<PyCFunction>(QtQml_VolatileBoolObject_set), METH_VARARGS,
- "B.set(a) -> None. Sets the value of the volatile boolean"
- },
- {Q_NULLPTR} /* Sentinel */
-};
-
-static PyObject *
-QtQml_VolatileBoolObject_repr(QtQml_VolatileBoolObject *self)
-{
- PyObject *s;
-
- if (self->flag)
- s = PyBytes_FromFormat("%s(True)",
- Py_TYPE(self)->tp_name);
- else
- s = PyBytes_FromFormat("%s(False)",
- Py_TYPE(self)->tp_name);
- Py_XINCREF(s);
- return s;
-}
-
-static PyObject *
-QtQml_VolatileBoolObject_str(QtQml_VolatileBoolObject *self)
-{
- PyObject *s;
-
- if (self->flag)
- s = PyBytes_FromFormat("%s(True) -> %p",
- Py_TYPE(self)->tp_name, &(self->flag));
- else
- s = PyBytes_FromFormat("%s(False) -> %p",
- Py_TYPE(self)->tp_name, &(self->flag));
- Py_XINCREF(s);
- return s;
-}
-
-static PyType_Slot QtQml_VolatileBoolType_slots[] = {
- {Py_tp_repr, (void *)reinterpret_cast<reprfunc>(QtQml_VolatileBoolObject_repr)},
- {Py_tp_str, (void *)reinterpret_cast<reprfunc>(QtQml_VolatileBoolObject_str)},
- {Py_tp_methods, (void *)QtQml_VolatileBoolObject_methods},
- {Py_tp_new, (void *)QtQml_VolatileBoolObject_new},
- {Py_tp_dealloc, (void *)Sbk_object_dealloc},
- {0, 0}
-};
-static PyType_Spec QtQml_VolatileBoolType_spec = {
- "2:PySide2.QtQml.VolatileBool",
- sizeof(QtQml_VolatileBoolObject),
- 0,
- Py_TPFLAGS_DEFAULT,
- QtQml_VolatileBoolType_slots,
-};
-
-
-PyTypeObject *QtQml_VolatileBoolTypeF(void)
-{
- static PyTypeObject *type = reinterpret_cast<PyTypeObject *>(
- SbkType_FromSpec(&QtQml_VolatileBoolType_spec));
- return type;
-}
-
-static const char *PropertyList_SignatureStrings[] = {
- "PySide2.QtQml.ListProperty(type:type,append:typing.Callable,"
- "at:typing.Callable=None,clear:typing.Callable=None,count:typing.Callable=None)",
- nullptr}; // Sentinel
-
-static const char *VolatileBool_SignatureStrings[] = {
- "PySide2.QtQml.VolatileBool.get()->bool",
- "PySide2.QtQml.VolatileBool.set(a:object)",
- nullptr}; // Sentinel
-
-void PySide::initQmlSupport(PyObject *module)
-{
- ElementFactory<PYSIDE_MAX_QML_TYPES - 1>::init();
-
- // Export QmlListProperty type
- if (SbkSpecial_Type_Ready(module, PropertyListTypeF(), PropertyList_SignatureStrings) < 0) {
- PyErr_Print();
- qWarning() << "Error initializing PropertyList type.";
- return;
- }
-
- Py_INCREF(reinterpret_cast<PyObject *>(PropertyListTypeF()));
- PyModule_AddObject(module, PepType_GetNameStr(PropertyListTypeF()),
- reinterpret_cast<PyObject *>(PropertyListTypeF()));
-
- if (SbkSpecial_Type_Ready(module, QtQml_VolatileBoolTypeF(), VolatileBool_SignatureStrings) < 0) {
- PyErr_Print();
- qWarning() << "Error initializing VolatileBool type.";
- return;
- }
-
- Py_INCREF(QtQml_VolatileBoolTypeF());
- PyModule_AddObject(module, PepType_GetNameStr(QtQml_VolatileBoolTypeF()),
- reinterpret_cast<PyObject *>(QtQml_VolatileBoolTypeF()));
-}
diff --git a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h
deleted file mode 100644
index e94ea043f..000000000
--- a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** 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$
-**
-****************************************************************************/
-
-#ifndef PYSIDEQMLREGISTERTYPE_H
-#define PYSIDEQMLREGISTERTYPE_H
-
-#include <sbkpython.h>
-
-struct SbkObjectType;
-
-namespace PySide
-{
-
-extern void *nextQmlElementMemoryAddr;
-
-/**
- * Init the QML support doing things like registering QtQml.ListProperty and create the necessary stuff for
- * qmlRegisterType.
- *
- * \param module QtQml python module
- */
-void initQmlSupport(PyObject *module);
-
-/**
- * PySide implementation of qmlRegisterType<T> function.
- *
- * \param pyObj Python type to be registered.
- * \param uri QML element uri.
- * \param versionMajor QML component major version.
- * \param versionMinor QML component minor version.
- * \param qmlName QML element name
- * \return the metatype id of the registered type.
- */
-int qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor, int versionMinor,
- const char *qmlName);
-}
-
-// Volatile Bool Ptr type definition.
-
-typedef struct {
- PyObject_HEAD
- volatile bool flag;
-} QtQml_VolatileBoolObject;
-
-PyAPI_FUNC(PyTypeObject *) QtQml_VolatileBoolTypeF(void);
-
-#define VolatileBool_Check(op) (Py_TYPE(op) == QtQml_VolatileBoolTypeF())
-
-#endif
diff --git a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
deleted file mode 100644
index b61b28c07..000000000
--- a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
+++ /dev/null
@@ -1,216 +0,0 @@
-<?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$
-**
-****************************************************************************/
--->
-<typesystem package="PySide2.QtQml">
- <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
- <load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/>
- <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
-
- <!-- This is to inform the generator that the VolatileBool python type exists -->
- <custom-type name="VolatileBool"/>
- <primitive-type name="bool volatile" target-lang-api-name="VolatileBool">
- <include file-name="pysideqmlregistertype.h" location="local"/>
- <!-- No conversion rules are specified here, because the generator does not handle
- pointer to primitive types without function adjustment.
- See commit ff0b861b59b41387e771d9cd565e13de8b2750d1 or search for changePStr
- in generator tests folder. -->
- </primitive-type>
-
- <!-- 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:
-
- ::
-
- import com.mycompany.qmlcomponents 1.0
-
- Slider { ... }
-
- 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>
-
- <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistertype"/>
- </add-function>
-
- <enum-type identified-by-value="QML_HAS_ATTACHED_PROPERTIES">
- <extra-includes>
- <include file-name="QtQml" location="global"/>
- <include file-name="pysideqmlregistertype.h" location="local"/>
- </extra-includes>
- </enum-type>
-
- <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"/>
- <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>
- </object-type>
- <value-type name="QJSValue">
- <enum-type name="ErrorType" since="5.12"/>
- <enum-type name="SpecialValue"/>
- </value-type>
- <object-type name="QJSValueIterator"/>
- <object-type name="QQmlAbstractUrlInterceptor">
- <enum-type name="DataType"/>
- </object-type>
- <object-type name="QQmlApplicationEngine"/>
- <object-type name="QQmlComponent">
- <enum-type name="CompilationMode"/>
- <enum-type name="Status"/>
- </object-type>
- <object-type name="QQmlContext"/>
- <value-type name="QQmlError"/>
- <object-type name="QQmlDebuggingEnabler">
- <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++"/>
- </modify-argument>
- </modify-function>
- </object-type>
- <object-type name="QQmlExpression">
- <modify-function signature="evaluate(bool*)" allow-thread="yes">
- <modify-argument index="1">
- <remove-argument />
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="PyTuple"/>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_bool*"/>
- </inject-code>
- </modify-function>
- </object-type>
- <interface-type name="QQmlTypesExtensionInterface"/>
- <interface-type name="QQmlExtensionInterface"/>
- <object-type name="QQmlExtensionPlugin"/>
- <!-- Possible qRegisterMetaType issues ? -->
- <object-type name="QQmlFile">
- <enum-type name="Status"/>
- </object-type>
- <object-type name="QQmlFileSelector"/>
- <object-type name="QQmlImageProviderBase">
- <enum-type name="Flag" flags="Flags"/>
- <enum-type name="ImageType"/>
- </object-type>
- <object-type name="QQmlIncubator">
- <enum-type name="IncubationMode"/>
- <enum-type name="Status"/>
- </object-type>
- <object-type name="QQmlIncubationController">
- <modify-function signature="incubateWhile(volatile bool*,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. -->
- <replace-type modified-type="VolatileBool"/>
- <conversion-rule class="native">
- volatile bool * %out =
- &amp;((reinterpret_cast&lt;QtQml_VolatileBoolObject *&gt;(%PYARG_1))->flag);
- </conversion-rule>
- </modify-argument>
- </modify-function>
- </object-type>
-
- <!-- TODO: QQmlListProperty is a template class, and thus should probably be treated like a
- container-type tag, which implies custom code for conversion. Not sure there's a use case to
- allow instantiating or deriving from the class though, given that a separate custom ListProperty
- type is provided by the module. Plus meta type registration would have to be taken into account
- for the QML parts.
- <value-type name="QQmlListProperty"/>-->
- <value-type name="QQmlListReference"/>
- <interface-type name="QQmlParserStatus"/>
- <value-type name="QQmlProperty">
- <enum-type name="PropertyTypeCategory"/>
- <enum-type name="Type"/>
- </value-type>
- <object-type name="QQmlPropertyMap"/>
- <object-type name="QQmlPropertyValueSource"/>
- <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">
- <replace-type modified-type="PyTuple"/>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_bool*"/>
- </inject-code>
- </modify-function>
- <modify-function signature="booleanLiteral(bool*)const" allow-thread="yes">
- <modify-argument index="1">
- <remove-argument />
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="PyTuple"/>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_bool*"/>
- </inject-code>
- </modify-function>
- </value-type>
- <object-type name="QQmlNetworkAccessManagerFactory">
- <modify-function signature="create(QObject*)">
- <modify-argument index="return">
- <define-ownership class="native" owner="c++"/>
- </modify-argument>
- </modify-function>
- </object-type>
- <!-- Suppress anonymous enum warning -->
- <suppress-warning text="Anonymous enum (QmlCurrentSingletonTypeRegistrationVersion) does not have a type entry"/>
-</typesystem>