python-qwt, QPaintDevice wrapping and dynamic signals
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
Hi guys,
I'm trying to use PythonQt as a backend to a pure python implementation of Qwt (https://github.com/PierreRaybaut/python-qwt). However, it seems to me that the QPaintEngine is being wrapped incorrectly due to its rather strange interface, such as
drawLines(const QLine * lines, int lineCount)
which takes in an array as a pointer-count pair. It seems to me that this is being wrapped as a (QLine, int) by PythonQt and thus the whole painting process fails.In addition, is it correct that PythonQt doesn't have an analog for
pyqtSignal
? Or is there a way to declare signals for python classes inheriting from PythonQt wrappers of Qt objects?Thanks,
Rostislav.
Yes, there are several places in the Qt api that are not wrapped completely in PythonQt.
The reason is that the typesystem is more or less a one man show and I did not spend much time on individual methods when they were not needed in my projects.
These methods require additional wrapper methods that take a Python sequence and make sure that it only contains lines. If someone wants to contribute these methods, I can add them. Such methods take a PyObject* as sequence argument and need to do the type checking using the Python C api.
Regarding pyqtsignal, this is currently not supported in PythonQt... I looked into it and it requires quite some QMetaObject generation magic. It is on my nice to have list, but I don't know if it will make it to the top of the list.
Hello Florian,
thanks for the info! Seems like using matplotlib using your backend modifications from MeVisLab will be much easier than python-qwt (although at least 1.4.3 also uses Signal(), but 1.1.0 will likely be good enough for me).
The only weird behavior is that after PythonQt initialization, QObject ends up in PythonQt.private as opposed to PythonQt.QtCore. Have you ever seen anything like this?
Last edit: Rostislav Khlebnikov 2015-09-30