Creates sources for .ui files.
命令的定義在
Widgets
組件對於
Qt6
包。加載包采用:
find_package(Qt6 REQUIRED COMPONENTS Widgets)
qt_wrap_ui(<VAR> ui_file1 [ui_file2 ...]
[OPTIONS ...])
若
無版本命令
被禁用,使用
qt6_wrap_ui()
代替。它支持如此命令的一組相同自變量。
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
.
Since 6.8:
注意:
qt_add_ui
is the recommended way to process
.ui
文件。
可以設置額外
OPTIONS
應該被添加到
uic
調用。可以查找可能的選項在
uic documentation
.
set(SOURCES mainwindow.cpp main.cpp)
qt_wrap_ui(SOURCES mainwindow.ui)
qt_add_executable(myapp ${SOURCES})