diff options
-rw-r--r-- | PySide/QtCore/typesystem_core.xml | 58 | ||||
-rw-r--r-- | PySide/QtGui/typesystem_gui_common.xml | 66 |
2 files changed, 124 insertions, 0 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index a1dd5b676..3856120bb 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -455,6 +455,15 @@ } }; </inject-code> + + <add-function signature="toTuple" return-type="PyObject*"> + <inject-code class="target" position="beginning"> + <insert-template name="to_tuple"> + <replace from="%TT_FORMAT" to="iiii" /> + <replace from="%TT_ARGS" to="%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()" /> + </insert-template> + </inject-code> + </add-function> </value-type> <value-type name="QLineF"> <enum-type name="IntersectType" /> @@ -475,6 +484,15 @@ </insert-template> </inject-code> </add-function> + + <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.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()" /> + </insert-template> + </inject-code> + </add-function> <modify-function signature="intersect(QLineF, QPointF*)const"> <modify-argument index="2"> <remove-argument /> @@ -669,6 +687,16 @@ } }; </inject-code> + + <add-function signature="toTuple" return-type="PyObject*"> + <inject-code class="target" position="beginning"> + <insert-template name="to_tuple"> + <replace from="%TT_FORMAT" to="ii" /> + <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" /> + </insert-template> + </inject-code> + </add-function> + <!--### Functions removed because they return references to Python imutable objects --> <modify-function signature="rx()" remove="all"/> <modify-function signature="ry()" remove="all"/> @@ -692,6 +720,16 @@ </insert-template> </inject-code> </add-function> + + <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()" /> + </insert-template> + </inject-code> + </add-function> + <!--### Functions removed because they return references to Python imutable objects --> <modify-function signature="rx()" remove="all"/> <modify-function signature="ry()" remove="all"/> @@ -858,6 +896,16 @@ } }; </inject-code> + + <add-function signature="toTuple" return-type="PyObject*"> + <inject-code class="target" position="beginning"> + <insert-template name="to_tuple"> + <replace from="%TT_FORMAT" to="ii" /> + <replace from="%TT_ARGS" to="%CPPSELF.width(), %CPPSELF.height()" /> + </insert-template> + </inject-code> + </add-function> + <!--### Functions removed because they return references to Python imutable objects --> <modify-function signature="rheight()" remove="all"/> <modify-function signature="rwidth()" remove="all"/> @@ -881,6 +929,16 @@ </insert-template> </inject-code> </add-function> + + <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.width(), %CPPSELF.height()" /> + </insert-template> + </inject-code> + </add-function> + <!--### Functions removed because they return references to Python imutable objects --> <modify-function signature="rheight()" remove="all" /> <modify-function signature="rwidth()" remove="all" /> diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml index 482234059..6cfe6eb97 100644 --- a/PySide/QtGui/typesystem_gui_common.xml +++ b/PySide/QtGui/typesystem_gui_common.xml @@ -1158,6 +1158,43 @@ } </inject-code> </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(&r, &g, &b, &a); + %PYARG_0 = Py_BuildValue("iiii", r, g, b, a); + break; + } + case QColor::Hsv: + { + int h, s, v, a; + %CPPSELF.getHsv(&h, &s, &v, &a); + %PYARG_0 = Py_BuildValue("iiii", h, s, v, a); + break; + } + case QColor::Cmyk: + { + int c, m, y, k, a; + %CPPSELF.getCmyk(&c, &m, &y, &k, &a); + %PYARG_0 = Py_BuildValue("iiiii", c, m, y, k, a); + break; + } + case QColor::Hsl: + { + int h, s, l, a; + %CPPSELF.getHsv(&h, &s, &l, &a); + %PYARG_0 = Py_BuildValue("iiii", h, s, l, a); + break; + } + default: + %PYARG_0 = 0; + } + </inject-code> + </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. --> @@ -6533,6 +6570,16 @@ </insert-template> </inject-code> </add-function> + + <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()" /> + </insert-template> + </inject-code> + </add-function> + </value-type> <value-type name="QVector3D" since="4.6"> <extra-includes> @@ -6555,6 +6602,16 @@ </insert-template> </inject-code> </add-function> + + <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()" /> + </insert-template> + </inject-code> + </add-function> + </value-type> <value-type name="QVector4D" since="4.6"> <extra-includes> @@ -6577,6 +6634,15 @@ </insert-template> </inject-code> </add-function> + + <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()" /> + </insert-template> + </inject-code> + </add-function> </value-type> <suppress-warning text="template baseclass 'QGenericMatrix<qreal>' of '*' is not known"/> |