QT_WINDOWS_APP_PROJECT_EXECUTION_LEVEL

UAC execution level in the generated Windows application manifest.

This property was introduced in Qt 6.12.

Note: This property is used only if targeting Windows.

Sets the level attribute of the requestedExecutionLevel element in the application manifest that Qt automatically generates for Windows executables built with qt_add_executable().

Valid values are:

  • asInvoker — run with the same privileges as the process that launched the application (default).
  • highestAvailable — run with the highest privileges available to the current user.
  • requireAdministrator — run only with administrator privileges; Windows will prompt for elevation if necessary.

If an invalid value is provided, a CMake warning is emitted and asInvoker is used.

If the target already provides a .manifest file in its sources, Qt skips automatic manifest generation and this property has no effect.

 set_target_properties(myapp PROPERTIES
     QT_WINDOWS_APP_PROJECT_EXECUTION_LEVEL "requireAdministrator"
 )

See also Qt for Windows - Deployment and QT_WINDOWS_APP_PROJECT_IDENTIFIER.