helong_1024 |
2017-12-14 00:14 |
Windows下Qt窗口如何跨线程获取焦点
基础描述: Windows平台下,用vs2010开发的2个Qt程序A和B。 预期目标: 当A程序点击按钮发出消息,B程序接收到A发出的消息后让自己获得焦点成为系统活动窗口。 现存问题: 现在已经在B程序里获取到A发出的消息并解析完成,但不知如何获得焦点成为系统活动窗口。 试过如下代码,但报出错跨线程的错误。 this->hide(); this->setWindowFlags(Qt::WindowStaysOnTopHint); this->show(); this->hide(); this->setWindowFlags(Qt::Widget); this->show(); 请大神给看看,拜托啦!!! |
|