Qt Platform Abstraction
Qt 平台抽象 (QPA) 是 Qt 5 的平台抽象层, 取代了Qt 的嵌入式 Linux 端口和 Qt 4 的平台端口.
QPA 插件是通过子类化各种 QPlatform*
类来实现的. QPA 有几个根类, 例如用于窗口系统集成的 QPlatformIntegration
和 QPlatformWindow
, 更深入的平台主题和集成的 QPlatformTheme
. QStyle 不是 QPA 的一部分.
QPA 类没有源代码或二进制兼容性保证, 这意味着平台插件只能保证与其开发所针对的 Qt 版本一起使用. 然而, API 更改只会在次要版本中进行. (5.1, 5.2 等等)
QPA Minimal Plugins
目前还没有编写 QPA 插件的详细教程文档。 但是,Qt 5 附带了两个最小的插件,用于测试和其他特殊目的,您可以将其用作示例: qtbase/src/插件/平台/最小/ qtbase/src/plugins/platforms/minimalegl/ qminimal 插件用于链接到 Qt GUI 的工具,但不需要窗口系统集成(例如,qmlplugindump)。 它还具有诊断支持,可将窗口内容转储到由环境变量确定的图像文件。目前还没有编写 QPA 插件的详细教程文档. 但是, Qt 5 附带了两个最小的插件, 用于测试和其他特殊目的, 你可以将其用作示例:
qtbase/src/plugins/platforms/minimal/
qtbase/src/plugins/platforms/minimalegl/
The qminimal
插件用于链接到 Qt GUI 的工具, 但不需要窗口系统集成 (例如, qmlplugindump
). 它还具有诊断支持, 可将窗口内容转储到由环境变量确定的图像文件.
Class Overview
- QPlatformIntegration
- QAbstractEventDispatcher
- QPlatformAccessibility
- QPlatformBackingStore
- QPlatformClipboard
- QPlatformCursor
- QPlatformDrag
- QPlatformFontDatabase
- QPlatformGraphicsBuffer
- QPlatformInputContext
- QPlatformNativeInterface
- QPlatformOffscreenSurface
- QPlatformOpenGLContext
- QPlatformScreen
- QPlatformServices
- QPlatformSharedGraphicsCache
- QPlatformSurface
- QPlatformWindow
- QPlatformTheme
- QPlatformDialogHelper
- QPlatformMenu
- QPlatformMenuBar
- QPlatformMenuItem
- QPlatformSystemTrayIcon
- platform palettes
- platform fonts
- theme hints
qtbase/src/platformsupport
包含几个辅助类, 用于在类 Unix 系统实现平台插件.
QPA Plugins
下表总结了可用于 QPA 的平台插件:
Plugin Name | Plugin Class Name | Description |
---|---|---|
qandroid | QAndroidPlatformIntegration | Android support |
qbsdfb | QBsdFbIntegration | BsdFb support |
qcocoa | QCocoaIntegrationPlugin | Cocoa support |
qdirect2d | QWindowsDirect2DIntegrationPlugin | Similar to the qwindows plugin, but replaces the raster paint engine with a Direct2D-based paint engine for QPixmap and QBackingStore. |
qdirectfb | QDirectFbIntegrationPlugin | DirectFB is centered around surfaces, which are the equivalent of a QPaintDevice. |
qeglfs | QEglFSIntegrationPlugin | EGLFS support for embedded Linux devices. |
qhaiku | QHaikuIntegration | Haiku support |
qios | QIOSIntegrationPlugin | iOS support |
qlinuxfb | QLinuxFbIntegrationPlugin | LinuxFB support for embedded Linux devices. |
qmirclient | QMirClientIntegration | Mir client support |
qopenwf | QOpenWFDIntegrationPlugin | OpenWF Display support for managing display control hardware. |
qqnx | QQnxIntegrationPlugin | QNX support |
qvnc | QVncIntegration | VNC support |
qwasm | QWasmIntegration | WebAssembly support |
qwayland |
| Wayland support |
qwindows | QWindowsIntegrationPlugin | Windows support |
qwinrt | QWinRTIntegrationPlugin | Universal Windows Platform (UWP) support Note: This plugin was originally written for WinRT (Windows Runtime), and is therefore called |
qxcb | QXcbIntegrationPlugin | X Window System (X11) support |
webgl | QWebGLIntegrationPlugin | WebGL support for Qt Quick applications |