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 以降:

注意: .ui ファイルを処理するにはqt_add_ui を使用することをお勧めします。

オプション

uic 呼び出しに追加するOPTIONS を設定できます。オプションはuic のドキュメントを参照してください。

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

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