开发者

Can't dismiss NSAlert in Qt app

开发者 https://www.devze.com 2023-03-18 19:41 出处:网络
I\'m trying to display an NSAlert in a Qt application. The alert is shown using runModal, in response to some logic that\'s triggered by a QTimerEvent, so the stack looks like this:

I'm trying to display an NSAlert in a Qt application. The alert is shown using runModal, in response to some logic that's triggered by a QTimerEvent, so the stack looks like this:

[NSAlert runModal]
<.......>
timerEvent(QTimerEvent*)
<.......>
QCoreApplication::exec()

However, the alert cannot be dismissed. The buttons respond to clicks or key shortcuts, but it is never dismissed. I'm guessing it's some kind of run loop problem: the NSAlert is blocking somehow?

I can display NSAlert elsewhere in the app without problems. If I substitute a QMessageBox it works as expected. Does anyone have any ide开发者_如何转开发as?

0

精彩评论

暂无评论...
验证码 换一张
取 消