QT_WINDOWS_APP_PROJECT_EXECUTION_LEVEL

生成された Windows アプリケーションマニフェストにおける UAC 実行レベル。

このプロパティは Qt 6.11.1 で導入されました。

注:この プロパティは、Windows をターゲットとする場合にのみ使用されます。

qt_add_executable() でビルドされた Windows 実行ファイルに対して Qt が自動的に生成するアプリケーションマニフェスト内の `requestedExecutionLevel ` 要素の `level ` 属性を設定します。

有効な値は以下の通りです:

  • asInvoker — アプリケーションを起動したプロセスと同じ権限で実行する(デフォルト)。
  • highestAvailable — 現在のユーザーが利用可能な最高の権限で実行する。
  • requireAdministrator — 管理者権限でのみ実行する。必要に応じて、Windows が権限の昇格を求めるプロンプトを表示します。

無効な値が指定された場合、CMake 警告が出力され、asInvoker が使用されます。

ターゲットのソースにすでに.manifest ファイルが含まれている場合、Qtはマニフェストの自動生成をスキップし、このプロパティは効果を持ちません。

set_target_properties(myapp PROPERTIES
    QT_WINDOWS_APP_PROJECT_EXECUTION_LEVEL "requireAdministrator"
)

「Qt for Windows - デプロイメント」および「QT_WINDOWS_APP_PROJECT_IDENTIFIER」も参照してください 。

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