Reputation: 7313
In I my attempts at creating a GUI (a document viewer) with PyQt4, failing reproduce the quality of existing programs, it has been suggested I should use those existing program's Qt4 Widgets (Okular's to be precise), rather than re-inventing the wheel.
Fair enough, but those Qt4 widgets are written in C++: how am I supposed to call them from the Python side? And does it require me to learn C (in which case I'd rather put more time in figuring out a fully Pythonic solution)?
Upvotes: 0
Views: 191
Reputation: 69022
Qt
isn't written in C, its's written in C++, and so is Okular
.
Unfortunately getting C++ libraries to work with python is not as easy as using C libraries through ctypes
. To do that, you'll need to write some wrapper code around the C++ APIs to get it working.
Some ways to do that:
sip
- used by PyQtshiboken
- used by PySidecython
can also be used to wrap C++, don't know if it plays well with QtUpvotes: 1