Qt Platform Abstraction

The Qt Platform Abstraction (QPA) is the main platform abstraction layer in Qt.

The API can be identified by the QPlatform* class prefix, and is used for implementing higher level classes typically found in Qt GUI, e.g. QPlatformWindow for window system integration exposed through QWindow, or QPlatformTheme for deeper platform theming and integration, exposed through QStyleHint and QStyle.

There are no source or binary compatibility guarantees for the QPA classes, meaning that the API is only guaranteed to work with the Qt version it was developed against. API changes will however only be made in minor releases. (5.1, 5.2, and so on.)

API Overview

  • Window system integration

    • QPlatformIntegration

    • QPlatformAccessibility

    • QPlatformBackingStore

    • QPlatformClipboard

    • QPlatformCursor

    • QPlatformDrag

    • QPlatformFontDatabase

    • QPlatformGraphicsBuffer

    • QPlatformInputContext

    • QPlatformOffscreenSurface

    • QPlatformOpenGLContext

    • QPlatformScreen

    • QPlatformServices

    • QPlatformSharedGraphicsCache

    • QPlatformSurface

    • QPlatformWindow

  • Style/theming

    • QPlatformTheme

    • platform palettes

    • platform fonts

    • theme hints

  • Native dialogs and menus

    • QPlatformDialogHelper

    • QPlatformMenu

    • QPlatformMenuBar

    • QPlatformMenuItem

In addition to the QPA APIs, there are many other platform abstractions in Qt, for example the event dispatcher abstractions in Qt Core and the rendering hardware abstractions in RHI. The QPA APIs are mostly focused on window system integration and related support.

QPA Plugins

Concrete implementations of the interfaces listed above live in QPA plugins, or platform plugins, adding support for the various platforms Qt runs on. QPA plugins are implemented by subclassing the QPlatform* classes.

The following table summarizes the platform plugins available:

Plugin Name

Plugin Class Name

Description

qandroid

QAndroidPlatformIntegration

Android support

qbsdfb

QBsdFbIntegration

BsdFb support

qcocoa

QCocoaIntegrationPlugin

macOS 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.

qvnc</