aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml')
-rw-r--r--sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml982
1 files changed, 298 insertions, 684 deletions
diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
index e2e3b2335..1d09dee7a 100644
--- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
+++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
@@ -55,22 +55,22 @@
</template>
<rejection class="^Q.*$" argument-type="^QPlatform.*$"/>
- <function signature="qAlpha(uint)" />
- <function signature="qBlue(uint)" />
- <function signature="qGray(int,int,int)" />
- <function signature="qGray(uint)" />
- <function signature="qGreen(uint)" />
- <function signature="qIsGray(uint)" />
- <function signature="qRed(uint)" />
- <function signature="qRgb(int,int,int)" />
- <function signature="qRgba(int,int,int,int)" />
- <function signature="qFuzzyCompare(QMatrix,QMatrix)" />
- <function signature="qFuzzyCompare(QTransform,QTransform)" />
- <function signature="qFuzzyCompare(QQuaternion,QQuaternion)" />
- <function signature="qFuzzyCompare(QMatrix4x4,QMatrix4x4)" />
- <function signature="qFuzzyCompare(QVector2D,QVector2D)" />
- <function signature="qFuzzyCompare(QVector3D,QVector3D)" />
- <function signature="qFuzzyCompare(QVector4D,QVector4D)" />
+ <function signature="qAlpha(uint)"/>
+ <function signature="qBlue(uint)"/>
+ <function signature="qGray(int,int,int)"/>
+ <function signature="qGray(uint)"/>
+ <function signature="qGreen(uint)"/>
+ <function signature="qIsGray(uint)"/>
+ <function signature="qRed(uint)"/>
+ <function signature="qRgb(int,int,int)"/>
+ <function signature="qRgba(int,int,int,int)"/>
+ <function signature="qFuzzyCompare(QMatrix,QMatrix)"/>
+ <function signature="qFuzzyCompare(QTransform,QTransform)"/>
+ <function signature="qFuzzyCompare(QQuaternion,QQuaternion)"/>
+ <function signature="qFuzzyCompare(QMatrix4x4,QMatrix4x4)"/>
+ <function signature="qFuzzyCompare(QVector2D,QVector2D)"/>
+ <function signature="qFuzzyCompare(QVector3D,QVector3D)"/>
+ <function signature="qFuzzyCompare(QVector4D,QVector4D)"/>
<rejection class="*" function-name="qobject_interface_iid&lt;QStyleFactoryInterface*&gt;"/>
<rejection class="*" function-name="qobject_interface_iid&lt;QAccessibleFactoryInterface*&gt;"/>
<rejection class="*" function-name="qobject_interface_iid&lt;QInputContextFactoryInterface*&gt;"/>
@@ -257,9 +257,9 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f, %f, %f, %f" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f, %f, %f, %f"/>
<replace from="%REPR_ARGS"
- to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()" />
+ to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()"/>
</insert-template>
</inject-code>
</add-function>
@@ -267,16 +267,16 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="ddddddddd" />
+ <replace from="%REDUCE_FORMAT" to="ddddddddd"/>
<replace from="%REDUCE_ARGS"
- to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()" />
+ to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()"/>
</insert-template>
</inject-code>
</add-function>
<modify-function signature="map(qreal,qreal,qreal*,qreal*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="3">
<remove-argument/>
@@ -286,7 +286,7 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_args,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
@@ -306,38 +306,14 @@
</inject-code>
</modify-function>
<add-function signature="quadToQuad(QPolygonF&amp;,QPolygonF&amp;)" return-type="PyObject*" static="true">
- <inject-code>
- QTransform _result;
- if (QTransform::quadToQuad(%1, %2, _result)) {
- %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
- } else {
- Py_INCREF(Py_None);
- %PYARG_0 = Py_None;
- }
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qtransform-quadtoquad"/>
</add-function>
<add-function signature="quadToSquare(QPolygonF &amp;)" return-type="PyObject*" static="true">
- <inject-code>
- QTransform _result;
- if (QTransform::quadToSquare(%1, _result)) {
- %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
- } else {
- Py_INCREF(Py_None);
- %PYARG_0 = Py_None;
- }
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qtransform-quadtosquare"/>
</add-function>
<add-function signature="squareToQuad(QPolygonF &amp;)" return-type="PyObject*" static="true">
- <inject-code>
- QTransform _result;
- if (QTransform::squareToQuad(%1, _result)) {
- %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
- } else {
- Py_INCREF(Py_None);
- %PYARG_0 = Py_None;
- }
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qtransform-squaretoquad"/>
</add-function>
<!-- Disambiguate from Qt3DCore/qtransform.h -->
<include file-name="QtGui/qtransform.h" location="global"/>
@@ -346,21 +322,17 @@
<value-type name="QStaticText">
<enum-type name="PerformanceHint"/>
</value-type>
- <value-type name="QTextFragment" />
+ <value-type name="QTextFragment"/>
<value-type name="QBitmap" >
<modify-function signature="fromData(QSize,const uchar*,QImage::Format)">
<modify-argument index="2">
<replace-type modified-type="PyBuffer"/>
</modify-argument>
- <inject-code>
- uchar *buffer = reinterpret_cast&lt;uchar*&gt;(Shiboken::Buffer::getPointer(%PYARG_2));
- QBitmap %0 = QBitmap::fromData(%1, buffer, %3);
- %PYARG_0 = %CONVERTTOPYTHON[QBitmap](%0);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qbitmap-fromdata"/>
</modify-function>
</value-type>
- <value-type name="QTextInlineObject" />
- <value-type name="QTextDocumentFragment" />
+ <value-type name="QTextInlineObject"/>
+ <value-type name="QTextDocumentFragment"/>
<value-type name="QTextOption">
<enum-type name="Flag" flags="Flags"/>
<enum-type name="TabType"/>
@@ -370,19 +342,12 @@
<value-type name="QTextLine" >
<enum-type name="CursorPosition"/>
<enum-type name="Edge"/>
- <modify-function signature="cursorToX(int*,QTextLine::Edge)const" remove="all" />
+ <modify-function signature="cursorToX(int*,QTextLine::Edge)const" remove="all"/>
<modify-function signature="cursorToX(int,QTextLine::Edge)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE %0 = %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;%1, %2);
- %END_ALLOW_THREADS
- %PYARG_0 = PyTuple_New(2);
- PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));
- PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qtextline-cursortox"/>
</modify-function>
<modify-function signature="xToCursor(qreal,QTextLine::CursorPosition)const">
<modify-argument index="2">
@@ -390,8 +355,8 @@
</modify-argument>
</modify-function>
</value-type>
- <value-type name="QTextTableFormat" />
- <value-type name="QTextImageFormat" />
+ <value-type name="QTextTableFormat"/>
+ <value-type name="QTextImageFormat"/>
<value-type name="QTextFrameFormat" >
<enum-type name="BorderStyle"/>
<enum-type name="Position"/>
@@ -406,11 +371,11 @@
</value-type>
</value-type>
<value-type name="QPalette">
- <enum-type name="ColorGroup" />
- <enum-type name="ColorRole" />
+ <enum-type name="ColorGroup"/>
+ <enum-type name="ColorRole"/>
</value-type>
<object-type name="QInputMethod">
- <enum-type name="Action" />
+ <enum-type name="Action"/>
</object-type>
<value-type name="QKeySequence">
<enum-type name="SequenceFormat"/>
@@ -420,9 +385,9 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%i, %i, %i, %i" />
+ <replace from="%REPR_FORMAT" to="%i, %i, %i, %i"/>
<replace from="%REPR_ARGS"
- to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]" />
+ to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]"/>
</insert-template>
</inject-code>
</add-function>
@@ -430,22 +395,15 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="iiii" />
- <replace from="%REDUCE_ARGS" to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]" />
+ <replace from="%REDUCE_FORMAT" to="iiii"/>
+ <replace from="%REDUCE_ARGS" to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]"/>
</insert-template>
</inject-code>
</add-function>
<modify-function signature="operator[](uint)const" remove="all"/>
<add-function signature="__getitem__">
- <inject-code class="target" position="beginning">
- if (_i &lt; 0 || _i >= %CPPSELF.count()) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return 0;
- }
- int item = (*%CPPSELF)[_i];
- return %CONVERTTOPYTHON[int](item);
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qkeysequence-getitem"/>
</add-function>
<!-- ### Not necessary due the PySide QVariant conversion rules -->
@@ -461,9 +419,7 @@
<modify-argument index="return">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code>
- %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.data(), %CPPSELF.size());
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpicture-data"/>
</modify-function>
<modify-function signature="setData(const char*,uint)">
<modify-argument index="1">
@@ -502,13 +458,13 @@
<!-- ### -->
<add-function signature="__iter__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="__iter__" />
+ <insert-template name="__iter__"/>
</inject-code>
</add-function>
<add-function signature="__next__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="__next__">
- <replace from="%CPPSELF_TYPE" to="QTextBlock::iterator" />
+ <replace from="%CPPSELF_TYPE" to="QTextBlock::iterator"/>
</insert-template>
</inject-code>
</add-function>
@@ -516,36 +472,24 @@
<add-function signature="__iter__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="__iter_parent__">
- <replace from="%CPPSELF_TYPE" to="QTextBlock::iterator" />
+ <replace from="%CPPSELF_TYPE" to="QTextBlock::iterator"/>
</insert-template>
</inject-code>
</add-function>
<modify-function signature="setUserData(QTextBlockUserData*)">
- <inject-code class="target" position="end">
- const QTextDocument *doc = %CPPSELF.document();
- if (doc) {
- Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
- Shiboken::Object::setParent(pyDocument, %PYARG_1);
- }
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtgui.cpp" snippet="qtextblock-setuserdata"/>
</modify-function>
<modify-function signature="userData()const">
<modify-argument index="return">
<define-ownership class="target" owner="default"/>
</modify-argument>
- <inject-code class="target" position="end">
- const QTextDocument *doc = %CPPSELF.document();
- if (doc) {
- Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
- Shiboken::Object::setParent(pyDocument, %PYARG_0);
- }
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtgui.cpp" snippet="qtextblock-userdata"/>
</modify-function>
</value-type>
<value-type name="QTextBlockFormat">
<enum-type name="LineHeightTypes" since="4.8" revision="4800"/>
</value-type>
- <value-type name="QTextTableCellFormat" />
+ <value-type name="QTextTableCellFormat"/>
<value-type name="QTextCharFormat" >
<enum-type name="FontPropertiesInheritanceBehavior"/>
<enum-type name="UnderlineStyle"/>
@@ -555,7 +499,7 @@
<enum-type name="FormatType"/>
<enum-type name="ObjectTypes"/>
<enum-type name="PageBreakFlag" flags="PageBreakFlags"/>
- <enum-type name="Property" />
+ <enum-type name="Property"/>
</value-type>
<value-type name="QTextListFormat">
<enum-type name="Style"/>
@@ -566,17 +510,10 @@
<include file-name="QTransform" location="global"/>
</extra-includes>
<add-function signature="__reduce__" return-type="PyObject*">
- <inject-code class="target" position="beginning">
- PyObject *points = PyList_New(%CPPSELF.count());
- for (int i = 0, max = %CPPSELF.count(); i &lt; max; ++i){
- int x, y;
- %CPPSELF.point(i, &amp;x, &amp;y);
- QPoint pt = QPoint(x, y);
- PyList_SET_ITEM(points, i, %CONVERTTOPYTHON[QPoint](pt));
- }
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qpolygon-reduce">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="N" />
- <replace from="%REDUCE_ARGS" to="points" />
+ <replace from="%REDUCE_FORMAT" to="N"/>
+ <replace from="%REDUCE_ARGS" to="points"/>
</insert-template>
</inject-code>
</add-function>
@@ -586,18 +523,10 @@
<!-- ### A QVector parameter, for no defined type, will generate wrong code. -->
<modify-function signature="operator+=(QVector&lt;QPoint&gt;)" remove="all"/>
<modify-function signature="operator&lt;&lt;(QPoint)">
- <inject-code>
- // %FUNCTION_NAME()
- *%CPPSELF &lt;&lt; %1;
- %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpolygon-operatorlowerlower"/>
</modify-function>
<modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)">
- <inject-code>
- // %FUNCTION_NAME()
- *%CPPSELF &lt;&lt; %1;
- %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpolygon-operatorlowerlower"/>
</modify-function>
<!-- ### -->
</value-type>
@@ -658,16 +587,14 @@
<modify-argument index="1">
<rename to="image"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- %0 = new %TYPE(QPixmap::fromImage(%1));
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qpixmap"/>
</add-function>
<modify-function signature="QPixmap(const char*const[])">
<modify-argument index="1">
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="load_xpm" />
+ <insert-template name="load_xpm"/>
</inject-code>
</modify-function>
@@ -699,7 +626,7 @@
<enum-type name="SelectionType"/>
<modify-function signature="selectedTableCells(int*,int*,int*,int*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -715,12 +642,12 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
<inject-code class="native" position="end">
<insert-template name="fix_native_return_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
@@ -749,9 +676,9 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f"/>
<replace from="%REPR_ARGS"
- to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()" />
+ to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()"/>
</insert-template>
</inject-code>
</add-function>
@@ -759,8 +686,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dddddd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()" />
+ <replace from="%REDUCE_FORMAT" to="dddddd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()"/>
</insert-template>
</inject-code>
</add-function>
@@ -779,7 +706,7 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="qmatrix_map" />
+ <insert-template name="qmatrix_map"/>
</inject-code>
</modify-function>
<modify-function signature="map(qreal,qreal,qreal*,qreal*)const">
@@ -790,7 +717,7 @@
<remove-argument />
</modify-argument>
<inject-code>
- <insert-template name="qmatrix_map" />
+ <insert-template name="qmatrix_map"/>
</inject-code>
</modify-function>
<modify-function signature="inverted(bool*)const">
@@ -806,15 +733,15 @@
</modify-function>
</value-type>
- <value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient" />
- <value-type name="QFontInfo" />
- <value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient" />
+ <value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient"/>
+ <value-type name="QFontInfo"/>
+ <value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient"/>
<value-type name="QFont" >
<enum-type name="Capitalization"/>
<enum-type name="SpacingType"/>
<enum-type name="Stretch"/>
<enum-type name="Style"/>
- <enum-type name="StyleHint" />
+ <enum-type name="StyleHint"/>
<enum-type name="StyleStrategy"/>
<enum-type name="Weight"/>
<enum-type name="HintingPreference" since="4.8" revision="4800"/>
@@ -837,7 +764,7 @@
<include file-name="QImage" location="global"/>
</extra-includes>
</function> -->
- <primitive-type name="QImageCleanupFunction" />
+ <primitive-type name="QImageCleanupFunction"/>
<value-type name="QImage">
<enum-type name="Format"/>
<enum-type name="InvertMode"/>
@@ -856,7 +783,7 @@
</modify-argument>
<inject-code>
<insert-template name="qimage_buffer_constructor">
- <replace from="%ARGS" to="%2, %3, %4, %5" />
+ <replace from="%ARGS" to="%2, %3, %4, %5"/>
</insert-template>
</inject-code>
</modify-function>
@@ -866,7 +793,7 @@
</modify-argument>
<inject-code>
<insert-template name="qimage_buffer_constructor">
- <replace from="%ARGS" to="%2, %3, %4" />
+ <replace from="%ARGS" to="%2, %3, %4"/>
</insert-template>
</inject-code>
</modify-function>
@@ -874,61 +801,52 @@
<add-function signature="QImage(QString&amp;,int,int,int,QImage::Format)">
<inject-code>
<insert-template name="qimage_buffer_constructor">
- <replace from="%ARGS" to="%2, %3, %4, %5" />
+ <replace from="%ARGS" to="%2, %3, %4, %5"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QImage(QString&amp;,int,int,QImage::Format)">
<inject-code>
<insert-template name="qimage_buffer_constructor">
- <replace from="%ARGS" to="%2, %3, %4" />
+ <replace from="%ARGS" to="%2, %3, %4"/>
</insert-template>
</inject-code>
</add-function>
<!-- The non-const versions are already used -->
<modify-function signature="QImage(const uchar*,int,int,int,QImage::Format,QImageCleanupFunction,void*)" remove="all"/>
- <modify-function signature="QImage(const uchar*,int,int,QImage::Format,QImageCleanupFunction,void*)" remove="all" />
+ <modify-function signature="QImage(const uchar*,int,int,QImage::Format,QImageCleanupFunction,void*)" remove="all"/>
<!-- ### -->
<modify-function signature="QImage(const char*const[])">
<modify-argument index="1">
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
<inject-code class="target" position="beginning">
- <insert-template name="load_xpm" />
+ <insert-template name="load_xpm"/>
</inject-code>
</modify-function>
<!-- ### There is already an fromData with a QByteArray type (that is convertible from Python's str) as the first type. -->
<modify-function signature="fromData(const uchar*,int,const char*)" remove="all"/>
<!-- ### There is already an loadFromData with a QByteArray type (that is convertible from Python's str) as the first type. -->
- <modify-function signature="loadFromData(const uchar*,int,const char*)" remove="all" />
+ <modify-function signature="loadFromData(const uchar*,int,const char*)" remove="all"/>
<modify-function signature="constBits()const" since="4.7">
- <inject-code>
- %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.byteCount());
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qimage-constbits"/>
</modify-function>
<modify-function signature="bits()">
- <inject-code>
- // byteCount() is only available on Qt4.7, so we use bytesPerLine * height
- %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.bytesPerLine() * %CPPSELF.height(), Shiboken::Buffer::ReadWrite);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qimage-bits"/>
</modify-function>
<modify-function signature="constScanLine(int)const" since="4.7">
- <inject-code>
- %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine());
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qimage-constscanline"/>
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
</modify-function>
<modify-function signature="scanLine(int)">
- <inject-code>
- %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine(), Shiboken::Buffer::ReadWrite);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qimage-scanline"/>
<modify-argument index="return">
- <replace-type modified-type="PyObject" />
+ <replace-type modified-type="PyObject"/>
</modify-argument>
</modify-function>
<!--
@@ -955,8 +873,8 @@
<extra-includes>
<include file-name="QStringList" location="global"/>
</extra-includes>
- <enum-type name="SystemFont" />
- <enum-type name="WritingSystem" />
+ <enum-type name="SystemFont"/>
+ <enum-type name="WritingSystem"/>
</value-type>
<value-type name="QPen">
<extra-includes>
@@ -1019,117 +937,36 @@
</extra-includes>
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="qcolor_repr" />
+ <insert-template name="qcolor_repr"/>
</inject-code>
</add-function>
<add-function signature="__str__" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="qcolor_repr" />
+ <insert-template name="qcolor_repr"/>
</inject-code>
</add-function>
<add-function signature="__setstate__(PyObject*)" return-type="PyObject">
- <inject-code>
- Shiboken::AutoDecRef func(PyObject_GetAttr(%PYSELF, PyTuple_GET_ITEM(%1, 0)));
- PyObject *args = PyTuple_GET_ITEM(%1, 1);
- %PYARG_0 = PyObject_Call(func, args, NULL);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qcolor-setstate"/>
</add-function>
<add-function signature="__reduce__" return-type="PyObject">
- <inject-code class="target" position="beginning">
- switch(%CPPSELF.spec()) {
- case QColor::Rgb:
- {
- qreal r, g, b, a;
- %CPPSELF.getRgbF(&amp;r, &amp;g, &amp;b, &amp;a);
- %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setRgbF", (float)r, (float)g, (float)b, (float)a);
- break;
- }
- case QColor::Hsv:
- {
- qreal h, s, v, a;
- %CPPSELF.getHsvF(&amp;h, &amp;s, &amp;v, &amp;a);
- %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setHsvF", (float)h, (float)s, (float)v, (float)a);
- break;
- }
- case QColor::Cmyk:
- {
- qreal c, m, y, k, a;
- %CPPSELF.getCmykF(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);
- %PYARG_0 = Py_BuildValue("(ON(s(fffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setCmykF", (float)c, (float)m, (float)y, (float)k, (float)a);
- break;
- }
- #if QT_VERSION >= 0x040600
- case QColor::Hsl:
- {
- qreal h, s, l, a;
- %CPPSELF.getHslF(&amp;h, &amp;s, &amp;l, &amp;a);
- %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setHslF", (float)h, (float)s, (float)l, (float)a);
- break;
- }
- #endif
- default:
- {
- %PYARG_0 = Py_BuildValue("(N(O))", PyObject_Type(%PYSELF), Py_None);
- }
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qcolor-reduce"/>
</add-function>
<add-function signature="toTuple" return-type="PyObject">
- <inject-code class="target" position="beginning">
- switch(%CPPSELF.spec()) {
- case QColor::Rgb:
- {
- int r, g, b, a;
- %CPPSELF.getRgb(&amp;r, &amp;g, &amp;b, &amp;a);
- %PYARG_0 = Py_BuildValue("iiii", r, g, b, a);
- break;
- }
- case QColor::Hsv:
- {
- int h, s, v, a;
- %CPPSELF.getHsv(&amp;h, &amp;s, &amp;v, &amp;a);
- %PYARG_0 = Py_BuildValue("iiii", h, s, v, a);
- break;
- }
- case QColor::Cmyk:
- {
- int c, m, y, k, a;
- %CPPSELF.getCmyk(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);
- %PYARG_0 = Py_BuildValue("iiiii", c, m, y, k, a);
- break;
- }
- case QColor::Hsl:
- {
- int h, s, l, a;
- %CPPSELF.getHsl(&amp;h, &amp;s, &amp;l, &amp;a);
- %PYARG_0 = Py_BuildValue("iiii", h, s, l, a);
- break;
- }
- default:
- {
- %PYARG_0 = 0;
- }
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qcolor-totuple"/>
</add-function>
<!-- ### "QColor(QColor::Spec)" is an internal method. -->
<modify-function signature="QColor(QColor::Spec)" remove="all"/>
<!-- ### Constructor removed because we already have an overload using QString. -->
- <modify-function signature="QColor(const char*)" remove="all" />
+ <modify-function signature="QColor(const char*)" remove="all"/>
<!-- ### -->
<add-function signature="QColor(QVariant)">
- <inject-code class="target" position="beginning">
- if (%1.type() == QVariant::Color)
- %0 = new %TYPE(%1.value&lt;QColor>());
- else
- PyErr_SetString(PyExc_TypeError, "QVariant must be holding a QColor");
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qcolor"/>
</add-function>
<!-- get* methods. Inject code -->
<modify-function signature="getCmyk(int*,int*,int*,int*,int*)">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1150,13 +987,13 @@
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getCmykF(qreal*,qreal*,qreal*,qreal*,qreal*)">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1177,13 +1014,13 @@
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getHsl(int*,int*,int*,int*)const" since="4.6">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1200,13 +1037,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getHslF(qreal*,qreal*,qreal*,qreal*)const" since="4.6">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1223,13 +1060,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getHsv(int*,int*,int*,int*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1246,13 +1083,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getHsvF(qreal*,qreal*,qreal*,qreal*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1269,13 +1106,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getRgb(int*,int*,int*,int*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1292,13 +1129,13 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int" />
+ <replace from="$TYPE" to="int"/>
</insert-template>
</inject-code>
</modify-function>
<modify-function signature="getRgbF(qreal*,qreal*,qreal*,qreal*)const">
<modify-argument index="0">
- <replace-type modified-type="PyObject *" />
+ <replace-type modified-type="PyObject *"/>
</modify-argument>
<modify-argument index="1">
<remove-argument/>
@@ -1315,7 +1152,7 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal" />
+ <replace from="$TYPE" to="qreal"/>
</insert-template>
</inject-code>
</modify-function>
@@ -1344,56 +1181,14 @@
<modify-argument index="5">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- int *array = nullptr;
- bool errorOccurred = false;
-
- if (numArgs == 5) {
- array = Shiboken::sequenceToIntArray(%PYARG_5, true);
- if (PyErr_Occurred()) {
- if (array)
- delete []array;
- errorOccurred = true;
- }
- }
-
- if (!errorOccurred) {
- %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array);
-
- if (array)
- delete []array;
-
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qfontmetricsf-boundingrect"/>
</modify-function>
<modify-function signature="size(int,QString,int,int*)const">
<modify-argument index="4">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- int *array = nullptr;
- bool errorOccurred = false;
-
- if (numArgs == 4) {
- array = Shiboken::sequenceToIntArray(%PYARG_4, true);
- if (PyErr_Occurred()) {
- if (array)
- delete []array;
- errorOccurred = true;
- }
- }
-
- if (!errorOccurred) {
- %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array);
-
- if (array)
- delete []array;
-
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qfontmetricsf-size"/>
</modify-function>
</value-type>
<value-type name="QFontMetrics" >
@@ -1420,85 +1215,21 @@
<modify-argument index="8">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- int *array = nullptr;
- bool errorOccurred = false;
-
- if (numArgs == 8) {
- array = Shiboken::sequenceToIntArray(%PYARG_8, true);
- if (PyErr_Occurred()) {
- if (array)
- delete []array;
- errorOccurred = true;
- }
- }
-
- if (!errorOccurred) {
- %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, %7, array);
-
- if (array)
- delete []array;
-
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qfontmetrics-boundingrect-1"/>
</modify-function>
<modify-function signature="boundingRect(QRect,int,QString,int,int*)const">
<modify-argument index="5">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- int *array = nullptr;
- bool errorOccurred = false;
-
- if (numArgs == 5) {
- array = Shiboken::sequenceToIntArray(%PYARG_5, true);
- if (PyErr_Occurred()) {
- if (array)
- delete []array;
- errorOccurred = true;
- }
- }
-
- if (!errorOccurred) {
- %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array);
-
- if (array)
- delete []array;
-
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qfontmetrics-boundingrect-2"/>
</modify-function>
<modify-function signature="size(int,QString,int,int*)const">
<modify-argument index="4">
<replace-type modified-type="PyObject"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- int *array = nullptr;
- bool errorOccurred = false;
-
- if (numArgs == 4) {
- array = Shiboken::sequenceToIntArray(%PYARG_4, true);
- if (PyErr_Occurred()) {
- if (array)
- delete []array;
- errorOccurred = true;
- }
- }
-
- if (!errorOccurred) {
- %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array);
-
- if (array)
- delete []array;
-
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
- }
-
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qfontmetrics-size"/>
</modify-function>
</value-type>
<value-type name="QGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::NoGradient">
@@ -1508,20 +1239,20 @@
<enum-type name="Spread"/>
<enum-type name="Type"/>
</value-type>
- <value-type name="QLinearGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::LinearGradient" />
+ <value-type name="QLinearGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::LinearGradient"/>
<object-type name="QPaintDevice">
<enum-type name="PaintDeviceMetric"/>
</object-type>
<object-type name="QPagedPaintDevice">
- <value-type name="Margins" />
- <enum-type name="PageSize" />
+ <value-type name="Margins"/>
+ <enum-type name="PageSize"/>
<enum-type name="PdfVersion" since="5.10"/>
</object-type>
<object-type name="QAbstractTextDocumentLayout">
<value-type name="PaintContext" >
<include file-name="QAbstractTextDocumentLayout" location="global"/>
</value-type>
- <value-type name="Selection" />
+ <value-type name="Selection"/>
<modify-function signature="setPaintDevice(QPaintDevice*)">
<modify-argument index="1">
<parent index="this" action="add"/>
@@ -1534,15 +1265,15 @@
<modify-argument index="1" invalidate-after-use="yes"/>
</modify-function>
</object-type>
- <object-type name="QPyTextObject" />
+ <object-type name="QPyTextObject"/>
- <object-type name="QDesktopServices" since="4.2" />
+ <object-type name="QDesktopServices" since="4.2"/>
<object-type name="QDoubleValidator">
<enum-type name="Notation"/>
</object-type>
<object-type name="QIconEngine">
- <object-type name="AvailableSizesArgument" />
- <enum-type name="IconEngineHook" />
+ <object-type name="AvailableSizesArgument"/>
+ <enum-type name="IconEngineHook"/>
<modify-function signature="paint(QPainter*,QRect,QIcon::Mode,QIcon::State)">
<modify-argument index="1" invalidate-after-use="yes"/>
</modify-function>
@@ -1564,7 +1295,7 @@
</modify-function>
<modify-function signature="write(const QImage&amp;)" allow-thread="yes"/>
</object-type>
- <object-type name="QIntValidator" />
+ <object-type name="QIntValidator"/>
<object-type name="QPainterPathStroker" copyable="false"/>
<object-type name="QPictureIO">
@@ -1577,19 +1308,11 @@
<object-type name="QPixmapCache">
<value-type name="Key"/>
<add-function signature="find(QPixmapCache::Key&amp;)">
- <inject-code>
- QPixmap p;
- if (%CPPSELF.%FUNCTION_NAME(%1, &amp;p)) {
- %PYARG_0 = %CONVERTTOPYTHON[QPixmap](p);
- } else {
- %PYARG_0 = Py_None;
- Py_INCREF(%PYARG_0);
- }
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpixmapcache-find"/>
</add-function>
</object-type>
- <object-type name="QRegExpValidator" />
+ <object-type name="QRegExpValidator"/>
<object-type name="QStandardItem">
<enum-type name="ItemType"/>
@@ -1641,27 +1364,13 @@
</modify-function>
<modify-function signature="setChild(int,int,QStandardItem*)">
- <inject-code class="target" position="beginning">
- // Clear parent from the old child
- QStandardItem *_i = %CPPSELF->child(%1, %2);
- if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::Object::setParent(0, _pyI);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditem-setchild-1"/>
<modify-argument index="3">
<parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setChild(int,QStandardItem*)">
- <inject-code class="target" position="beginning">
- // Clear parent from the old child
- QStandardItem *_i = %CPPSELF->child(%1);
- if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::Object::setParent(0, _pyI);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditem-setchild-2"/>
<modify-argument index="2">
<parent index="this" action="add"/>
</modify-argument>
@@ -1700,8 +1409,8 @@
</modify-argument>
</modify-function>
</object-type>
- <object-type name="QTextBlockGroup" />
- <object-type name="QTextBlockUserData" />
+ <object-type name="QTextBlockGroup"/>
+ <object-type name="QTextBlockUserData"/>
<object-type name="QTextItem">
<enum-type name="RenderFlag" flags="RenderFlags"/>
</object-type>
@@ -1778,25 +1487,25 @@
</modify-function>
</object-type>
- <object-type name="QActionEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged" />
+ <object-type name="QActionEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged"/>
<object-type name="QCloseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Close"/>
<object-type name="QContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ContextMenu">
<enum-type name="Reason"/>
</object-type>
<object-type name="QDragEnterEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragEnter"/>
<object-type name="QDragLeaveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragLeave"/>
- <object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove" />
+ <object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove"/>
<object-type name="QDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Drop">
<modify-function signature="source()const">
<modify-argument index="return">
- <define-ownership class="target" owner="default" />
+ <define-ownership class="target" owner="default"/>
</modify-argument>
</modify-function>
</object-type>
<object-type name="QEnterEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::Enter"/>
- <object-type name="QExposeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Expose" />
- <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen" />
- <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut" />
+ <object-type name="QExposeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Expose"/>
+ <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen"/>
+ <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut"/>
<object-type name="QHelpEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolTip || %1-&gt;type() == QEvent::WhatsThis"/>
<object-type name="QHideEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::Hide"/>
<object-type name="QHoverEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::HoverEnter || %1-&gt;type() == QEvent::HoverLeave || %1-&gt;type() == QEvent::HoverMove"/>
@@ -1812,7 +1521,7 @@
</object-type>
<object-type name="QInputMethodQueryEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::InputMethodQuery"/>
- <object-type name="QMoveEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Move" />
+ <object-type name="QMoveEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Move"/>
<object-type name="QNativeGestureEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::NativeGesture"/>
<object-type name="QResizeEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Resize"/>
<object-type name="QShortcutEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Shortcut">
@@ -1827,16 +1536,13 @@
<object-type name="QWhatsThisClickedEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::WhatsThisClicked"/>
<object-type name="QWheelEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Wheel"/>
<!-- Qt5.5: suppress this nameless enum -->
- <suppress-warning text="enum 'QWheelEvent::DefaultDeltasPerStep' does not have a type entry or is not an enum" />
+ <suppress-warning text="enum 'QWheelEvent::DefaultDeltasPerStep' does not have a type entry or is not an enum"/>
<object-type name="QWindowStateChangeEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::WindowStateChange"/>
<object-type name="QInputEvent" copyable="false"/>
<object-type name="QKeyEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::KeyPress || %1-&gt;type() == QEvent::KeyRelease || %1-&gt;type() == QEvent::ShortcutOverride">
<add-function signature="operator!=(QKeySequence::StandardKey)">
- <inject-code class="target">
- bool ret = !(&amp;%CPPSELF == %1);
- %PYARG_0 = %CONVERTTOPYTHON[bool](ret);
- </inject-code>
+ <inject-code class="target" file="../glue/qtgui.cpp" snippet="qkeyevent-operatornotequal"/>
</add-function>
</object-type>
<object-type name="QMouseEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::MouseButtonDblClick || %1-&gt;type() == QEvent::MouseButtonPress || %1-&gt;type() == QEvent::MouseButtonRelease || %1-&gt;type() == QEvent::MouseMove"/>
@@ -1860,13 +1566,13 @@
<!-- ### -->
<add-function signature="__iter__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="__iter__" />
+ <insert-template name="__iter__"/>
</inject-code>
</add-function>
<add-function signature="__next__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="__next__">
- <replace from="%CPPSELF_TYPE" to="QTextFrame::iterator" />
+ <replace from="%CPPSELF_TYPE" to="QTextFrame::iterator"/>
</insert-template>
</inject-code>
</add-function>
@@ -1874,7 +1580,7 @@
<add-function signature="__iter__()" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="__iter_parent__">
- <replace from="%CPPSELF_TYPE" to="QTextFrame::iterator" />
+ <replace from="%CPPSELF_TYPE" to="QTextFrame::iterator"/>
</insert-template>
</inject-code>
</add-function>
@@ -1884,7 +1590,7 @@
<include file-name="QRect" location="global"/>
</extra-includes>
<enum-type name="ImageOption"/>
- <enum-type name="Transformation" flags="Transformations" since="5.5" />
+ <enum-type name="Transformation" flags="Transformations" since="5.5"/>
<modify-function signature="setDevice(QIODevice*)">
<modify-argument index="1">
<parent index="this" action="add"/>
@@ -1903,7 +1609,7 @@
<enum-type name="ImageReaderError"/>
<!-- ### This method does not make sense in Python.
Update: perhaps it does, but no one is missing it. -->
- <modify-function signature="read(QImage*)" remove="all" />
+ <modify-function signature="read(QImage*)" remove="all"/>
<modify-function signature="setDevice(QIODevice*)">
<modify-argument index="1">
<parent index="this" action="add"/>
@@ -1964,170 +1670,135 @@
</extra-includes>
<modify-function signature="takeItem(int,int)">
<modify-argument index="return">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
<modify-function signature="takeHorizontalHeaderItem(int)">
<modify-argument index="return">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
<modify-function signature="takeVerticalHeaderItem(int)">
<modify-argument index="return">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
<modify-function signature="verticalHeaderItem(int)const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="horizontalHeaderItem(int)const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="invisibleRootItem()const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="item(int,int)const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="itemFromIndex(const QModelIndex&amp;)const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="itemPrototype()const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="appendRow(const QList&lt;QStandardItem*&gt;&amp;)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="appendRow(QStandardItem*)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="insertRow(int,QStandardItem*)">
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setHorizontalHeaderItem(int,QStandardItem*)">
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setItem(int,int,QStandardItem*)">
- <inject-code class="target" position="beginning">
- // Clear parent from the old child
- QStandardItem *_i = %CPPSELF->item(%1, %2);
- if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::Object::setParent(0, _pyI);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditemmodel-setitem-1"/>
<modify-argument index="3">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setItem(int,QStandardItem*)">
- <inject-code class="target" position="beginning">
- // Clear parent from the old child
- QStandardItem *_i = %CPPSELF->item(%1);
- if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::Object::setParent(0, _pyI);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditemmodel-setitem-2"/>
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setItemPrototype(const QStandardItem*)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="setVerticalHeaderItem(int,QStandardItem*)">
- <inject-code class="target" position="beginning">
- // Clear parent from the old child
- QStandardItem *_i = %CPPSELF->verticalHeaderItem(%1);
- if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::Object::setParent(0, _pyI);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditemmodel-setverticalheaderitem"/>
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="takeColumn(int)">
<modify-argument index="return">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
<modify-function signature="takeRow(int)">
<modify-argument index="return">
- <parent index="this" action="remove" />
+ <parent index="this" action="remove"/>
</modify-argument>
</modify-function>
<modify-function signature="findItems(const QString&amp;,QFlags&lt;Qt::MatchFlag&gt;,int)const">
<modify-argument index="return">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="insertColumn(int,const QList&lt;QStandardItem*&gt;&amp;)">
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="insertRow(int,const QList&lt;QStandardItem*&gt;&amp;)">
<modify-argument index="2">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="appendColumn(const QList&lt;QStandardItem*&gt;&amp;)">
<modify-argument index="1">
- <parent index="this" action="add" />
+ <parent index="this" action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="clear()">
- <inject-code class="target" position="beginning">
- Shiboken::BindingManager &amp;bm = Shiboken::BindingManager::instance();
- SbkObject *pyRoot = bm.retrieveWrapper(%CPPSELF.invisibleRootItem());
- if (pyRoot) {
- Shiboken::Object::destroy(pyRoot, %CPPSELF.invisibleRootItem());
- }
-
- for (int r=0, r_max = %CPPSELF.rowCount(); r &lt; r_max; r++) {
- QList&lt;QStandardItem *&gt; ri = %CPPSELF.takeRow(0);
-
- PyObject *pyResult = %CONVERTTOPYTHON[QList&lt;QStandardItem * &gt;](ri);
- Shiboken::Object::setParent(Py_None, pyResult);
- Py_XDECREF(pyResult);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qstandarditemmodel-clear"/>
</modify-function>
</object-type>
<object-type name="QClipboard">
@@ -2135,7 +1806,7 @@
<include file-name="QImage" location="global"/>
<include file-name="QPixmap" location="global"/>
</extra-includes>
- <enum-type name="Mode" />
+ <enum-type name="Mode"/>
<modify-function signature="setMimeData(QMimeData*,QClipboard::Mode)">
<modify-argument index="1">
<!-- TODO: maybe this is not the best solution -->
@@ -2149,14 +1820,7 @@
<modify-argument index="return">
<replace-type modified-type="(retval, subtype)"/>
</modify-argument>
- <inject-code class="target" position="end">
- %BEGIN_ALLOW_THREADS
- %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
- %END_ALLOW_THREADS
- %PYARG_0 = PyTuple_New(2);
- PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
- PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));
- </inject-code>
+ <inject-code class="target" position="end" file="../glue/qtgui.cpp" snippet="qclipboard-text"/>
</modify-function>
</object-type>
<object-type name="QPaintEngineState">
@@ -2203,9 +1867,9 @@
<parent index="this" action="add"/>
</modify-argument>
</modify-function>
- <modify-function signature="print(QPagedPaintDevice*)const" rename="print_" />
+ <modify-function signature="print(QPagedPaintDevice*)const" rename="print_"/>
</object-type>
- <object-type name="QTextDocumentWriter" since="4.5" />
+ <object-type name="QTextDocumentWriter" since="4.5"/>
<object-type name="QTextTable">
<extra-includes>
<include file-name="QTextCursor" location="global"/>
@@ -2252,64 +1916,56 @@
%END_ALLOW_THREADS
</template>
- <modify-function signature="drawConvexPolygon(const QPoint*,int)" remove="all" />
+ <modify-function signature="drawConvexPolygon(const QPoint*,int)" remove="all"/>
<add-function signature="drawConvexPolygon(QVector&lt;QPoint>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
- <modify-function signature="drawConvexPolygon(const QPointF*,int)" remove="all" />
+ <modify-function signature="drawConvexPolygon(const QPointF*,int)" remove="all"/>
<add-function signature="drawConvexPolygon(QVector&lt;QPointF>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
<!-- ### Overloads using QVector<T> does the job of these methods -->
- <modify-function signature="drawLines(const QLine*,int)" remove="all" />
- <modify-function signature="drawLines(const QLineF*,int)" remove="all" />
- <modify-function signature="drawLines(const QPoint*,int)" remove="all" />
- <modify-function signature="drawLines(const QPointF*,int)" remove="all" />
- <modify-function signature="drawRects(const QRect*,int)" remove="all" />
- <modify-function signature="drawRects(const QRectF*,int)" remove="all" />
+ <modify-function signature="drawLines(const QLine*,int)" remove="all"/>
+ <modify-function signature="drawLines(const QLineF*,int)" remove="all"/>
+ <modify-function signature="drawLines(const QPoint*,int)" remove="all"/>
+ <modify-function signature="drawLines(const QPointF*,int)" remove="all"/>
+ <modify-function signature="drawRects(const QRect*,int)" remove="all"/>
+ <modify-function signature="drawRects(const QRectF*,int)" remove="all"/>
<!-- ### -->
- <modify-function signature="drawPoints(const QPoint*,int)" remove="all" />
+ <modify-function signature="drawPoints(const QPoint*,int)" remove="all"/>
<add-function signature="drawPoints(QVector&lt;QPoint>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
- <modify-function signature="drawPoints(const QPointF*,int)" remove="all" />
+ <modify-function signature="drawPoints(const QPointF*,int)" remove="all"/>
<add-function signature="drawPoints(QVector&lt;QPointF>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
- <modify-function signature="drawPolygon(const QPoint*,int,Qt::FillRule)" remove="all" />
+ <modify-function signature="drawPolygon(const QPoint*,int,Qt::FillRule)" remove="all"/>
<add-function signature="drawPolygon(QVector&lt;QPoint>,Qt::FillRule)">
- <inject-code>
- %BEGIN_ALLOW_THREADS
- %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2);
- %END_ALLOW_THREADS
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpainter-drawpolygon"/>
</add-function>
- <modify-function signature="drawPolygon(const QPointF*,int,Qt::FillRule)" remove="all" />
+ <modify-function signature="drawPolygon(const QPointF*,int,Qt::FillRule)" remove="all"/>
<add-function signature="drawPolygon(QVector&lt;QPointF>,Qt::FillRule)">
- <inject-code>
- %BEGIN_ALLOW_THREADS
- %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2);
- %END_ALLOW_THREADS
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qpainter-drawpolygon"/>
</add-function>
- <modify-function signature="drawPolyline(const QPoint*,int)" remove="all" />
+ <modify-function signature="drawPolyline(const QPoint*,int)" remove="all"/>
<add-function signature="drawPolyline(QVector&lt;QPoint>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
- <modify-function signature="drawPolyline(const QPointF*,int)" remove="all" />
+ <modify-function signature="drawPolyline(const QPointF*,int)" remove="all"/>
<add-function signature="drawPolyline(QVector&lt;QPointF>)">
<inject-code>
- <insert-template name="qpainter_drawlist" />
+ <insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
<modify-function signature="drawRoundRect(int,int,int,int,int,int)">
@@ -2389,8 +2045,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="4" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="4"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2398,22 +2054,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="4" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="4"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix2x2(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="4" />
+ <replace from="%SIZE" to="4"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="4" />
+ <replace from="%MATRIX_SIZE" to="4"/>
</insert-template>
</inject-code>
</add-function>
@@ -2427,8 +2083,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="6" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="6"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2436,22 +2092,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="6" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix2x3(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="6" />
+ <replace from="%SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="6" />
+ <replace from="%MATRIX_SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
@@ -2465,8 +2121,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="8" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="8"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2474,22 +2130,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="8" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix2x4(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="8" />
+ <replace from="%SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="8" />
+ <replace from="%MATRIX_SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
@@ -2503,8 +2159,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="6" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="6"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2512,22 +2168,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="6" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix3x2(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="6" />
+ <replace from="%SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="6" />
+ <replace from="%MATRIX_SIZE" to="6"/>
</insert-template>
</inject-code>
</add-function>
@@ -2541,8 +2197,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="9" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="9"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2550,22 +2206,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="9" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="9"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix3x3(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="9" />
+ <replace from="%SIZE" to="9"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="9" />
+ <replace from="%MATRIX_SIZE" to="9"/>
</insert-template>
</inject-code>
</add-function>
@@ -2579,8 +2235,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="12" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="12"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2588,22 +2244,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="12" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix3x4(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="12" />
+ <replace from="%SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="12" />
+ <replace from="%MATRIX_SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
@@ -2616,8 +2272,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="8" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="8"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2625,22 +2281,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="8" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix4x2(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="8" />
+ <replace from="%SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="8" />
+ <replace from="%MATRIX_SIZE" to="8"/>
</insert-template>
</inject-code>
</add-function>
@@ -2654,8 +2310,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="12" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="12"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2663,22 +2319,22 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="12" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="QMatrix4x3(PySequence*)">
<inject-code class="target" position="beginning">
<insert-template name="matrix_constructor">
- <replace from="%SIZE" to="12" />
+ <replace from="%SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
<add-function signature="data()" return-type="float">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="12" />
+ <replace from="%MATRIX_SIZE" to="12"/>
</insert-template>
</inject-code>
</add-function>
@@ -2710,8 +2366,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code_matrix">
- <replace from="%MATRIX_SIZE" to="16" />
- <replace from="%MATRIX_TYPE" to="float" />
+ <replace from="%MATRIX_SIZE" to="16"/>
+ <replace from="%MATRIX_TYPE" to="float"/>
</insert-template>
</inject-code>
</add-function>
@@ -2719,8 +2375,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code_matrix">
- <replace from="%MATRIX_TYPE" to="float" />
- <replace from="%MATRIX_SIZE" to="16" />
+ <replace from="%MATRIX_TYPE" to="float"/>
+ <replace from="%MATRIX_SIZE" to="16"/>
</insert-template>
</inject-code>
</add-function>
@@ -2730,27 +2386,14 @@
<modify-function signature="QMatrix4x4(const float*)">
<modify-argument index="1">
- <replace-type modified-type="PySequence" />
+ <replace-type modified-type="PySequence"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- if (PySequence_Size(%PYARG_1) == 16) {
- float values[16];
- for (int i=0; i &lt; 16; i++) {
- PyObject *pv = PySequence_Fast_GET_ITEM(%PYARG_1, i);
- values[i] = PyFloat_AsDouble(pv);
- }
-
- %0 = new %TYPE(values[0], values[1], values[2], values[3],
- values[4], values[5], values[6], values[7],
- values[8], values[9], values[10], values[11],
- values[12], values[13], values[14], values[15]);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qmatrix4x4"/>
</modify-function>
<modify-function signature="data()">
<inject-code class="target" position="beginning">
<insert-template name="matrix_data_function">
- <replace from="%MATRIX_SIZE" to="16" />
+ <replace from="%MATRIX_SIZE" to="16"/>
</insert-template>
</inject-code>
</modify-function>
@@ -2761,15 +2404,7 @@
<modify-argument index="return">
<replace-type modified-type="PyTupleObject*"/>
</modify-argument>
- <inject-code class="target" position="beginning">
- float values[16];
- %CPPSELF.%FUNCTION_NAME(values);
- %PYARG_0 = PyTuple_New(16);
- for (int i = 0; i &lt; 16; i++) {
- PyObject *v = PyFloat_FromDouble(values[i]);
- PyTuple_SET_ITEM(%PYARG_0, i, v);
- }
- </inject-code>
+ <inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qmatrix4x4-copydatato"/>
</modify-function>
<modify-function signature="inverted(bool*)const">
@@ -2791,21 +2426,7 @@
<modify-function signature="operator()(int,int)const" remove="all"/>
<modify-function signature="operator()(int,int)" remove="all"/>
<add-function signature="__mgetitem__" return-type="PyObject*">
- <inject-code>
- if (PySequence_Check(_key)) {
- Shiboken::AutoDecRef key(PySequence_Fast(_key, "Invalid matrix index."));
- if (PySequence_Fast_GET_SIZE(key.object()) == 2) {
- PyObject *posx = PySequence_Fast_GET_ITEM(key.object(), 0);
- PyObject *posy = PySequence_Fast_GET_ITEM(key.object(), 1);
- Py_ssize_t x = PyInt_AsSsize_t(posx);
- Py_ssize_t y = PyInt_AsSsize_t(posy);
- float ret = (*%CPPSELF)(x,y);
- return %CONVERTTOPYTHON[float](ret);
- }
- }
- PyErr_SetString(PyExc_IndexError, "Invalid matrix index.");
- return 0;
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qmatrix4x4-mgetitem"/>
</add-function>
</value-type>
@@ -2815,8 +2436,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2824,16 +2445,16 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dddd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
+ <replace from="%REDUCE_FORMAT" to="dddd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()"/>
</insert-template>
</inject-code>
</add-function>
<!-- Qt5.5: XXX support the output variables! For now, I just suppressed the new methods. -->
- <modify-function signature="getAxisAndAngle(float*,float*,float*,float*)const" since="5.5" remove="all" />
- <modify-function signature="getAxisAndAngle(QVector3D*,float*)const" since="5.5" remove="all" />
- <modify-function signature="getEulerAngles(float*,float*,float*)const" since="5.5" remove="all" />
+ <modify-function signature="getAxisAndAngle(float*,float*,float*,float*)const" since="5.5" remove="all"/>
+ <modify-function signature="getAxisAndAngle(QVector3D*,float*)const" since="5.5" remove="all"/>
+ <modify-function signature="getEulerAngles(float*,float*,float*)const" since="5.5" remove="all"/>
</value-type>
<object-type name="QTouchEvent" since="4.6">
@@ -2843,16 +2464,16 @@
</object-type>
<object-type name="QTouchDevice">
- <enum-type name="CapabilityFlag" flags="Capabilities" />
- <enum-type name="DeviceType" />
+ <enum-type name="CapabilityFlag" flags="Capabilities"/>
+ <enum-type name="DeviceType"/>
</object-type>
<value-type name="QVector2D" since="4.6">
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%REPR_FORMAT" to="%f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2860,8 +2481,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%REDUCE_FORMAT" to="dd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2869,8 +2490,8 @@
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="dd" />
- <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
+ <replace from="%TT_FORMAT" to="dd"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2883,8 +2504,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2892,8 +2513,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="ddd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
+ <replace from="%REDUCE_FORMAT" to="ddd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2901,8 +2522,8 @@
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="ddd" />
- <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
+ <replace from="%TT_FORMAT" to="ddd"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2915,8 +2536,8 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f, %f" />
- <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()" />
+ <replace from="%REPR_FORMAT" to="%f, %f, %f, %f"/>
+ <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2924,8 +2545,8 @@
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dddd" />
- <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()" />
+ <replace from="%REDUCE_FORMAT" to="dddd"/>
+ <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2933,8 +2554,8 @@
<add-function signature="toTuple" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="to_tuple">
- <replace from="%TT_FORMAT" to="dddd" />
- <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()" />
+ <replace from="%TT_FORMAT" to="dddd"/>
+ <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()"/>
</insert-template>
</inject-code>
</add-function>
@@ -2960,7 +2581,7 @@
</object-type>
<!-- This enum is present on QtCore -->
- <suppress-warning text="enum 'QCoreApplication::ApplicationFlags' is specified in typesystem, but not declared" />
+ <suppress-warning text="enum 'QCoreApplication::ApplicationFlags' is specified in typesystem, but not declared"/>
<!-- Qt5: here the new QWindow stuff and what it pulls in -->
<object-type name="QBackingStore"/>
@@ -2986,7 +2607,7 @@
<object-type name="QWindow" delete-in-main-thread="true">
<enum-type name="AncestorMode"/>
<enum-type name="Visibility"/>
- <modify-function signature="raise()" rename="raise_" />
+ <modify-function signature="raise()" rename="raise_"/>
<!-- see QWidget::nativeEvent(), QAbstractNativeEventFilter::nativeEventFilter() -->
<modify-function signature="nativeEvent(const QByteArray &amp;,void*,long*)">
<modify-argument index="3">
@@ -3016,32 +2637,25 @@
<include file-name="QIcon" location="global"/>
<include file-name="QLocale" location="global"/>
</extra-includes>
- <modify-function signature="QGuiApplication(int&amp;,char**,int)" access="private" />
+ <modify-function signature="QGuiApplication(int&amp;,char**,int)" access="private"/>
<add-function signature="QGuiApplication(QStringList)">
- <inject-code>
- QGuiApplicationConstructor(%PYSELF, args, &amp;%0);
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qguiapplication-1"/>
</add-function>
<add-function signature="QGuiApplication()">
- <inject-code>
- PyObject *empty = PyTuple_New(2);
- if (!PyTuple_SetItem(empty, 0, PyList_New(0))) {
- QGuiApplicationConstructor(%PYSELF, empty, &amp;%0);
- }
- </inject-code>
+ <inject-code file="../glue/qtgui.cpp" snippet="qguiapplication-2"/>
</add-function>
- <inject-code class="native" file="glue/qguiapplication_init.cpp" position="beginning" />
+ <inject-code class="native" file="glue/qguiapplication_init.cpp" position="beginning"/>
</object-type>
<object-type name="QOpenGLBuffer" since="5.0">
- <enum-type name="Access" />
- <enum-type name="RangeAccessFlag" flags="RangeAccessFlags" />
- <enum-type name="Type" />
- <enum-type name="UsagePattern" />
+ <enum-type name="Access"/>
+ <enum-type name="RangeAccessFlag" flags="RangeAccessFlags"/>
+ <enum-type name="Type"/>
+ <enum-type name="UsagePattern"/>
</object-type>
<object-type name="QOpenGLContext">
- <enum-type name="OpenGLModuleType" />
+ <enum-type name="OpenGLModuleType"/>
</object-type>
<object-type name="QOpenGLContextGroup" since="5.0"/>
<object-type name="QOpenGLDebugLogger" since="5.1">
@@ -3053,7 +2667,7 @@
<enum-type name="Severity" flags="Severities"/>
</value-type>
<object-type name="QOpenGLFramebufferObject" since="5.0">
- <enum-type name="Attachment" />
+ <enum-type name="Attachment"/>
<enum-type name="FramebufferRestorePolicy" since="5.7"/>
</object-type>
<value-type name="QOpenGLFramebufferObjectFormat"/>
@@ -3271,7 +2885,7 @@
</modify-function>
<modify-function signature="glGetStringi(unsigned int,unsigned int)">
<modify-argument index="return">
- <replace-type modified-type="QString" />
+ <replace-type modified-type="QString"/>
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="glGetString_return_QString"/>
@@ -3332,7 +2946,7 @@
</modify-function>
<modify-function signature="glGetString(unsigned int)">
<modify-argument index="return">
- <replace-type modified-type="QString" />
+ <replace-type modified-type="QString"/>
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="glGetString_return_QString"/>
@@ -3371,7 +2985,7 @@
-->
<value-type name="QOpenGLPixelTransferOptions"/>
<object-type name="QOpenGLShader" since="5.0">
- <enum-type name="ShaderTypeBit" flags="ShaderType" />
+ <enum-type name="ShaderTypeBit" flags="ShaderType"/>
</object-type>
<object-type name="QOpenGLShaderProgram" since="5.0">
<modify-function signature="setAttributeArray(int,const float*,int,int)">
@@ -3470,7 +3084,7 @@
<modify-function signature="glyphIndexesForChars(const QChar*,int,quint32*,int*)const" remove="all"/>
</value-type>
<object-type name="QRasterWindow"/>
- <object-type name="QScreen" />
+ <object-type name="QScreen"/>
<object-type name="QStyleHints"/>
</typesystem>