Any idea for running Qt signals/slots over network

2019-04-22 12:57发布

We're going to running remote GUI on a few PCs, all communicating with a central server where the main application is running. Instead of hacking our own manual network protocol and marshalling layer for button presses and various events, my hope is that this could be solved more cleverly somehow.

Indeed, it'd be nifty if you could autogenerate network proxies for these Qt objects, or somehow connect signals/slots across an RPC interface, or something like that.

  • Writing a code generator based on Qt's .ui files should be doable, but maybe someone else has tried this before (with or without success)?

  • Another idea would be to use PyQt and some mechanism in python for networked proxy objects.

  • Failing Qt specific stuff, how does one solve remote GUI in general?

(Using web server/client is not ok, as we need our Qt Style, and probably a more speedy GUI with more fancy widgets. )

3条回答
成全新的幸福
2楼-- · 2019-04-22 13:06

I wouldn't solve this problem with writing code. I would use the tools which already exist.

This is RDP (terminal services) for windows or simply X (trivial, because of the builtin network support) for any other OS.

查看更多
神经病院院长
3楼-- · 2019-04-22 13:23

The Qxt extension library for Qt has a QxtRPCPeer class

QxtRPCPeer is a tool that encapsulates Qt signals and transmits them over a network connection. The signal is subsequently re-emitted on the receiving end of the connection.

Last Edit (Relevant OP's comment posted below on Feb 26 '11 at 16:23):

An update 1,5 years after. We've been using QxtRPCPeer in our production software for a year now. No glitches whatsoever.

Last Edit (By OP on 2015-05-22):

LibQxt is not maintained anymore, as of 0.6.2, as keeping up with the internal API changes is too much work for the authors. Some parts might still be usable but you'd have to maintain it yourself.

查看更多
Evening l夕情丶
4楼-- · 2019-04-22 13:30

When searching google for "Remote GUI Qt", I came across this project called Vedga. It is based on Qt and briefly what it does is:

Vedga is a toolkit for developing network GUI applications. It allows the developer to just write code using the Qt programming style for the server side and forget about the client side.

It might be worth looking. It would be nice if you check it out and post your observations about it for future reference.

查看更多
登录 后发表回答