Qt Platform Abstraction

English | 中文

QPA is the platform abstraction layer for Qt 5 and replaces QWS and the platform ports from Qt 4. You can learn about it at this video presentation:

There is currently little documentation for QPA. The best approach for developing a new platform plugin is to look at the other plugins [qt.gitorious.net] and see how they implement the APIs in question. The minimal [qt.gitorious.net] plugin is a good starting point. The xcb, windows, cocoa, and qnx plugins are also actively developed and up to date.

QPA plugins are implemented by subclassing various QPlatform* classes. There are two “root” classes: QPlatformIntegration for window system integration and QPlatformTheme for deeper platform theming and integration. QStyle is not a part of QPA.

The APIs provided by QPlatformIntegration are at this point (Qt 5 Alpha) mostly stable. QPlatformTheme still has ongoing development. There
are no source or binary compatibility guarantees for the QPA classes, meaning that a platform plugin 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.)

Class Overview

  1. QPlatformIntegration
  2.     QPlatformWindow
  3.     QPlatformBackingStore
  4.     QPlatformOpenGLContext
  5.     QPlatformSharedGraphicsCache
  6.     QPlatformFontDatabase
  7.     QPlatformClipboard
  8.     QPlatformDrag
  9.     QPlatformInputContext
  10.     QPlatformAccessibility
  11.     QPlatformNativeInterface
  12.     QPlatformServices
  13.  
  14. QPlatformTheme
  15.     QPlatformMenu
  16.     QPlatformMenuBar
  17.     QPlatformDialogHelper
  18.     platform palettes
  19.     platform fonts
  20.     theme hints

src/platformsupport [qt.gitorious.net] contains several helper classes for implementing platform plugins on unix-like systems.

A basic introduction to various QPA classes can be on this blog post [qforever.wordpress.com] .

Categories: