简体   繁体   English

C ++应用程序中的PyQt4插件

[英]PyQt4 plugin in c++ application

How is it posible to load python script as plugin in qt based application? 在基于qt的应用程序中如何将python脚本作为插件加载?

The basic idea would be to make a class in c++ 基本思想是用C ++编写一个类

class b { virtual void method1(); virtual void method2(); }

and 'somehow' inherit it in python like 并且以某种方式在python中继承它

class c(b): def method1: #do something def method2: #do something

I need to be able to modify the gui from python( add buttons to some widgets made in c++ with qt ). 我需要能够从python修改gui(将按钮添加到使用qt在c ++中制作的一些小部件)。 Basicaly something similiar to (gedit, blender, etc) plugin architecture with qt 基本上是与Qt(gedit,blender等)插件架构类似的东西

我认为您首先需要使用Python C API或使用Boost :: PythonSwig公开C ++方法,然后 Python 嵌入应用程序中以执行自定义的Python脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM