• 3401阅读
  • 3回复

[提问]关于emit的疑问 [复制链接]

上一主题 下一主题
离线vitty1984
 

只看楼主 倒序阅读 楼主  发表于: 2011-11-23
我向一个子窗口发送信号:
    emit readConfigSignal();    
    expInfo_dlg->exec();
这种方式可以奏效;但是
expInfo_dlg->exec();
emit readConfigSignal();
这样就不行了,为什么啊
离线ppdayz

只看该作者 1楼 发表于: 2011-11-23
int QDialog::exec () [slot]
Shows the dialog as a modal dialog, blocking until the user closes it. The function returns a DialogCode result.
If the dialog is application modal, users cannot interact with any other window in the same application until they close the dialog. If the dialog is window modal, only interaction with the parent window is blocked while the dialog is open. By default, the dialog is application modal.
也就是说,你下面的那个emit要等关闭了这个dialog才有效
离线jdwx

只看该作者 2楼 发表于: 2011-11-23
回 楼主(vitty1984) 的帖子
信息太少,什么都看不出来。
发帖时要说明:操作系统、Qt版本、编译器,这样能更快的得到回复。
离线roywillow

只看该作者 3楼 发表于: 2011-11-23
应该是exec()执行后阻塞,后面的代码除非从这个函数跳出,否则不会执行到的
专业维修核潜艇,回收二手航母、二手航天飞机,大修核反应堆,拆洗导弹发动机更换机油,无人侦察机手动挡改自动,航天飞机保养换三滤,飞碟外太空年检 ,各型号导弹加装迎宾踏板,高空作业擦洗卫星表面除尘、打蜡及抛光,东风全系列巡航导弹。并提供原子对撞机。量大从优,有正规发票。
快速回复
限100 字节
 
上一个 下一个