Fixed QColor.__reduce__ function.
Fixes bug #960. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
530ec26bea
commit
6cdd438491
1 changed files with 5 additions and 5 deletions
|
|
@ -1131,7 +1131,7 @@
|
||||||
case QColor::Hsl:
|
case QColor::Hsl:
|
||||||
{
|
{
|
||||||
qreal h, s, l, a;
|
qreal h, s, l, a;
|
||||||
%CPPSELF.getHsvF(&h, &s, &l, &a);
|
%CPPSELF.getHslF(&h, &s, &l, &a);
|
||||||
QString repr = QString().sprintf("PySide.QtGui.QColor.fromHslF(%.6f, %.6f, %.6f, %.6f)", h, s, l, a);
|
QString repr = QString().sprintf("PySide.QtGui.QColor.fromHslF(%.6f, %.6f, %.6f, %.6f)", h, s, l, a);
|
||||||
%PYARG_0 = PyString_FromString(qPrintable(repr));
|
%PYARG_0 = PyString_FromString(qPrintable(repr));
|
||||||
break;
|
break;
|
||||||
|
|
@ -1156,7 +1156,7 @@
|
||||||
<insert-template name="qcolor_repr" />
|
<insert-template name="qcolor_repr" />
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</add-function>
|
||||||
<add-function signature="__reduce__" return-type="PyObject*">
|
<add-function signature="__reduce__" return-type="PyObject">
|
||||||
<inject-code class="target" position="beginning">
|
<inject-code class="target" position="beginning">
|
||||||
PyObject *createFunction = 0;
|
PyObject *createFunction = 0;
|
||||||
|
|
||||||
|
|
@ -1190,7 +1190,7 @@
|
||||||
{
|
{
|
||||||
qreal h, s, l, a;
|
qreal h, s, l, a;
|
||||||
createFunction = PyObject_GetAttrString(%PYSELF, "fromHslF");
|
createFunction = PyObject_GetAttrString(%PYSELF, "fromHslF");
|
||||||
%CPPSELF.getHsvF(&h, &s, &l, &a);
|
%CPPSELF.getHslF(&h, &s, &l, &a);
|
||||||
%PYARG_0 = Py_BuildValue("(N(ffff))", createFunction, h, s, l, a);
|
%PYARG_0 = Py_BuildValue("(N(ffff))", createFunction, h, s, l, a);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1201,7 +1201,7 @@
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</add-function>
|
||||||
|
|
||||||
<add-function signature="toTuple" return-type="PyObject*">
|
<add-function signature="toTuple" return-type="PyObject">
|
||||||
<inject-code class="target" position="beginning">
|
<inject-code class="target" position="beginning">
|
||||||
switch(%CPPSELF.spec()) {
|
switch(%CPPSELF.spec()) {
|
||||||
case QColor::Rgb:
|
case QColor::Rgb:
|
||||||
|
|
@ -1228,7 +1228,7 @@
|
||||||
case QColor::Hsl:
|
case QColor::Hsl:
|
||||||
{
|
{
|
||||||
int h, s, l, a;
|
int h, s, l, a;
|
||||||
%CPPSELF.getHsv(&h, &s, &l, &a);
|
%CPPSELF.getHsl(&h, &s, &l, &a);
|
||||||
%PYARG_0 = Py_BuildValue("iiii", h, s, l, a);
|
%PYARG_0 = Py_BuildValue("iiii", h, s, l, a);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue