我注意到Qt上的模态对话框使用本地QEventLoop,该过程中的ProcessEventFlags设置为“Dialogexec”

eventLoop.exec(QEventLoop::DialogExec);
.

Qt Assistant没有关于该枚举意味着什么的信息。还有另一个名为EventLoopexec。任何人都知道他们实际上是什么意思,为什么他们没有记录?

感谢

有帮助吗?

解决方案

I did some poking around and this is what I found:

  • This enum is intentionally omitted from the documentation, along with several other QEventLoop::ProcessEventsFlag enum values (X11ExcludeTimers, ExcludeUserInput, WaitForMore, EventLoopExec) as there is an \omitvalue in front of each one in the comments that generate the docs.

  • There is only one place in all of Qt that actually uses it, in qeventdispatcher_mac.mm in which it appears to be some kind of mac-specific optimization according to the in-line comments

The intentional omission of these values from the docs leads me to conclude that they're for internal Qt use only, and that you shouldn't need to use them or worry about them.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top