commontk / PythonQt

CMake-ified version of PythonQt
https://mevislab.github.io/pythonqt/
GNU Lesser General Public License v2.1
67 stars 83 forks source link

Expose QSocketNotifier for Qt5 #63

Closed pieper closed 6 years ago

pieper commented 6 years ago

Apparently a bug in the generator (not yet identified) results in QSocketNotifier being only partially wrapped and new instances cannot be created from python and the following error instead:

>>> qsn = qt.QSocketNotifier()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ValueError: No constructors available for QSocketNotifier

This patch copies over the generated code from the Qt4.8 version and works around the issue until the generator issue can be identified.

pieper commented 6 years ago

I posted this to the PythonQt forum so we'll see if anyone knows a better solution.

https://sourceforge.net/p/pythonqt/discussion/631392/thread/c989429c/

If we don't like the idea of patching the generated code, another workaround for me would be to add a qSlicerSocketNotifer in Slicer and make sure that is wrapped correctly. But fixing this PR seemed like the more generally useful solution.

jcfr commented 6 years ago

Thanks @pieper , this looks like a reasonable solution 👍

jcfr commented 6 years ago

Also added a note to the README file. See https://github.com/commontk/PythonQt/commit/f04eb5f147b83dc8a90c8e070ea6c98c62f8806b