Workflow and Source: bump to Qt 6.5.3.
This commit is contained in:
parent
1d25452a4b
commit
04230551dd
|
@ -21,8 +21,8 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-12]
|
os: [macos-14]
|
||||||
qt_ver: [6.2.4]
|
qt_ver: [6.5.3]
|
||||||
qt_arch: [clang_64]
|
qt_arch: [clang_64]
|
||||||
env:
|
env:
|
||||||
targetName: RibbonUI-APP
|
targetName: RibbonUI-APP
|
||||||
|
@ -49,13 +49,15 @@ jobs:
|
||||||
cmake --version
|
cmake --version
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.2.4/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.5.3/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
- name: package
|
- name: package
|
||||||
run: |
|
run: |
|
||||||
|
# 先删除所有dSYM文件,减少包的体积
|
||||||
|
sudo find /Users/runner/work/RibbonUI/Qt/6.5.3/macos/qml -name "*.dSYM" | xargs rm -r
|
||||||
# 拷贝依赖
|
# 拷贝依赖
|
||||||
macdeployqt /Users/runner/work/RibbonUI/RibbonUI/build/example/${targetName}.app -qmldir=. -verbose=1 -dmg
|
sudo macdeployqt /Users/runner/work/RibbonUI/RibbonUI/build/example/${targetName}.app -qmldir=. -verbose=1 -dmg
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -21,8 +21,8 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-12]
|
os: [macos-14]
|
||||||
qt_ver: [6.2.4]
|
qt_ver: [6.5.3]
|
||||||
qt_arch: [clang_64]
|
qt_arch: [clang_64]
|
||||||
env:
|
env:
|
||||||
targetName: RibbonUI-APP
|
targetName: RibbonUI-APP
|
||||||
|
@ -49,13 +49,15 @@ jobs:
|
||||||
cmake --version
|
cmake --version
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.2.4/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_STATIC_LIB=ON -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.5.3/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_STATIC_LIB=ON -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
- name: package
|
- name: package
|
||||||
run: |
|
run: |
|
||||||
|
# 先删除所有dSYM文件,减少包的体积
|
||||||
|
sudo find /Users/runner/work/RibbonUI/Qt/6.5.3/macos/qml -name "*.dSYM" | xargs rm -r
|
||||||
# 拷贝依赖
|
# 拷贝依赖
|
||||||
macdeployqt /Users/runner/work/RibbonUI/RibbonUI/build/example/${targetName}.app -qmldir=. -verbose=1 -dmg
|
sudo macdeployqt /Users/runner/work/RibbonUI/RibbonUI/build/example/${targetName}.app -qmldir=. -verbose=1 -dmg
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -22,8 +22,8 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-20.04]
|
os: [ubuntu-latest]
|
||||||
qt_ver: [6.2.4]
|
qt_ver: [6.5.3]
|
||||||
qt_arch: [gcc_64]
|
qt_arch: [gcc_64]
|
||||||
env:
|
env:
|
||||||
targetName: RibbonUI-APP
|
targetName: RibbonUI-APP
|
||||||
|
@ -46,7 +46,10 @@ jobs:
|
||||||
version: 1.10.2
|
version: 1.10.2
|
||||||
|
|
||||||
- name: ubuntu install GL library
|
- name: ubuntu install GL library
|
||||||
run: sudo apt-get install -y libxcb-cursor0 libgl1-mesa-dev libxcb1-dev libgtk-3-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
|
run: sudo apt install -y libxcb-cursor0 libgl1-mesa-dev libxcb1-dev libgtk-3-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
|
||||||
|
|
||||||
|
- name: ubuntu install libfuse2
|
||||||
|
run: sudo apt install libfuse2
|
||||||
|
|
||||||
- name: build ubuntu
|
- name: build ubuntu
|
||||||
run: |
|
run: |
|
||||||
|
@ -54,7 +57,7 @@ jobs:
|
||||||
cmake --version
|
cmake --version
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/RibbonUI/Qt/6.2.4/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/RibbonUI/Qt/6.5.3/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
- name: install QT linux deploy
|
- name: install QT linux deploy
|
||||||
|
|
|
@ -22,8 +22,8 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-20.04]
|
os: [ubuntu-latest]
|
||||||
qt_ver: [6.2.4]
|
qt_ver: [6.5.3]
|
||||||
qt_arch: [gcc_64]
|
qt_arch: [gcc_64]
|
||||||
env:
|
env:
|
||||||
targetName: RibbonUI-APP
|
targetName: RibbonUI-APP
|
||||||
|
@ -48,13 +48,16 @@ jobs:
|
||||||
- name: ubuntu install GL library
|
- name: ubuntu install GL library
|
||||||
run: sudo apt-get install -y libxcb-cursor0 libgl1-mesa-dev libxcb1-dev libgtk-3-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
|
run: sudo apt-get install -y libxcb-cursor0 libgl1-mesa-dev libxcb1-dev libgtk-3-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
|
||||||
|
|
||||||
|
- name: ubuntu install libfuse2
|
||||||
|
run: sudo apt install libfuse2
|
||||||
|
|
||||||
- name: build ubuntu
|
- name: build ubuntu
|
||||||
run: |
|
run: |
|
||||||
ninja --version
|
ninja --version
|
||||||
cmake --version
|
cmake --version
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/RibbonUI/Qt/6.2.4/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_STATIC_LIB=ON -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/RibbonUI/Qt/6.5.3/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_STATIC_LIB=ON -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
- name: install QT linux deploy
|
- name: install QT linux deploy
|
||||||
|
|
|
@ -18,12 +18,12 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: windows-2022
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- qt_arch: win64_mingw
|
- qt_arch: win64_mingw
|
||||||
qt_ver: 6.2.4
|
qt_ver: 6.5.3
|
||||||
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
|
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
|
||||||
qt_tools_mingw_install: mingw900_64
|
qt_tools_mingw_install: mingw900_64
|
||||||
env:
|
env:
|
||||||
|
@ -66,7 +66,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\RibbonUI\Qt\6.2.4\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\RibbonUI\Qt\6.5.3\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
- name: package
|
- name: package
|
||||||
|
|
|
@ -18,12 +18,12 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: windows-2022
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- qt_arch: win64_mingw
|
- qt_arch: win64_mingw
|
||||||
qt_ver: 6.2.4
|
qt_ver: 6.5.3
|
||||||
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
|
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
|
||||||
qt_tools_mingw_install: mingw900_64
|
qt_tools_mingw_install: mingw900_64
|
||||||
env:
|
env:
|
||||||
|
@ -66,7 +66,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\RibbonUI\Qt\6.2.4\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_STATIC_LIB=ON -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\RibbonUI\Qt\6.5.3\mingw_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_STATIC_LIB=ON -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
- name: package
|
- name: package
|
||||||
|
|
|
@ -21,9 +21,9 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-2019]
|
os: [windows-latest]
|
||||||
include:
|
include:
|
||||||
- qt_ver: 6.2.4
|
- qt_ver: 6.5.3
|
||||||
qt_arch: win64_msvc2019_64
|
qt_arch: win64_msvc2019_64
|
||||||
msvc_arch: x64
|
msvc_arch: x64
|
||||||
qt_arch_install: msvc2019_64
|
qt_arch_install: msvc2019_64
|
||||||
|
@ -36,6 +36,11 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup ninja
|
||||||
|
uses: seanmiddleditch/gha-setup-ninja@master
|
||||||
|
with:
|
||||||
|
version: 1.10.2
|
||||||
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v3
|
uses: jurplel/install-qt-action@v3
|
||||||
with:
|
with:
|
||||||
|
@ -47,10 +52,10 @@ jobs:
|
||||||
id: build
|
id: build
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\RibbonUI\Qt\6.2.4\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\RibbonUI\Qt\6.5.3\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
|
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
|
||||||
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
|
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
|
||||||
|
|
|
@ -21,9 +21,9 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-2019]
|
os: [windows-latest]
|
||||||
include:
|
include:
|
||||||
- qt_ver: 6.2.4
|
- qt_ver: 6.5.3
|
||||||
qt_arch: win64_msvc2019_64
|
qt_arch: win64_msvc2019_64
|
||||||
msvc_arch: x64
|
msvc_arch: x64
|
||||||
qt_arch_install: msvc2019_64
|
qt_arch_install: msvc2019_64
|
||||||
|
@ -36,6 +36,11 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup ninja
|
||||||
|
uses: seanmiddleditch/gha-setup-ninja@master
|
||||||
|
with:
|
||||||
|
version: 1.10.2
|
||||||
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v3
|
uses: jurplel/install-qt-action@v3
|
||||||
with:
|
with:
|
||||||
|
@ -47,10 +52,10 @@ jobs:
|
||||||
id: build
|
id: build
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\RibbonUI\Qt\6.2.4\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_STATIC_LIB=ON -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\RibbonUI\Qt\6.5.3\msvc2019_64 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_STATIC_LIB=ON -GNinja ..
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
|
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
|
||||||
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
|
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d9ce1c4302ceabfd8748a7658ae9a2d918575303
|
Subproject commit 43f632f2617bd8748fdca605e2fe0b4b67649324
|
|
@ -81,7 +81,7 @@ RibbonUI是一个参考微软Ribbon风格(即Office 2016后的风格)设计
|
||||||
## 4. 如何使用?
|
## 4. 如何使用?
|
||||||
+ 安装前准备
|
+ 安装前准备
|
||||||
|
|
||||||
安装Qt 6,推荐通过官方在线安装器安装**Qt 6.2.4 LTS版本**,**通过brew等方式安装可能会出现问题**。**Qt Quick相关模块**和**qt5compat qtshadertools qtimageformats**组件是必要的。
|
安装Qt 6,推荐通过官方在线安装器安装**Qt 6.5.3 LTS版本**,**通过brew等方式安装可能会出现问题**。**Qt Quick相关模块**和**qt5compat qtshadertools qtimageformats**组件是必要的。
|
||||||
|
|
||||||
+ 编译例程和库
|
+ 编译例程和库
|
||||||
- 下载仓库并进入
|
- 下载仓库并进入
|
||||||
|
@ -98,7 +98,7 @@ RibbonUI是一个参考微软Ribbon风格(即Office 2016后的风格)设计
|
||||||
```shell
|
```shell
|
||||||
# 如果想进行Debug编译, 请配置 -DCMAKE_BUILD_TYPE=Debug和--config Debug参数
|
# 如果想进行Debug编译, 请配置 -DCMAKE_BUILD_TYPE=Debug和--config Debug参数
|
||||||
# 如果想编译静态库, 请在cmake参数中加入-DRIBBONUI_BUILD_STATIC_LIB=ON
|
# 如果想编译静态库, 请在cmake参数中加入-DRIBBONUI_BUILD_STATIC_LIB=ON
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.2.4/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.5.3/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
# -DCMAKE_PREFIX_PATH={你的Qt安装目录}
|
# -DCMAKE_PREFIX_PATH={你的Qt安装目录}
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
```
|
```
|
||||||
|
@ -112,7 +112,7 @@ RibbonUI是一个参考微软Ribbon风格(即Office 2016后的风格)设计
|
||||||
```shell
|
```shell
|
||||||
# 如果想进行Debug编译, 请配置 -DCMAKE_BUILD_TYPE=Debug和--config Debug参数
|
# 如果想进行Debug编译, 请配置 -DCMAKE_BUILD_TYPE=Debug和--config Debug参数
|
||||||
# 如果想编译静态库, 请在cmake参数中加入-DRIBBONUI_BUILD_STATIC_LIB=ON
|
# 如果想编译静态库, 请在cmake参数中加入-DRIBBONUI_BUILD_STATIC_LIB=ON
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.2.4/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_EXAMPLES=OFF -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.5.3/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_EXAMPLES=OFF -GNinja ..
|
||||||
# -DCMAKE_PREFIX_PATH={你的Qt安装目录}
|
# -DCMAKE_PREFIX_PATH={你的Qt安装目录}
|
||||||
cmake --build . --target all --config Release --parallel
|
cmake --build . --target all --config Release --parallel
|
||||||
```
|
```
|
||||||
|
|
|
@ -79,7 +79,7 @@ The current design is based on Qt 6, and support for Qt 5 will be added sometime
|
||||||
## 4. How to use it?
|
## 4. How to use it?
|
||||||
+ Before Install
|
+ Before Install
|
||||||
|
|
||||||
To install Qt 6, it is recommended to install the **Qt 6.2.4** LTS version via the official online installer, **installing via brew, etc. may cause problems**. **Qt Quick related modules** and the **qt5compat qtshadertools qtimageformats** component are required
|
To install Qt 6, it is recommended to install the **Qt 6.5.3** LTS version via the official online installer, **installing via brew, etc. may cause problems**. **Qt Quick related modules** and the **qt5compat qtshadertools qtimageformats** component are required
|
||||||
|
|
||||||
+ Compile the example and library
|
+ Compile the example and library
|
||||||
- Clone and enter the library folder
|
- Clone and enter the library folder
|
||||||
|
@ -96,7 +96,7 @@ The current design is based on Qt 6, and support for Qt 5 will be added sometime
|
||||||
```shell
|
```shell
|
||||||
# if you want to make a Debug build, just let -DCMAKE_BUILD_TYPE=Debug, --config Debug
|
# if you want to make a Debug build, just let -DCMAKE_BUILD_TYPE=Debug, --config Debug
|
||||||
# if you want a static build, add -DRIBBONUI_BUILD_STATIC_LIB=ON into command
|
# if you want a static build, add -DRIBBONUI_BUILD_STATIC_LIB=ON into command
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.2.4/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.5.3/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
# -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
|
||||||
```
|
```
|
||||||
|
@ -110,7 +110,7 @@ The current design is based on Qt 6, and support for Qt 5 will be added sometime
|
||||||
```shell
|
```shell
|
||||||
# if you want to make a Debug build, just let -DCMAKE_BUILD_TYPE=Debug, --config Debug
|
# if you want to make a Debug build, just let -DCMAKE_BUILD_TYPE=Debug, --config Debug
|
||||||
# if you want a static build, add -DRIBBONUI_BUILD_STATIC_LIB=ON into command
|
# if you want a static build, add -DRIBBONUI_BUILD_STATIC_LIB=ON into command
|
||||||
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.2.4/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_EXAMPLES=OFF -GNinja ..
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/Users/runner/work/RibbonUI/Qt/6.5.3/macos -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DRIBBONUI_BUILD_EXAMPLES=OFF -GNinja ..
|
||||||
# -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
|
||||||
```
|
```
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QtQml/qqml.h>
|
#include <QtQml/qqml.h>
|
||||||
|
#include <QtQml/qqmlregistration.h>
|
||||||
|
|
||||||
namespace RibbonIconsFilledEnum {
|
namespace RibbonIconsFilledEnum {
|
||||||
Q_NAMESPACE
|
Q_NAMESPACE
|
||||||
|
@ -2336,7 +2337,12 @@ enum class RibbonIcons_Filled{
|
||||||
};
|
};
|
||||||
Q_ENUM_NS(RibbonIcons_Filled)
|
Q_ENUM_NS(RibbonIcons_Filled)
|
||||||
QML_NAMED_ELEMENT(RibbonIcons_Filled)
|
QML_NAMED_ELEMENT(RibbonIcons_Filled)
|
||||||
|
#if (QT_VERSION > QT_VERSION_CHECK(6, 3, 0))
|
||||||
|
Q_CLASSINFO("QML.Creatable", "false")
|
||||||
|
Q_CLASSINFO("QML.UncreatableReason", "This type is right-valued only.")
|
||||||
|
#elif (QT_VERSION <= QT_VERSION_CHECK(6, 3, 0))
|
||||||
QML_UNCREATABLE("This type is right-valued only.")
|
QML_UNCREATABLE("This type is right-valued only.")
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace RibbonIconsRegularEnum {
|
namespace RibbonIconsRegularEnum {
|
||||||
|
@ -4667,7 +4673,12 @@ enum class RibbonIcons_Regular{
|
||||||
};
|
};
|
||||||
Q_ENUM_NS(RibbonIcons_Regular)
|
Q_ENUM_NS(RibbonIcons_Regular)
|
||||||
QML_NAMED_ELEMENT(RibbonIcons)
|
QML_NAMED_ELEMENT(RibbonIcons)
|
||||||
|
#if (QT_VERSION > QT_VERSION_CHECK(6, 3, 0))
|
||||||
|
Q_CLASSINFO("QML.Creatable", "false")
|
||||||
|
Q_CLASSINFO("QML.UncreatableReason", "This type is right-valued only.")
|
||||||
|
#elif (QT_VERSION <= QT_VERSION_CHECK(6, 3, 0))
|
||||||
QML_UNCREATABLE("This type is right-valued only.")
|
QML_UNCREATABLE("This type is right-valued only.")
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace RibbonThemeType {
|
namespace RibbonThemeType {
|
||||||
|
@ -4679,7 +4690,12 @@ enum class ThemeMode {
|
||||||
};
|
};
|
||||||
Q_ENUM_NS(ThemeMode)
|
Q_ENUM_NS(ThemeMode)
|
||||||
QML_NAMED_ELEMENT(RibbonThemeType)
|
QML_NAMED_ELEMENT(RibbonThemeType)
|
||||||
|
#if (QT_VERSION > QT_VERSION_CHECK(6, 3, 0))
|
||||||
|
Q_CLASSINFO("QML.Creatable", "false")
|
||||||
|
Q_CLASSINFO("QML.UncreatableReason", "This type is right-valued only.")
|
||||||
|
#elif (QT_VERSION <= QT_VERSION_CHECK(6, 3, 0))
|
||||||
QML_UNCREATABLE("This type is right-valued only.")
|
QML_UNCREATABLE("This type is right-valued only.")
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,14 +11,12 @@ Item {
|
||||||
property bool show_darkmode_btn: true
|
property bool show_darkmode_btn: true
|
||||||
property bool dark_mode: RibbonTheme.dark_mode
|
property bool dark_mode: RibbonTheme.dark_mode
|
||||||
property bool modern_style: RibbonTheme.modern_style
|
property bool modern_style: RibbonTheme.modern_style
|
||||||
|
property bool show_buildin_title_btn: Qt.platform.os !== "osx" || RibbonUI.qt_version > 624
|
||||||
property string title_color: modern_style ? "transparent" : dark_mode ? "#282828" : "#2C59B7"
|
property string title_color: modern_style ? "transparent" : dark_mode ? "#282828" : "#2C59B7"
|
||||||
property string title_text_color: modern_style ? dark_mode ? "white" : "black" : "white"
|
property string title_text_color: modern_style ? dark_mode ? "white" : "black" : "white"
|
||||||
default property alias content: left_container.data
|
default property alias content: left_container.data
|
||||||
property alias left_content: left_container.data
|
property alias left_content: left_container.data
|
||||||
property alias right_content: right_container.data
|
property alias right_content: right_container.data
|
||||||
property alias maximizeBtn: maximizeBtn
|
|
||||||
property alias minimizeBtn: minimizeBtn
|
|
||||||
property alias closeBtn: closeBtn
|
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
@ -42,7 +40,7 @@ Item {
|
||||||
id: title_text
|
id: title_text
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: control.title
|
text: control.title
|
||||||
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
|
font.family: show_buildin_title_btn ? "PingFang SC" : "Microsoft YaHei UI"
|
||||||
color: title_text_color
|
color: title_text_color
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
|
@ -59,9 +57,13 @@ Item {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
left: parent.left
|
left: parent.left
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
leftMargin: Qt.platform.os === "osx" ? 65 : 10
|
leftMargin: !show_buildin_title_btn ? 65 : 10
|
||||||
}
|
}
|
||||||
Layout.maximumWidth: (parent.width - title_text.contentWidth) / 2
|
Layout.maximumWidth: (parent.width - title_text.contentWidth) / 2
|
||||||
|
Loader{
|
||||||
|
active: Qt.platform.os === "osx"
|
||||||
|
sourceComponent: title_btns
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout{
|
RowLayout{
|
||||||
|
@ -75,54 +77,9 @@ Item {
|
||||||
}
|
}
|
||||||
Layout.maximumWidth: (parent.width - title_text.contentWidth) / 2
|
Layout.maximumWidth: (parent.width - title_text.contentWidth) / 2
|
||||||
layoutDirection: Qt.RightToLeft
|
layoutDirection: Qt.RightToLeft
|
||||||
RowLayout{
|
Loader{
|
||||||
visible: Qt.platform.os !== "osx"
|
active: Qt.platform.os !== "osx"
|
||||||
layoutDirection: Qt.RightToLeft
|
sourceComponent: title_btns
|
||||||
spacing: 0
|
|
||||||
Layout.rightMargin: Qt.platform.os === "osx" ? -5 : 0
|
|
||||||
RibbonButton{
|
|
||||||
id: closeBtn
|
|
||||||
show_bg:false
|
|
||||||
icon_source: RibbonIcons.Dismiss
|
|
||||||
icon_source_filled: RibbonIcons_Filled.Dismiss
|
|
||||||
text_color: titleBar.title_text_color
|
|
||||||
hover_color: "#ED6B5E"
|
|
||||||
pressed_color: "#B55149"
|
|
||||||
text_color_reverse: false
|
|
||||||
tip_text: qsTr("Close")
|
|
||||||
onClicked: Window.window.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
RibbonButton{
|
|
||||||
id: minimizeBtn
|
|
||||||
show_bg:false
|
|
||||||
icon_source: RibbonIcons.Subtract
|
|
||||||
icon_source_filled: RibbonIcons_Filled.Subtract
|
|
||||||
text_color: titleBar.title_text_color
|
|
||||||
hover_color: "#F4BE4F"
|
|
||||||
pressed_color: "#B78F3B"
|
|
||||||
text_color_reverse: false
|
|
||||||
tip_text: qsTr("Minimize")
|
|
||||||
font.bold: pressed || checked
|
|
||||||
onClicked: Window.window.visibility = Window.Minimized
|
|
||||||
}
|
|
||||||
|
|
||||||
RibbonButton{
|
|
||||||
id: maximizeBtn
|
|
||||||
show_bg:false
|
|
||||||
icon_source: Window.window.visibility === Window.Maximized ? RibbonIcons.ArrowMinimize : RibbonIcons.ArrowMaximize
|
|
||||||
text_color: titleBar.title_text_color
|
|
||||||
hover_color: "#61C554"
|
|
||||||
pressed_color: "#48953F"
|
|
||||||
text_color_reverse: false
|
|
||||||
tip_text: Window.window.visibility === Window.Maximized ? qsTr("Restore") : qsTr("Maximize")
|
|
||||||
onClicked: {
|
|
||||||
if (Window.window.visibility === Window.Maximized)
|
|
||||||
Window.window.visibility = Window.Windowed
|
|
||||||
else
|
|
||||||
Window.window.visibility = Window.Maximized
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
RibbonSwitchButton{
|
RibbonSwitchButton{
|
||||||
text: qsTr("Style")
|
text: qsTr("Style")
|
||||||
|
@ -154,4 +111,54 @@ Item {
|
||||||
visible: show_darkmode_btn
|
visible: show_darkmode_btn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component{
|
||||||
|
id: title_btns
|
||||||
|
RowLayout{
|
||||||
|
visible: show_buildin_title_btn
|
||||||
|
layoutDirection: Qt.platform.os === "osx" ? Qt.LeftToRight : Qt.RightToLeft
|
||||||
|
spacing: 0
|
||||||
|
Layout.rightMargin: show_buildin_title_btn ? -5 : 0
|
||||||
|
RibbonButton{
|
||||||
|
show_bg:false
|
||||||
|
icon_source: RibbonIcons.Dismiss
|
||||||
|
icon_source_filled: RibbonIcons_Filled.Dismiss
|
||||||
|
text_color: titleBar.title_text_color
|
||||||
|
hover_color: "#ED6B5E"
|
||||||
|
pressed_color: "#B55149"
|
||||||
|
text_color_reverse: false
|
||||||
|
tip_text: qsTr("Close")
|
||||||
|
onClicked: Window.window.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
RibbonButton{
|
||||||
|
show_bg:false
|
||||||
|
icon_source: RibbonIcons.Subtract
|
||||||
|
icon_source_filled: RibbonIcons_Filled.Subtract
|
||||||
|
text_color: titleBar.title_text_color
|
||||||
|
hover_color: "#F4BE4F"
|
||||||
|
pressed_color: "#B78F3B"
|
||||||
|
text_color_reverse: false
|
||||||
|
tip_text: qsTr("Minimize")
|
||||||
|
font.bold: pressed || checked
|
||||||
|
onClicked: Window.window.visibility = Window.Minimized
|
||||||
|
}
|
||||||
|
|
||||||
|
RibbonButton{
|
||||||
|
show_bg:false
|
||||||
|
icon_source: Window.window.visibility === Window.Maximized ? RibbonIcons.ArrowMinimize : RibbonIcons.ArrowMaximize
|
||||||
|
text_color: titleBar.title_text_color
|
||||||
|
hover_color: "#61C554"
|
||||||
|
pressed_color: "#48953F"
|
||||||
|
text_color_reverse: false
|
||||||
|
tip_text: Window.window.visibility === Window.Maximized ? qsTr("Restore") : qsTr("Maximize")
|
||||||
|
onClicked: {
|
||||||
|
if (Window.window.visibility === Window.Maximized)
|
||||||
|
Window.window.visibility = Window.Windowed
|
||||||
|
else
|
||||||
|
Window.window.visibility = Window.Maximized
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include "ribbontheme.h"
|
#include "ribbontheme.h"
|
||||||
|
#include <QMutex>
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
||||||
#include <QStyleHints>
|
#include <QStyleHints>
|
||||||
#elif ((QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)))
|
#elif (QT_VERSION >= QT_VERSION_CHECK(6, 2, 1))
|
||||||
#include <QtGui/qpa/qplatformtheme.h>
|
#include <QtGui/qpa/qplatformtheme.h>
|
||||||
#include <QtGui/private/qguiapplication_p.h>
|
#include <QtGui/private/qguiapplication_p.h>
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -8,6 +8,8 @@ RibbonUI::RibbonUI(QQuickItem *parent)
|
||||||
: QQuickItem(parent)
|
: QQuickItem(parent)
|
||||||
{
|
{
|
||||||
version(VER_JOIN((RIBBONUI_VERSION)));
|
version(VER_JOIN((RIBBONUI_VERSION)));
|
||||||
|
qt_version(QString(qVersion()).replace('.',"").toInt());
|
||||||
|
qDebug()<<_qt_version;
|
||||||
}
|
}
|
||||||
|
|
||||||
RibbonUI* RibbonUI::instance(){
|
RibbonUI* RibbonUI::instance(){
|
||||||
|
|
|
@ -11,6 +11,7 @@ class RibbonUI : public QQuickItem
|
||||||
QML_SINGLETON
|
QML_SINGLETON
|
||||||
QML_NAMED_ELEMENT(RibbonUI)
|
QML_NAMED_ELEMENT(RibbonUI)
|
||||||
Q_PROPERTY_RW(QString, version)
|
Q_PROPERTY_RW(QString, version)
|
||||||
|
Q_PROPERTY_RW(int, qt_version)
|
||||||
public:
|
public:
|
||||||
static RibbonUI* instance();
|
static RibbonUI* instance();
|
||||||
static RibbonUI* create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return instance();}
|
static RibbonUI* create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return instance();}
|
||||||
|
|
Loading…
Reference in New Issue