Fix bug #606
Add toTuple() function to these all classes:
- QPoint/QPointF/QSize/QSizeF/QVector2D/QVector3D/QVector4D
- QLine/QLineF/QColor
Signed-off-by: Paulo Alcantara <paulo.alcantara@openbossa.org>
Reviewer: Lauro Moura <lauro.neto@openbossa.org>
Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
parent
7780ccddc1
commit
a8b02e046b
2 changed files with 124 additions and 0 deletions
|
|
@ -455,6 +455,15 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</inject-code>
|
</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>
|
||||||
<value-type name="QLineF">
|
<value-type name="QLineF">
|
||||||
<enum-type name="IntersectType" />
|
<enum-type name="IntersectType" />
|
||||||
|
|
@ -475,6 +484,15 @@
|
||||||
</insert-template>
|
</insert-template>
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</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-function signature="intersect(QLineF, QPointF*)const">
|
||||||
<modify-argument index="2">
|
<modify-argument index="2">
|
||||||
<remove-argument />
|
<remove-argument />
|
||||||
|
|
@ -677,6 +695,16 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</inject-code>
|
</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 -->
|
<!--### Functions removed because they return references to Python imutable objects -->
|
||||||
<modify-function signature="rx()" remove="all"/>
|
<modify-function signature="rx()" remove="all"/>
|
||||||
<modify-function signature="ry()" remove="all"/>
|
<modify-function signature="ry()" remove="all"/>
|
||||||
|
|
@ -700,6 +728,16 @@
|
||||||
</insert-template>
|
</insert-template>
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</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 -->
|
<!--### Functions removed because they return references to Python imutable objects -->
|
||||||
<modify-function signature="rx()" remove="all"/>
|
<modify-function signature="rx()" remove="all"/>
|
||||||
<modify-function signature="ry()" remove="all"/>
|
<modify-function signature="ry()" remove="all"/>
|
||||||
|
|
@ -866,6 +904,16 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</inject-code>
|
</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 -->
|
<!--### Functions removed because they return references to Python imutable objects -->
|
||||||
<modify-function signature="rheight()" remove="all"/>
|
<modify-function signature="rheight()" remove="all"/>
|
||||||
<modify-function signature="rwidth()" remove="all"/>
|
<modify-function signature="rwidth()" remove="all"/>
|
||||||
|
|
@ -889,6 +937,16 @@
|
||||||
</insert-template>
|
</insert-template>
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</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 -->
|
<!--### Functions removed because they return references to Python imutable objects -->
|
||||||
<modify-function signature="rheight()" remove="all" />
|
<modify-function signature="rheight()" remove="all" />
|
||||||
<modify-function signature="rwidth()" remove="all" />
|
<modify-function signature="rwidth()" remove="all" />
|
||||||
|
|
|
||||||
|
|
@ -1158,6 +1158,43 @@
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</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. -->
|
<!-- ### "QColor(QColor::Spec)" is an internal method. -->
|
||||||
<modify-function signature="QColor(QColor::Spec)" remove="all"/>
|
<modify-function signature="QColor(QColor::Spec)" remove="all"/>
|
||||||
<!-- ### Constructor removed because we already have an overload using QString. -->
|
<!-- ### Constructor removed because we already have an overload using QString. -->
|
||||||
|
|
@ -6533,6 +6570,16 @@
|
||||||
</insert-template>
|
</insert-template>
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</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>
|
||||||
<value-type name="QVector3D" since="4.6">
|
<value-type name="QVector3D" since="4.6">
|
||||||
<extra-includes>
|
<extra-includes>
|
||||||
|
|
@ -6555,6 +6602,16 @@
|
||||||
</insert-template>
|
</insert-template>
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</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>
|
||||||
<value-type name="QVector4D" since="4.6">
|
<value-type name="QVector4D" since="4.6">
|
||||||
<extra-includes>
|
<extra-includes>
|
||||||
|
|
@ -6577,6 +6634,15 @@
|
||||||
</insert-template>
|
</insert-template>
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</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>
|
</value-type>
|
||||||
|
|
||||||
<suppress-warning text="template baseclass 'QGenericMatrix<qreal>' of '*' is not known"/>
|
<suppress-warning text="template baseclass 'QGenericMatrix<qreal>' of '*' is not known"/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue