Qt Quick Ultralite 平台抽象体系结构

The following diagram gives an overview of the Qt Quick Ultralite architecture, with a focus on the platform abstraction and platform library layers:

Architecturally, Qt Quick Ultralite is divided into two main parts, the Qt Quick Ultralite core library, and the Qt Quick Ultralite platform library. The Qt Quick Ultralite core library implements all the platform independent features of Qt Quick Ultralite, such as the QML property system, animations, text layout, the various QML items, the QML item scene graph with dirty region computations and partial updates, and so on. It also contains the Qt Quick Ultralite Platform Abstraction layer which is used to interface with the platform library. The platform library provides the input, rendering, and timers, and other hardware-specific functionality.

The Qt Quick Ultralite core library provides an API to be used by the application and a platform programming interface to be used by the platform library. The platform programming interface corresponds to the Qul::PlatformInterface namespace, and contains functionality to deliver touch and key events to Qt Quick Ultralite core, software rendering fallbacks and blend helpers, as well as various classes that are part of the platform interface but not directly meant to be used by application developers.

The Qt Quick Ultralite platform library has to implement the interface in the Qul::Platform namespace. This interface is what the Qt Quick Ultralite core library relies on in order to interact with the actual hardware. Porting to a new platform is thus done by implementing this platform interface in the platform library, that the application then links against together with the Qt Quick Ultralite core library. This library takes care of initialization of the hardware and driving the main render loop, as well as timers and interrupts.

The platform library implementation can make use of hardware-accelerated graphics, if available. The core library provides software blending fallbacks for platforms where hardware-accelerated graphics is lacking or only partially supported.

The core library also provides the Qul::EventQueue template class to pass events from hardware, like touch events, to the Qt Quick Ultralite core library. It can additionally be used for custom events to be fed into the QML property system.