Qt Platform Abstraction/zh: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(Add "cleanup" tag)
Line 1: Line 1:
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
[[Category:Developing_with_Qt::Qt 5]]
[[Category:Developing_with_Qt::Qt 5]]
h1. Qt 平台抽象
h1. Qt 平台抽象

Revision as of 16:45, 3 March 2015

This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

h1. Qt 平台抽象

QPA (Qt Platform Abstraction) 即Qt平台抽象层, 移植自Qt4, 在Qt5中替代QWS(Qt Window System)。 你可以从这个视频演示中了解它:

"QPA - The Qt Platform Abstraction":http://qt.io/videos/watch/qpa-the-qt-platform-abstraction by Thomas Senyk.

目前只有很少的QPA的文档。开发一个新平台插件最好的方式是 "看其他的插件":http://qt.gitorious.net/qt/qtbase/trees/master/src/plugins/platforms. 理解它们的API是怎样实现的。 "minimal":http://qt.gitorious.net/qt/qtbase/trees/master/src/plugins/platforms/minimal 插件是最好的切入点。 xcb,windows,cocoa和qnx插件也在开发和更新中。

QPA插件通过子类化不同的QPlatform*类来实现。QPA中有两个基类:QPlatformIntergration窗口系统集成和QPlatformTheme 深入平台主题和集成。 QStyle 不是QPA的一部分。

QPlatformIntergration 此时(Qt 5 Alpha)提供的API大部分已经稳定。 QPlatformTheme 仍在开发中。QPA类并没有代码和二进制的兼容性保证,意思是一个平台插件只保证在它开发依赖的Qt版本中工作。 但是API的改变只在次发行版中。(5.1, 5.2 等等。)

类概览

QPlatformIntegration
 QPlatformWindow
 QPlatformBackingStore
 QPlatformOpenGLContext
 QPlatformSharedGraphicsCache
 QPlatformFontDatabase
 QPlatformClipboard
 QPlatformDrag
 QAbstractEventDispatcher
 QPlatformInputContext
 QPlatformAccessibility
 QPlatformNativeInterface
 QPlatformServices

QPlatformTheme
 QPlatformMenu
 QPlatformMenuBar
 QPlatformDialogHelper
 platform palettes
 platform fonts
 theme hints

"src/platformsupport":http://qt.gitorious.net/qt/qtbase/trees/master/src/platformsupport 包含了几个在类unix(unix-like)系统中实现平台插件有帮助的类。