开发者

Can a PyQt program consume a DBus interface that exposes custom C++ types (marhsalled via Qt's MetaType system)? If so, how?

开发者 https://www.devze.com 2023-01-05 14:48 出处:网络
I have a Qt/C++ application that exposes some custom C++ classes via DBus methods (by registering them as MetaTypes, and using annotations in the xml), and I want开发者_运维问答 my PyQt program to con

I have a Qt/C++ application that exposes some custom C++ classes via DBus methods (by registering them as MetaTypes, and using annotations in the xml), and I want开发者_运维问答 my PyQt program to consume these methods.

The problem I see is that the exposed types are C++ classes, not python, so how can I make python aware of these classes?


There is no such thing as 'C++ classes' in D-Bus, it is language-agnostic. All methods, functions, etc. have type signatures expressible in basic D-Bus types (see the spec). Just call those classes, and it should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号