이 페이지에서

qt_wrap_ui

.ui 파일용 소스 코드를 생성합니다.

이 명령어는 Qt6 패키지의 Widgets 컴포넌트에 정의되어 있습니다. 다음 명령어로 패키지를 불러오십시오:

find_package(Qt6 REQUIRED COMPONENTS Widgets)

사용법

qt_wrap_ui(<VAR> ui_file1 [ui_file2 ...]
           [OPTIONS ...])

버전 정보가 없는 명령이 비활성화된 경우, 대신 qt6_wrap_ui() 을 사용하십시오. 이 명령은 본 명령과 동일한 인자 집합을 지원합니다.

설명

지정된 .ui 파일에 대해 User Interface Compiler (uic) 를 호출하는 규칙을 생성합니다. 각 입력 파일에 대해 빌드 디렉터리에 헤더 파일이 생성됩니다. 생성된 헤더 파일의 경로는 <VAR> 에 추가됩니다.

참고: 이 매크로는 저수준 매크로입니다. uic 를 사용하여 .ui 파일을 처리하는 더 편리한 방법은 CMake AUTOUIC 문서를 참조하십시오.

6.8부터:

참고: qt_add_ui() 는 .ui 파일을 처리하는 권장 방법입니다.

옵션

uic 호출에 추가되어야 할 추가 OPTIONS 를 설정할 수 있습니다. 사용 가능한 옵션은 uic 문서에서 확인할 수 있습니다.

예제

set(SOURCES mainwindow.cpp main.cpp)
qt_wrap_ui(SOURCES mainwindow.ui)
qt_add_executable(myapp ${SOURCES})

© 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.