qt程序的运行方式

求大神解释一下qt程序从编译到运行的过程,还有为什么一定要有QApplicationa(argc,argv)对象。... 求大神解释一下qt程序从编译到运行的过程,还有为什么一定要有QApplication a(argc,argv)对象。 展开
 我来答
砍侃看
2015-05-21 · TA获得超过6154个赞
知道大有可为答主
回答量:6584
采纳率:69%
帮助的人:2116万
展开全部
qassistant中有对QApplication的详细说明。
对于QApplication它有如下说明:

It initializes the application with the user's desktop settings such as palette(), font() and doubleClickInterval(). It keeps track of these properties in case the user changes the desktop globally, for example through some kind of control panel.
It performs event handling, meaning that it receives events from the underlying window system and dispatches them to the relevant widgets. By using sendEvent() and postEvent() you can send your own events to widgets.
It parses common command line arguments and sets its internal state accordingly. See the constructor documentation below for more details.
It defines the application's look and feel, which is encapsulated in a QStyle object. This can be changed at runtime with setStyle().
It specifies how the application is to allocate colors. See setColorSpec() for details.
It provides localization of strings that are visible to the user via translate().
It provides some magical objects like the desktop() and the clipboard().
It knows about the application's windows. You can ask which widget is at a certain position using widgetAt(), get a list of topLevelWidgets() and closeAllWindows(), etc.
It manages the application's mouse cursor handling, see setOverrideCursor()

大意是它要负责初始化应用、处理窗口事件、分析命令行的参数、定义程序外观、字符串的本地化、提供了一些魔术对象、了解窗口的基本信息、管理程序的鼠标指针处理等。要具体弄清楚的话就读qassistant。
匿名用户
2015-05-20
展开全部
你是怎么说的啊
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式