qt_wrap_ui

Creates sources for .ui files.

The command is defined in the 小部件 组件对于 Qt6 package. Load the package with:

find_package(Qt6 COMPONENTS Widgets REQUIRED)
					

概要

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

versionless commands are disabled, use qt6_wrap_ui() instead. It supports the same set of arguments as this command.

描述

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 .

选项

可以设置额外 OPTIONS that should be added to the uic calls. You can find possible options in the uic documentation .

范例

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