Is it possible to embed C++ widget to PyQt application?

后端 未结 2 1076
灰色年华
灰色年华 2020-12-16 06:50

I have a PyQt5 application and most widgets written in Python. I want to write some widget in C++ Qt to make it faster and then embed it into my PyQt QMainWindow.

Is

2条回答
  •  清酒与你
    2020-12-16 07:08

    You can use SIP to create bindings for your C++ code the same way that the PyQt bindings are made.

    However, the bindings generated by SIP are themselves C++ code, and in the case of PyQt link directly into the Qt binaries. If you just intend to rewrite PyQt code as C++ then any speedup realised will be negligible, as very little native python is executed in the first place.

提交回复
热议问题