summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-06-02 16:23:21 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2011-06-02 17:53:47 -0300
commit80c101172197fec4b05e8c56029ea13bb43820b0 (patch)
treec510d97a1984eef638c45fa447bb9bed5ae25318
parent0d2705eb113b2a74d2cd4cbfff55ef61cf690f30 (diff)
downloadpyside-80c101172197fec4b05e8c56029ea13bb43820b0.tar.gz
pyside-80c101172197fec4b05e8c56029ea13bb43820b0.tar.xz
pyside-80c101172197fec4b05e8c56029ea13bb43820b0.zip
Fix bug 631 - "QSocketNotifier: Accept file-like object (with .fileno() method) in constructor"
-rw-r--r--PySide/QtCore/typesystem_core.xml14
1 files changed, 14 insertions, 0 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 7d46f23..ec79450 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -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&lt;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"/>