Qt Quick 위젯
Qt Quick 위젯 모듈은 QQuickWindow 을 편리하게 사용할 수 있도록 래핑한 것입니다. 메인 qml 파일의 URL이 제공되면 QML 씬을 자동으로 불러와 표시합니다. 또는 QQmlComponent 을 사용하여 QML 객체를 인스턴스화한 뒤, 수동으로 설정된 QQuickWidget 에 배치할 수도 있습니다.
일반적인 사용법:
QQuickWidget *view = new QQuickWidget;
view->setSource(QUrl::fromLocalFile("myqmlfile.qml"));
view->show();QQuickWidget 또한 뷰와 루트 항목의 크기 조정도 관리합니다. 기본적으로 ` resizeMode `는 ` SizeViewToRootObject`로 설정되어 있어, 컴포넌트를 로드하고 뷰에 맞게 크기를 조정합니다. 또는 ` resizeMode `를 ` SizeViewToRootObject`로 설정하면 뷰 크기를 루트 항목에 맞게 조정합니다.
모듈 사용
Qt 모듈의 C++ API를 사용하려면 모듈 라이브러리를 직접 또는 다른 종속성을 통해 링크해야 합니다. CMake 및 qmake를 비롯한 여러 빌드 도구가 이를 위해 전용 지원을 제공합니다.
CMake를 사용한 빌드
find_package() 명령을 사용하여 Qt6 패키지 내에서 필요한 모듈 구성 요소를 찾으십시오:
find_package(Qt6 REQUIRED COMPONENTS QuickWidgets)
target_link_libraries(mytarget PRIVATE Qt6::QuickWidgets)자세한 내용은 ‘CMake를 사용한 빌드’ 개요를 참조하십시오.
qmake를 사용한 빌드 quickwidgets
qmake를 사용하여 모듈을 빌드하도록 구성하려면, 프로젝트의 .pro 파일에서 QT 변수의 값으로 모듈을 추가하십시오:
QT += quickwidgets참고
예제
라이선스 및 출처 표시
Qt Quick 이 위젯은 The Qt Company에서 제공하는 상용 라이선스 하에 사용할 수 있습니다. 또한, 자유 소프트웨어 라이선스 하에서도 사용할 수 있습니다. Qt 5.4부터 이러한 자유 소프트웨어 라이선스는 GNU Lesser General Public License 버전 3 또는 GNU General Public License 버전 2입니다. 자세한 내용은 Qt 라이선싱을 참조하십시오.
© 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.