Hello Vulkan 위젯 예제
QWidget 애플리케이션에서 QVulkanWindow 의 사용법을 보여줍니다.
'Hello Vulkan 위젯 예제'는 hellovulkantriangle의 변형으로, QWidget::createWindowContainer()을 사용하여 QVulkanWindow 을 QWidget 기반 사용자 인터페이스에 임베드합니다.

Vulkan 파이프라인을 설정하고 삼각형을 렌더링하는 코드는 hellovulkantriangle과 동일합니다. 또한, 이 예제는 QVulkanWindow 의 또 다른 기능, 즉 컬러 버퍼에서 QImage 로 이미지 내용을 다시 읽어오는 방법을 보여줍니다. ‘Grab’ 버튼을 클릭하면, 예제는 다음 프레임을 렌더링한 후, 스왑체인 컬러 버퍼의 내용을 호스트가 접근 가능한 메모리로 복사하기 위해 전송 작업을 수행합니다. 그런 다음 QImage::save()를 통해 이미지가 디스크에 저장됩니다.
예제 실행
다음 경로에서 예제를 실행할 수 있습니다.
- Qt Creator
Welcome 모드를 열고 Examples 에서 예제를 선택합니다. 자세한 내용은 Qt Creator: 튜토리얼: 빌드 및 실행을 참조하십시오.
- Qt Extension for Visual Studio Code
Command Palette 에서 Qt: Open Qt examples 명령을 실행하고 목록에서 예제를 선택합니다. 자세한 내용은 Qt Extension for Visual Studio Code: 튜토리얼: 빌드 및 실행을 참조하십시오.
© 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.