summaryrefslogtreecommitdiffstats
path: root/PySide/QtGui/typesystem_gui_common.xml
diff options
context:
space:
mode:
Diffstat (limited to 'PySide/QtGui/typesystem_gui_common.xml')
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml38
1 files changed, 38 insertions, 0 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 14a4ef7..965b69d 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -5445,6 +5445,44 @@
%END_ALLOW_THREADS
</template>
+ <modify-function signature="drawPixmapFragments(const QPainter::PixmapFragment*, int, const QPixmap&amp;, QFlags&lt;QPainter::PixmapFragmentHint>)" since="4.7">
+ <modify-argument index="1">
+ <replace-type modified-type="PySequence"/>
+ </modify-argument>
+ <modify-argument index="2">
+ <remove-argument/>
+ </modify-argument>
+ <inject-code class="target" position="beginning">
+ if (PySequence_Check(%PYARG_1)) { /* object needs to provide sequence protocol */
+ Shiboken::AutoDecRef seq(PySequence_Fast(%PYARG_1, 0));
+ Py_ssize_t size = PySequence_Fast_GET_SIZE(seq.object());
+
+ if (size != -1) {
+ for (Py_ssize_t i = 0; i &lt; size; i++) {
+ PyObject* obj = PySequence_Fast_GET_ITEM(seq.object(), i);
+ if (!%ISCONVERTIBLE[const QPainter::PixmapFragment](obj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "You must pass a tuple/list that contain only "
+ "QtGui.%TYPE.PixmapFragment types");
+ goto out;
+ }
+ }
+
+ /* at this point we have either tuple or list of QPainter::PixmapFragment's */
+ QPainter::PixmapFragment* fragments = new QPainter::PixmapFragment[size];
+ for (Py_ssize_t i = 0; i &lt; size; i++) {
+ PyObject* obj = PySequence_Fast_GET_ITEM(seq.object(), i);
+ fragments[i] = %CONVERTTOCPP[const QPainter::PixmapFragment](obj);
+ }
+ %CPPSELF.%FUNCTION_NAME(fragments, size, %3, %4);
+ delete [] fragments;
+ }
+ }
+
+ out:
+ ;
+ </inject-code>
+ </modify-function>
<modify-function signature="drawConvexPolygon(const QPoint*, int)" remove="all" />
<add-function signature="drawConvexPolygon(QVector&lt;QPoint>)">
<inject-code>