进程交互还可以使用QSharedMemory

官方例子:

http://doc.qt.io/qt-5/qtcore-ipc-sharedmemory-example.html

查了一下,QSharedMemory没有自带任何信号。我的想法:
1. 能不能继承QSharedMemory,给它添加信号,然后两个进程里都使用这个继承类,这样它们最终使用的是同一个QSharedMemory Instance,就可以connect发信号了。
2. 另外一种办法是,通过QSharedMemory把整个QApplication传递过去,这样又可以postEvent了。。。

 

posted @ 2017-02-28 17:23  findumars  Views(610)  Comments(0Edit  收藏  举报