diff options
Diffstat (limited to 'sources/pyside2/PySide2')
-rw-r--r-- | sources/pyside2/PySide2/QtCore/typesystem_core_common.xml | 30 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp | 4 | ||||
-rw-r--r-- | sources/pyside2/PySide2/typesystem_templates.xml | 2 |
3 files changed, 27 insertions, 9 deletions
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index cc9b5e519..48f234f2b 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -74,6 +74,10 @@ <function signature="qVersion()" /> <function signature="qrand()" /> <function signature="qsrand(uint)" /> + <function signature="qCompress(const uchar*,int,int)"/> + <function signature="qCompress(const QByteArray&,int)"/> + <function signature="qUncompress(const uchar*,int)"/> + <function signature="qUncompress(const QByteArray&)"/> <inject-code class="native" position="beginning"> #include <pyside.h> @@ -2299,6 +2303,19 @@ <inject-code class="native" file="glue/qobject_findchild.cpp"/> <add-function signature="findChild(PyTypeObject*,const QString&)" return-type="PyObject*"> + <inject-documentation format="target" mode="append"> + To find the child of a certain QObject, the first argument of this function should be the child's type, and the second the name of the child: + + :: + + ... + parent = QWidget() + ... + # The first argument must be the child type + child1 = parent.findChild(QPushButton, "child_button") + child2 = parent.findChild(QWidget, "child_widget") + + </inject-documentation> <inject-code class="target" position="beginning"> QObject *child = _findChildHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1); %PYARG_0 = %CONVERTTOPYTHON[QObject*](child); @@ -2311,6 +2328,9 @@ </modify-argument> </add-function> <add-function signature="findChildren(PyTypeObject*,const QString&)" return-type="PySequence*" > + <inject-documentation format="target" mode="append"> + Like the method *findChild*, the first parameter should be the child's type. + </inject-documentation> <inject-code class="target" position="beginning"> %PYARG_0 = PyList_New(0); _findChildrenHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1, %PYARG_0); @@ -3015,9 +3035,8 @@ </modify-function> <modify-function signature="readData(char*,qint64)"> <inject-code class="target"> - QByteArray ba; - ba.resize(%2); - %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size()); + QByteArray ba(1 + int(%2), char(0)); + %CPPSELF.%FUNCTION_NAME(ba.data(), int(%2)); %PYARG_0 = Shiboken::String::fromCString(ba.constData()); </inject-code> <modify-argument index="1"> @@ -3039,9 +3058,8 @@ </modify-function> <modify-function signature="readLineData(char*,qint64)"> <inject-code class="target"> - QByteArray ba; - ba.resize(%2); - %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size()); + QByteArray ba(1 + int(%2), char(0)); + %CPPSELF.%FUNCTION_NAME(ba.data(), int(%2)); %PYARG_0 = Shiboken::String::fromCString(ba.constData()); </inject-code> <modify-argument index="1"> diff --git a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp index 0b427c251..1a1f09511 100644 --- a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp +++ b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp @@ -235,7 +235,7 @@ void propListTpFree(void* self) static PyType_Slot PropertyListType_slots[] = { {Py_tp_init, (void *)propListTpInit}, {Py_tp_free, (void *)propListTpFree}, - {Py_tp_dealloc, (void *)SbkDummyDealloc}, + {Py_tp_dealloc, (void *)object_dealloc}, {0, 0} }; static PyType_Spec PropertyListType_spec = { @@ -449,7 +449,7 @@ static PyType_Slot QtQml_VolatileBoolType_slots[] = { {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 *)SbkDummyDealloc}, + {Py_tp_dealloc, (void *)object_dealloc}, {0, 0} }; static PyType_Spec QtQml_VolatileBoolType_spec = { diff --git a/sources/pyside2/PySide2/typesystem_templates.xml b/sources/pyside2/PySide2/typesystem_templates.xml index a17337258..187dc5c42 100644 --- a/sources/pyside2/PySide2/typesystem_templates.xml +++ b/sources/pyside2/PySide2/typesystem_templates.xml @@ -203,7 +203,7 @@ </template> <template name="fix_char*"> - char val_; + char val_{}; %BEGIN_ALLOW_THREADS %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&val_); %END_ALLOW_THREADS |