Fixes Bug #757 - Constructor "QPixmap(const char* const[] xpm)" missing.
http://bugs.pyside.org/show_bug.cgi?id=757 Reviewer: Renato Araujo <renato.filho@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
This commit is contained in:
parent
a5b785fff4
commit
13f6d71f20
1 changed files with 31 additions and 12 deletions
|
|
@ -659,24 +659,43 @@
|
||||||
</value-type>
|
</value-type>
|
||||||
<value-type name="QPixmap" >
|
<value-type name="QPixmap" >
|
||||||
<conversion-rule file="qpixmap_conversion.h" />
|
<conversion-rule file="qpixmap_conversion.h" />
|
||||||
<extra-includes>
|
<add-function signature="QPixmap(const QImage&)">
|
||||||
<include file-name="QVariant" location="global"/>
|
<modify-argument index="1">
|
||||||
</extra-includes>
|
<rename to="image"/>
|
||||||
<add-function signature="QPixmap(QVariant)">
|
</modify-argument>
|
||||||
<inject-code class="target" position="beginning">
|
<inject-code class="target" position="beginning">
|
||||||
if (%1.type() == QVariant::Pixmap)
|
%0 = new %TYPE(QPixmap::fromImage(%1));
|
||||||
%0 = new %TYPE(%1.value<QPixmap>());
|
|
||||||
else if (%1.type() == QVariant::Image)
|
|
||||||
%0 = new %TYPE(QPixmap::fromImage(%1.value<QImage>()));
|
|
||||||
else
|
|
||||||
PyErr_SetString(PyExc_TypeError, "QVariant must be holding a QPixmap");
|
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</add-function>
|
||||||
|
<modify-function signature="QPixmap(const char **)">
|
||||||
|
<modify-argument index="1">
|
||||||
|
<replace-type modified-type="PySequence" />
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
Shiboken::AutoDecRef strList(PySequence_Fast(%PYARG_1, "Invalid sequence."));
|
||||||
|
int lineCount = PySequence_Fast_GET_SIZE(strList.object());
|
||||||
|
for (int line = 0; line < lineCount; ++line) {
|
||||||
|
if (!PyString_Check(PySequence_Fast_GET_ITEM(strList.object(), line))) {
|
||||||
|
PyErr_SetString(PyExc_TypeError, "The argument must be a sequence of strings.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char** xpm = (const char**) malloc (lineCount * sizeof(const char**));
|
||||||
|
for (int line = 0; line < lineCount; ++line) {
|
||||||
|
xpm[line] = PyString_AS_STRING(PySequence_Fast_GET_ITEM(strList.object(), line));
|
||||||
|
}
|
||||||
|
|
||||||
|
%BEGIN_ALLOW_THREADS
|
||||||
|
%0 = new %TYPE(xpm);
|
||||||
|
%END_ALLOW_THREADS
|
||||||
|
|
||||||
|
free(xpm);
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
|
|
||||||
<!-- ### Operator ! doesn't make sense in Python. -->
|
<!-- ### Operator ! doesn't make sense in Python. -->
|
||||||
<modify-function signature="operator!()const" remove="all"/>
|
<modify-function signature="operator!()const" remove="all"/>
|
||||||
<!-- ### See bug 757 -->
|
|
||||||
<modify-function signature="QPixmap(const char **)" remove="all"/>
|
|
||||||
<!--### Obsolete in 4.3-->
|
<!--### Obsolete in 4.3-->
|
||||||
<modify-function signature="serialNumber()const" remove="all"/>
|
<modify-function signature="serialNumber()const" remove="all"/>
|
||||||
<!-- ### -->
|
<!-- ### -->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue