qt5_wrap_ui

概要

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

描述

Creates rules for calling the uic (用戶界麵編譯器) 在給定 .ui files. For each input file, an header file is generated in the build directory. The paths of the generated header files are added to <VAR> .

注意: This is a low-level macro. See the CMake AUTOUIC Documentation for a more convenient way to process .ui files with uic .

注意: 為兼容 Qt 6,命令還可用於名稱 qt_wrap_ui .

選項

可以設置額外 選項 應該被添加到 uic 調用。可以查找可能的選項在 uic documentation .

範例

set(SOURCES mainwindow.cpp main.cpp)
qt5_wrap_ui(SOURCES mainwindow.ui)
add_executable(myapp ${SOURCES})