首页| 论坛| 消息

标题:QProcess 子进程接收消息问题
作者:cxs05741018
日期:2014-05-23 19:35
内容:

QProcess 多管道双向通信现在主进程能接收到子进程消息 子进程不能收到主进程消息
主进程: process.setProcessChannelMode(QProcess::MergedChannels);process.start("videoRecord.exe",QStringList());调用进程成功 然后向子进程发送消息 子进程收不到:process.write("stop") 返回值为4 应该是写入了子进程程序filein.open(stdin, QIODevice::ReadOnly);QSocketNotifier* sn = new QSocketNotifier(filein.handle(), QSocketNotifier::Read, this);connect(sn, SIGNAL(activated(int)), this, SLOT(readFromServer(int))); 主进程 发送消息 子进程 不会进入槽函数。另外 我没用信号槽 轮询模式去读标准输入还是没有数据 不知道哪里出错了子进程向主进程通信没问题 WINDOWS XP系统


#1 [cxs05741018 05-24 09:53]
顶上去 求解
#2 [cxs05741018 05-24 12:44]
用gets能够得到数据 现在看来还是子进程QFlie 使用问题 具体不知道出错在哪里
#3 [cxs05741018 05-24 17:10]
QSocketNotifier* sn = new QSocketNotifier(filein.handle(), QSocketNotifier::Read, this);connect(sn, SIGNAL(activated(int)), this, SLOT(readFromServer(int))) 还是这一步监听不到
#4 [3440vbiot 12-19 19:48]
您好。请问,你的问题解决了吗?我现在遇到的问题和你一样,几天了一直解决不了
#5 [lf460 08-08 18:35]
我也遇到了此问题,求教

回复 发表
主题 版块