Chinaunix首页 | 论坛 | 博客
  • 博客访问: 536513
  • 博文数量: 174
  • 博客积分: 4177
  • 博客等级: 上校
  • 技术积分: 1827
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-15 14:12
文章分类

全部博文(174)

文章存档

2018年(1)

2017年(1)

2013年(3)

2012年(9)

2010年(12)

2009年(5)

2008年(106)

2007年(37)

我的朋友

分类: C/C++

2007-11-12 21:28:55

#include
Inherits QCoreApplication

   The QApplication class manages the GUI application's control flow and main settings.

   It contains the main event loop, where all events from the window system and other sources are processed and dispatched. It also handles the application's initialization and finalization, and provides session management. It also handles most system-wide and application-wide settings.

   For any GUI application that uses Qt, there is precisely one QApplication object, no matter whether the application has 0, 1, 2 or more windows at any time. For non-GUI Qt applications, use QCoreApplication instead, which doesn't depend on the QtGui library.

   The QApplication object is accessible through the instance() function which return a pointer equivalent to the global qApp pointer.

   QApplication's main areas of responsibility are:

   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 about this.
   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()
On the X window system, it provides functions to flush and sync the communication stream, see flushX() and syncX().
   It provides support for sophisticated session management. This makes it possible for applications to terminate gracefully when the user logs out, to cancel a shutdown process if termination isn't possible and even to preserve the entire application's state for a future session. See isSessionRestored(), sessionId() and commitData() and saveState() for details.

   Since the QApplication object does so much initialization, it must be created before any other objects related to the user interface are created.
  Since it also deals with common command line arguments, it is usually a good idea to create it before any interpretation or modification of argv is done in the application itself.

                                 QObject
                                    |
      ----------------------------------------------------------------
      |                             |                                 |
QCoreApplication                 QWidget                           QLayout
      |                             |                                 |
  QApplication                      |                             QBoxLayout
                                    |                                 |
      --------------------------------------------------------        |
      |                 |                |                   |    QHBoxLayout
QAbstractButton  QAbstractSpinBox   QAbstractSlider       QFrame
      |                 |                |                   |
  QPushButton       QSpinBox          QSlider              QLabel
阅读(1623) | 评论(0) | 转发(0) |
0

上一篇:Bank

下一篇:关于/proc文件系统

给主人留下些什么吧!~~