Fix bug 631 - "QSocketNotifier: Accept file-like object (with .fileno() method) in constructor"
This commit is contained in:
parent
0d2705eb11
commit
80c1011721
1 changed files with 14 additions and 0 deletions
|
|
@ -2104,6 +2104,20 @@
|
|||
</object-type>
|
||||
<object-type name="QSocketNotifier">
|
||||
<enum-type name="Type"/>
|
||||
<add-function signature="QSocketNotifier(PyObject*, QSocketNotifier::Type, QObject*)">
|
||||
<modify-argument index="3">
|
||||
<replace-default-expression with="0" />
|
||||
<rename to="parent" />
|
||||
</modify-argument>
|
||||
<inject-code>
|
||||
Shiboken::AutoDecRef fileNo(PyObject_GetAttrString(%PYARG_1, "fileno"));
|
||||
if (!fileNo.isNull()) {
|
||||
Shiboken::AutoDecRef fileNoValue(PyObject_CallObject(fileNo, 0));
|
||||
if (Shiboken::Converter<int>::checkType(fileNoValue))
|
||||
%0 = new %TYPE(%CONVERTTOCPP[int](fileNoValue), %2, %3);
|
||||
}
|
||||
</inject-code>
|
||||
</add-function>
|
||||
</object-type>
|
||||
<object-type name="QSystemLocale">
|
||||
<enum-type name="QueryType"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue