Qt Platform Abstraction

QPA (Qt 平颱抽象) 是用於 Qt 5 和替換 Qt for Embedded Linux 及 Qt 4 平颱端口的平颱抽象層。

QPA 插件的實現是通過子類化各種 QPlatform* 類。有幾個 root 類,譬如 QPlatformIntegration and QPlatformWindow 用於窗口係統集成和 QPlatformTheme 用於更深入的平颱主題和集成。 QStyle 不屬於 QPA。

QPA 類沒有源代碼或二進製兼容性保證,意味著平颱插件隻保證與它所開發的 Qt 版本能一起工作。不管怎樣,隻會在子發行中更改 API (如 5.1、5.2 等)。

QPA 最小插件

目前還沒有編寫 QPA 插件的詳細教程文檔編製。不管怎樣,Qt 5 隨附瞭 2 個用於測試和其它特殊目的最小插件,可以用作範例:

  • qtbase/src/plugins/platforms/minimal/
  • qtbase/src/plugins/platforms/minimalegl/

The qminimal 插件是工具用於鏈接到 Qt GUI ,但不要求窗口係統集成 (例如, qmlplugindump )。它還擁有診斷支持,可以通過環境變量確定把窗口內容轉儲到圖像文件。

類概述

  • QPlatformIntegration
    • QAbstractEventDispatcher
    • QPlatformAccessibility
    • QPlatformBackingStore
    • QPlatformClipboard
    • QPlatformCursor
    • QPlatformDrag
    • QPlatformFontDatabase
    • QPlatformGraphicsBuffer
    • QPlatformInputContext
    • QPlatformNativeInterface
    • QPlatformOffscreenSurface
    • QPlatformOpenGLContext
    • QPlatformScreen
    • QPlatformServices
    • QPlatformSharedGraphicsCache
    • QPlatformSurface
    • QPlatformWindow
  • QPlatformTheme

qtbase/src/platformsupport 包含幾個幫助程序類,用於實現像 Unix 係統平颱插件。

QPA 插件

下錶匯總可用於 QPA 的平颱插件:

插件名稱 插件類名 描述
qandroid QAndroidPlatformIntegration Android 支持
qbsdfb QBsdFbIntegration BsdFb 支持
qcocoa QCocoaIntegrationPlugin Cocoa 支持
qdirect2d QWindowsDirect2DIntegrationPlugin 類似於 qwindows 插件,但采用基於 Direct2D 的描繪引擎替換光柵描繪引擎為 QPixmap and QBackingStore .
qdirectfb QDirectFbIntegrationPlugin DirectFB 中心圍繞 surfaces ,相當於 QPaintDevice .
qeglfs QEglFSIntegrationPlugin EGLFS 支持嵌入式 Linux 設備。
qhaiku QHaikuIntegration Haiku 支持
qios QIOSIntegrationPlugin iOS 支持
qlinuxfb QLinuxFbIntegrationPlugin LinuxFB 支持嵌入式 Linux 設備。
qmirclient QMirClientIntegration Mir 客戶端支持
qopenwf QOpenWFDIntegrationPlugin OpenWF Display 支持管理顯示控製硬件。
qqnx QQnxIntegrationPlugin QNX 支持
qvnc QVncIntegration VNC 支持
qwasm QWasmIntegration WebAssembly 支持
qwayland
  • QWaylandIntegrationPlugin
  • QWaylandBrcmEglPlatformIntegrationPlugin
  • QWaylandEglPlatformIntegrationPlugin
  • QWaylandXCompositeEglPlatformIntegrationPlugin
  • QWaylandXCompositeGlxPlatformIntegrationPlugin
Wayland 支持
qwindows QWindowsIntegrationPlugin Windows 支持
qwinrt QWinRTIntegrationPlugin 通用 Windows 平颱 (UWP) 支持

注意: 此插件最初是為 WinRT (Windows 運行時) 編寫的,因此稱為 qwinrt .

qxcb QXcbIntegrationPlugin X 窗口係統 (X11) 支持
webgl QWebGLIntegrationPlugin WebGL 支持 Qt Quick 應用程序