Qt 플랫폼 추상화
Qt 플랫폼 추상화(QPA)는 Qt의 주요 플랫폼 추상화 계층입니다.
이 API는 QPlatform* 클래스 접두사로 식별할 수 있으며, 일반적으로 다음에서 볼 수 있는 상위 레벨 클래스를 구현하는 데 사용됩니다. Qt GUI예를 들어, QWindow 를 통해 노출되는 윈도우 시스템 통합을 위한 QPlatformWindow 나, QStyleHint 및 QStyle 를 통해 노출되는 심층적인 플랫폼 테마 및 통합을 위한 QPlatformTheme 등이 있습니다.
QPA 클래스에 대해서는 소스 또는 바이너리 호환성이 보장되지 않습니다. 즉, 해당 API는 개발 시 기준이 된 Qt 버전에서만 작동이 보장됩니다. 단, API 변경은 마이너 릴리스(5.1, 5.2 등)에서만 이루어집니다.
API 개요
- 윈도우 시스템 통합
- QPlatformIntegration
- QPlatformAccessibility
- QPlatformBackingStore
- QPlatformClipboard
- QPlatformCursor
- QPlatformDrag
- QPlatformFontDatabase
- QPlatformGraphicsBuffer
- QPlatformInputContext
- QPlatformOffscreenSurface
- QPlatformOpenGLContext
- QPlatformScreen
- QPlatformServices
- QPlatformSharedGraphicsCache
- QPlatformSurface
- QPlatformWindow
- 스타일/테마
- QPlatformTheme
- 플랫폼 팔레트
- 플랫폼 글꼴
- 테마 힌트
- 기본 대화 상자 및 메뉴
- QPlatformDialogHelper
- QPlatformMenu
- QPlatformMenuBar
- QPlatformMenuItem
참고: QPA API 외에도 Qt에는 RHI의 이벤트 디스패처 추상화 등 Qt Core 및 RHI의 렌더링 하드웨어 추상화 등이 있습니다. QPA API는 주로 윈도우 시스템 통합 및 관련 지원에 중점을 둡니다.
QPA 플러그인
위에 나열된 인터페이스의 구체적인 구현은 QPA 플러그인(또는 플랫폼 플러그인)에 포함되어 있으며, Qt가 실행되는 다양한 플랫폼에 대한 지원을 추가합니다. QPA 플러그인은 ` QPlatform* ` 클래스를 상속하여 구현됩니다.
다음 표는 사용 가능한 플랫폼 플러그인을 요약한 것입니다:
| 플러그인 이름 | 플러그인 클래스 이름 | 설명 |
|---|---|---|
qandroid | QAndroidPlatformIntegration | Android 지원 |
qbsdfb | QBsdFbIntegration | BsdFb 지원 |
qcocoa | QCocoaIntegrationPlugin | macOS 지원 |
qdirect2d | QWindowsDirect2DIntegrationPlugin | qwindows 플러그인과 유사하지만, QPixmap 및 QBackingStore 의 경우 래스터 페인트 엔진을 Direct2D 기반 페인트 엔진으로 대체합니다. |
qdirectfb | QDirectFbIntegrationPlugin | DirectFB는 QPaintDevice 에 해당하는 서페이스를 중심으로 합니다. |
qeglfs | QEglFSIntegrationPlugin | 임베디드 리눅스 기기를 위한EGLFS 지원. |
qhaiku | QHaikuIntegration | Haiku 지원 |
qios | QIOSIntegrationPlugin | iOS 지원 |
qlinuxfb | QLinuxFbIntegrationPlugin | 임베디드 리눅스 기기를 위한LinuxFB 지원. |
qvnc | QVncIntegration | VNC 지원 |
qwayland |
| Wayland 지원 |
qwindows | QWindowsIntegrationPlugin | Windows 지원 |
qxcb | QXcbIntegrationPlugin | X Window System (X11) 지원 |
QPA 플러그인 선택
Qt는 플랫폼에 따라 기본 QPA 플러그인을 선택합니다. ` QT_QPA_PLATFORM ` 환경 변수와 ` -platform ` 명령줄 인수를 사용하면 이 기본값을 재정의할 수 있습니다. 자세한 내용은 QGuiApplication 을 참조하십시오.
세미콜론으로 구분된 목록을 전달하여 플러그인을 설치할 수 있습니다. 이 경우 설치 프로그램은 목록의 항목을 차례로 확인한 후, 사용 가능한 첫 번째 플러그인을 설치합니다.
예시:
-qpa xcb;wayland위의 줄은 xcb 플러그인이 사용 가능한지 확인하고, 그렇지 않은 경우 wayland 플러그인을 확인합니다.
QPA 플러그인 작성
현재 QPA 플러그인 작성에 대한 상세한 튜토리얼 문서는 없습니다. 하지만 테스트 및 기타 특수한 용도로 Qt에 포함된 두 가지 최소 구성 플러그인이 있으며, 이를 예제로 활용할 수 있습니다:
qtbase/src/plugins/platforms/minimal/qtbase/src/plugins/platforms/minimalegl/
qminimal 플러그인은 Qt GUI에 링크되지만 윈도우 시스템 통합이 필요하지 않은 도구(예: qmlplugindump)에 사용됩니다. 또한 환경 변수에 따라 창 내용을 이미지 파일로 덤프하는 진단 기능도 지원합니다.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.