Core Internals

Qt包含丰富的基本启动器集,主要来自Qt Core模块。 Qt使用这些启动器来提供更高级别的UI和应用程序开发组件。 以下主题说明了最重要的使能器,并显示了如何使用它们来实现Qt尚未提供的特殊功能。

Objects, Properties, and Events

QObject类构成Qt对象模型的基础,并且是许多Qt类的父类。 对象模型引入了许多机制,例如元对象系统,该系统允许运行时自省,操作和调用对象中的属性和方法。 它也用作Qt事件系统的基础,它是基于QObject的对象之间进行通信的一种低级方式。 Another high-level form of communication is provided in Qt's signals and slots mechanism.

These features can also be used in combination with the State Machine Framework which provides a formally defined and predictable way of managing the states of your application. An alternative way of implementing state machines is using the Qt SCXML add-on module to create them from State Chart XML (SCXML) files.

In addition, QObject provides a simple timing mechanism with QObject::startTimer(). Alternatively, the QTimer class provides a high-level interface for timers.

Container Classes

A container is a data structure whose instances are collections of other objects. Some examples of containers are: dynamic arrays, queues, linked lists, and associative arrays. Qt provides a set of general purpose, template-based container classes for structuring data in memory.

See the full list of Container Classes for more details.

Internationalization

Qt uses Unicode for the encoding of displayable text strings. Unicode provides support for all commonly used writing systems in the world and is ideal for cross-platform development. Applications can also be written to support any number of different languages with one code base using Qt's powerful internationalization system.

Inter-Process Communication

Qt provides several classes to support communication between processes. You can also launch and manage external processes using the QProcess class.

Threading

Qt provides functionality to manage threads and parallelized code in a safe and platform-independent way.

Platform Support

Qt allows you to write platform-independent code, where the same code base can be compiled for and deployed on different platforms without any changes. In cases where you need to use platform-specific features and integrate with system libraries, Qt also provides solutions for this.

Qt integrates with the windowing system on the target platform using Qt Platform Abstraction (QPA). QPA is an abstraction of a windowing system which makes porting Qt to new platforms simple and quick. One such system is the Wayland protocol. Qt can be used together with Wayland as a light-weight windowing system on embedded hardware to support a multi-process graphical user interface.

The Qt Platform Abstraction uses Qt's plugin system. This plugin system provides APIs to extend Qt in specific areas (such as adding support for new image formats, database drivers, and so on) and also for writing your own extensible Qt applications which support third-party plugins.