diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-29 16:38:54 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-30 13:04:33 +0000 |
commit | 0a17b4e5c04df54f6b86b6a9de3a1ac64c723e7c (patch) | |
tree | ad9fca362fcab18da2d4813d8051f539778442a1 /sources | |
parent | f6ad4b04c0f2ac3fe1437df7a078c247c4bc96fb (diff) |
Declare some missing functions in QList
QList<T> member functions taking a T parameter are no longer
seen by the code parser since they take a parameter_type which
is specialized to be T or const T & depending on T.
Declare them instead. Similar, change QPolygon::operator<<(T)
to add-function.
This fixes several PySide tests that rely on those functions
(qpolygon and others).
Task-number: PYSIDE-904
Task-number: PYSIDE-1339
Change-Id: Ic1157f384f86b796cc5c7bc06a934a63649d74be
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/pyside2/PySide2/QtCore/typesystem_core_common.xml | 8 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index 0ca853a5e..0c24511a3 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -388,6 +388,14 @@ <!-- FIXME: Which one is it going to be? --> <container-type name="QList" type="list"> <include file-name="QList" location="global"/> + <declare-function signature="append(T)" return-type="void"/> + <declare-function signature="insert(qsizetype,T)" return-type="void"/> + <declare-function signature="prepend(T)" return-type="void"/> + <declare-function signature="push_back(T)" return-type="void"/> + <declare-function signature="push_front(T)" return-type="void"/> + <declare-function signature="removeAll(T)" return-type="void"/> + <declare-function signature="removeOne(T)" return-type="void"/> + <!-- operator << needs to be declared in inheriting class --> <conversion-rule> <native-to-target> <insert-template name="cpplist_to_pylist_conversion"/> diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml index 88c19360a..e9c94e5ae 100644 --- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml +++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml @@ -468,6 +468,7 @@ not see due to the TMP expression of the return type. --> <add-function signature="operator==(const QPolygon&)" return-type="bool"/> <add-function signature="operator!=(const QPolygon&)" return-type="bool"/> + <add-function signature="__reduce__" return-type="PyObject*"> <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qpolygon-reduce"> <insert-template name="reduce_code"> @@ -481,12 +482,12 @@ <modify-function signature="QPolygon(int,const int*)" remove="all"/> <!-- ### A QVector parameter, for no defined type, will generate wrong code. --> <modify-function signature="operator+=(QVector<QPoint>)" remove="all"/> - <modify-function signature="operator<<(QPoint)"> + <add-function signature="operator<<(QPoint)"> <inject-code file="../glue/qtgui.cpp" snippet="qpolygon-operatorlowerlower"/> - </modify-function> - <modify-function signature="operator<<(QVector<QPoint>)"> + </add-function> + <add-function signature="operator<<(QVector<QPoint>)"> <inject-code file="../glue/qtgui.cpp" snippet="qpolygon-operatorlowerlower"/> - </modify-function> + </add-function> <!-- ### --> </value-type> <value-type name="QPolygonF"> |