Qt-简单地说,什么是QApplication? [英] Qt - What is QApplication, simply?

查看:341
本文介绍了Qt-简单地说,什么是QApplication?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Qt 文档中看到了 QApplication 的描述,但不清楚。

I saw the description of QApplication in the Qt documentation, but wasn't that clear.

您能简单地描述它的主要作用吗?

Can you just simply describe what it mainly does?

谢谢。

推荐答案

关于QApplication的最重要的知识是它的 exec 方法运行事件循环,基本上是

The most important thing to know about QApplication is that its exec method runs the event loop, which is basically the piece of software that makes slots and signals work.

简单地说,如果没有正在运行的事件循环,则不会在以下位置传播由GUI组件触发的事件:全部,因此您的UI根本什么也不做。

To put it simply, if there is no running event loop, the events fired by your GUI components will not be propagated at all, so your UI will just not do anything at all.

这篇关于Qt-简单地说,什么是QApplication?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆