aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore
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>2012-03-08 16:54:27 -0300
commit928fa00609e9e2be428bd7386c62b8c601b4173a (patch)
tree5fb825277bbee31c4c583a00edb2d77008ab8615 /PySide/QtCore
parent542adc0452cfec99948b07e51e9701740ea38fba (diff)
Fix bug 631 - "QSocketNotifier: Accept file-like object (with .fileno() method) in constructor"
Diffstat (limited to 'PySide/QtCore')
-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 3183663bb..d13e3c762 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -2096,6 +2096,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"/>