Qt for Windows - Windows アプリケーション SDK
設定方法
Qt アプリでWindows App SDK を使用するには、SDK のパスを設定します。
使用方法Qt Creator
Windows App SDK をQt Creator で設定するには、Preferences >SDKs に進みます。
詳細については、Qt Creator ドキュメントを参照してください。
コマンドラインから
- 空のディレクトリに移動します。
例
mkdir C:\Dev\wasdk cd C:\Dev\wasdk
- そのディレクトリにNuGetをダウンロードします。
例えば、コマンドラインからPowerShellでダウンロードする場合:
powershell.exe -Command "& {Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile nuget.exe}"
- NuGetでWindows App SDKをダウンロードする。
nuget.exe install Microsoft.WindowsAppSDK -OutputDirectory ./
- 環境変数
WIN_APP_SDK_ROOT
を Windows APP SDK デ ィ レ ク ト リ (通常はMicrosoft.WindowsAppSDK.{Version}
)に設定す る 。例えば、コマンドラインを使用する:
cd Microsoft.WindowsAppSDK.* set WIN_APP_SDK_ROOT=%cd% setX WIN_APP_SDK_ROOT %cd%
Qt アプリで Windows App SDK を使用する
プロジェクトのCMakeファイルでqt_add_win_app_sdk(ProjectName) CMake関数を呼び出します。ProjectNameはプロジェクト名に置き換えてください。
ビルドが MSVC ビルドのみになるように条件を使用します:
if (MSVC) qt_add_win_app_sdk(ProjectName) endif()
© 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.