0

I am trying to understand if it is possible to include a PyQt5 widget inside my Qt-C++ application.

There is a lot of information about wrapping C++ class into python and using it from the python side, however, my question is the opposite.

I tried boost-python, pythonqt, and some other resources, but none of them give a clear answer whether it is possible or not. Mostly they allow to call python scripts and, in case of pythonqt, as I could understand, connect signals and slots, but not to attach one object to another.

Explanation: I have a widget in PyQt5 inherited from QWidget and I need to use it in my QMainWindow in C++.

Is it possible to achieve this? And if so, how can I do it?

Eugene Kolesnikov
  • 643
  • 2
  • 6
  • 15
  • Surely it would be far simpler to just port it to c++? – ekhumoro Apr 12 '19 at 21:33
  • The widget is rather complicated and in case what I asked is not feasible, I will lean towards serious compromises rather than a full port of the widget. – Eugene Kolesnikov Apr 12 '19 at 21:39
  • I would guess that if there was a such a solution, it would still require substantial rewriting of the existing widget. There is a [PythonQt_QtAll library](http://pythonqt.sourceforge.net/Features.html) which seems to offer something similar to what you're after - but I doubt whether you can just drop in the code from your pyqt widget and expect it to work out of the box. – ekhumoro Apr 12 '19 at 22:03

0 Answers0