chore: Update README.md with deployment instructions for Windows

Co-authored-by: Dylan Liu <mentalflow@ourdocs.cn>
This commit is contained in:
MoonFeather 2024-07-26 17:32:28 +08:00 committed by Mentalflow
parent d13416e0d1
commit 58fb7a62e6
Signed by: Mentalflow
GPG Key ID: 5AE68D4401A2EE71
2 changed files with 21 additions and 0 deletions

View File

@ -102,6 +102,16 @@ RibbonUI是一个参考微软Ribbon风格即Office 2016后的风格设计
# -DCMAKE_PREFIX_PATH={你的Qt安装目录} # -DCMAKE_PREFIX_PATH={你的Qt安装目录}
cmake --build . --target all --config Release --parallel cmake --build . --target all --config Release --parallel
``` ```
- 运行或部署
***在其它系统中编译过后生成的应用可以直接运行但在Windows上需要先使用Qt的`bin`目录下的`windeployqt.exe`部署相关必需库后才可以不通过`Qt Creator`而直接在编译目录下双击可执行文件运行。***
```powershell
#build文件夹下
cd app\release
C:\Qt\6.6.3\mingw_64\bin\windeployqt.exe --qmldir C:\Qt\6.6.3\mingw_64\qml .\RibbonUI-APP.exe
#指定"--qmldir"参数是必须的
```
+ 在其他项目中使用RibbonUI + 在其他项目中使用RibbonUI
- 遵循***编译例程和库***的下载仓库和进入build目录步骤 - 遵循***编译例程和库***的下载仓库和进入build目录步骤
- 在CMakeLists.txt中加入以下语句 - 在CMakeLists.txt中加入以下语句

View File

@ -101,6 +101,17 @@ The current design is based on Qt 6, and it support for Qt 5 as well(***ONLY sup
# -DCMAKE_PREFIX_PATH={YOUR QT INSTALL FOLDER} # -DCMAKE_PREFIX_PATH={YOUR QT INSTALL FOLDER}
cmake --build . --target all --config Release --parallel cmake --build . --target all --config Release --parallel
``` ```
- Run or Deploy
***On the other system, you could directly start the app after the build process, while you have to use `windeployqt.exe` in Qt's `bin` directory to deploy the required libs first on Windows if you want to click to run rather than through `Qt Creator`.***
```powershell
#in the build folder
cd app\release
C:\Qt\6.6.3\mingw_64\bin\windeployqt.exe --qmldir C:\Qt\6.6.3\mingw_64\qml .\RibbonUI-APP.exe
#"--qmldir" is essential.
```
+ Use library with other project + Use library with other project
- Follow the same steps like clone and enter build folder as ***Compile the example and library*** - Follow the same steps like clone and enter build folder as ***Compile the example and library***
- Add the following code to your CMakeLists.txt - Add the following code to your CMakeLists.txt