Compare commits
146 Commits
Author | SHA1 | Date | |
---|---|---|---|
430fac2f77 | |||
c15470f723 | |||
2aef114969 | |||
c0e470d78e | |||
c8f2d7c926 | |||
b032e0306f | |||
36ac017e3d | |||
981445630b | |||
9494ec4ac6 | |||
d71441e7c5 | |||
9f0b8c5ec5 | |||
94c0356c25 | |||
9e73f33877 | |||
adc8040604 | |||
82d1edc43c | |||
da17b31be7 | |||
67518fb4e6 | |||
2bd03ad9d8 | |||
e16a8d6b09 | |||
9e0050be63 | |||
a4398d1a2f | |||
a27e5db032 | |||
f7c17a27b6 | |||
020a75ac93 | |||
1b0cdd6152 | |||
1a9cca4300 | |||
d939546f31 | |||
9f9d9da601 | |||
6d24cbf37c | |||
d2929ad701 | |||
689843fbef | |||
c6db001b74 | |||
3ec0841b44 | |||
b3d1568de4 | |||
2511c5dba8 | |||
3049be128f | |||
3291b3a882 | |||
d5744a39bd | |||
882606b2f6 | |||
aba33c4d1f | |||
51aef3f3ec | |||
221afeea58 | |||
c19f5d4c48 | |||
d2eb72cc5b | |||
420a9b2bbb | |||
59dacd8fae | |||
7489a4bcbe | |||
6dd859dd1d | |||
98363542d3 | |||
5b836a4d82 | |||
7dcb65f7b6 | |||
60c2ebee56 | |||
88fed82260 | |||
cb94db8a97 | |||
88008e16be | |||
f2db544be0 | |||
6db8c4d4ac | |||
4ab78bbaba | |||
11b2b04cb9 | |||
9f2e066a9f | |||
5b8312dcb9 | |||
b28f15c23b | |||
935f515a49 | |||
70585c007e | |||
bdde046a4d | |||
ad420366f1 | |||
727a0220b4 | |||
ab0fcf5d9c | |||
f43bfec992 | |||
6bf38b5e5e | |||
73ff2b45b9 | |||
7303e7d900 | |||
5ca1b715f3 | |||
cd984fddf5 | |||
2acb3c34bd | |||
1df3b4ba96 | |||
5ea3cb1054 | |||
5afd2ec518 | |||
59527fc954 | |||
c26fdfaee3 | |||
878dbd668b | |||
b10a0752fb | |||
51e73e7f8e | |||
3a46fd11c6 | |||
70f048f629 | |||
1f2d0d9b9f | |||
09e87e0fb8 | |||
0603a7603d | |||
d9a4f01e20 | |||
93709cd1dd | |||
0000e557a7 | |||
d2183e350e | |||
47caf4bb52 | |||
6fb9ee41fb | |||
b349c22434 | |||
12fa3487bb | |||
a76806645a | |||
738db25c2c | |||
9f8a5f5646 | |||
c59c07e756 | |||
2084b5afa3 | |||
f8d717f41b | |||
be58fc5e7d | |||
1c0bc7208a | |||
d89aaec062 | |||
13abd275b4 | |||
e8460c2409 | |||
6de1b9d78f | |||
64fa2b6370 | |||
8970a0c09a | |||
e7cea72825 | |||
93186edfbe | |||
e60883bc60 | |||
47ab4dabbd | |||
206669e5f0 | |||
08457dc75e | |||
0c59a233ea | |||
fcb8da2c50 | |||
a8701256d4 | |||
8eaa4b6cbb | |||
af80a882d0 | |||
9d89328a43 | |||
0d4477437f | |||
6b3e73ce0b | |||
625bc74e26 | |||
731e4f27b4 | |||
fce64eccc6 | |||
689e0805e7 | |||
986f1242dd | |||
a9c97a5c56 | |||
81e78834d0 | |||
5279a2c7b2 | |||
6391fc8dc6 | |||
9cf4b4b1af | |||
32c0b4ccd6 | |||
b2bfdd17da | |||
27db8160d4 | |||
ed0c9048b0 | |||
de2c891912 | |||
16daeb5268 | |||
0b37ddcb6e | |||
d2e3e6dd4b | |||
1e5bd75123 | |||
1b97b197a4 | |||
936a310ca6 | |||
3236be8a7f |
51
.github/workflows/macos.yml
vendored
@ -2,64 +2,73 @@ name: MacOS
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- '*.pro'
|
- '*.txt'
|
||||||
|
- 'example/**'
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
|
- 'scripts/**'
|
||||||
- '.github/workflows/macos.yml'
|
- '.github/workflows/macos.yml'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '*.pro'
|
- '*.txt'
|
||||||
|
- 'example/**'
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
|
- 'scripts/**'
|
||||||
- '.github/workflows/macos.yml'
|
- '.github/workflows/macos.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-11.0]
|
os: [macos-12]
|
||||||
qt_ver: [6.4.3]
|
qt_ver: [6.4.3]
|
||||||
qt_arch: [clang_64]
|
qt_arch: [clang_64]
|
||||||
env:
|
env:
|
||||||
targetName: example
|
targetName: example
|
||||||
steps:
|
steps:
|
||||||
# macos 11.0 默认环境变了,要指定
|
- name: Check out repository
|
||||||
- name: prepare env
|
uses: actions/checkout@v3
|
||||||
if: ${{ matrix.os == 'macos-11.0' }}
|
with:
|
||||||
run: |
|
submodules: recursive
|
||||||
softwareupdate --all --install --force
|
|
||||||
sudo xcode-select --print-path
|
|
||||||
sudo xcode-select --switch /Library/Developer/CommandLineTools
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v3
|
uses: jurplel/install-qt-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt_ver }}
|
||||||
cached: 'false'
|
cache: ${{steps.cache-qt.outputs.cache-hit}}
|
||||||
arch: ${{ matrix.qt_arch }}
|
arch: ${{ matrix.qt_arch }}
|
||||||
modules: 'qt5compat qtmultimedia qtshadertools'
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
- name: Set up Ninja
|
||||||
|
uses: seanmiddleditch/gha-setup-ninja@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
version: 1.10.2
|
||||||
|
|
||||||
- name: build macos
|
- name: build macos
|
||||||
run: |
|
run: |
|
||||||
qmake
|
cmake --version
|
||||||
make
|
mkdir build
|
||||||
# 打包
|
cd build
|
||||||
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
- name: package
|
- name: package
|
||||||
run: |
|
run: |
|
||||||
# 拷贝依赖
|
# 拷贝依赖
|
||||||
macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg
|
macdeployqt bin/release/${targetName}.app -qmldir=. -verbose=1 -dmg
|
||||||
# 上传artifacts
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}.zip
|
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}.zip
|
||||||
path: bin/release/${{ env.targetName }}.app
|
path: bin/release/${{ env.targetName }}.app
|
||||||
# tag 上传Release
|
|
||||||
- name: uploadRelease
|
- name: uploadRelease
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
if: startsWith(github.event.ref, 'refs/tags/')
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: bin/release/${{ env.targetName }}.dmg
|
file: bin/release/${{ env.targetName }}.dmg
|
||||||
asset_name: ${{ env.targetName }}_${{ matrix.os }}_${{ matrix.qt_ver }}.dmg
|
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.dmg
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
55
.github/workflows/ubuntu.yml
vendored
@ -1,17 +1,21 @@
|
|||||||
name: Ubuntu
|
name: Ubuntu
|
||||||
# Qt官方没有linux平台的x86包
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- '*.pro'
|
- '*.txt'
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
|
- 'example/**'
|
||||||
|
- 'scripts/**'
|
||||||
- '.github/workflows/ubuntu.yml'
|
- '.github/workflows/ubuntu.yml'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '*.pro'
|
- '*.txt'
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
- '.github/workflows/ubuntu.yml'
|
- 'example/**'
|
||||||
|
- 'scripts/**'
|
||||||
|
- '.github/workflows/ubuntu.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
@ -24,46 +28,63 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
targetName: example
|
targetName: example
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v3
|
uses: jurplel/install-qt-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt_ver }}
|
||||||
cached: 'false'
|
cache: ${{steps.cache-qt.outputs.cache-hit}}
|
||||||
arch: ${{ matrix.qt_arch }}
|
arch: ${{ matrix.qt_arch }}
|
||||||
modules: 'qt5compat qtmultimedia qtshadertools'
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||||
- name: ubuntu install GL library
|
|
||||||
run: sudo apt-get install -y libglew-dev libglfw3-dev qml-module-qtquick-controls qml-module-qtquick-controls2
|
- name: Set up Ninja
|
||||||
- uses: actions/checkout@v2
|
uses: seanmiddleditch/gha-setup-ninja@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
version: 1.10.2
|
||||||
|
|
||||||
|
- name: ubuntu install GL library
|
||||||
|
run: sudo apt-get install -y 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: build ubuntu
|
- name: build ubuntu
|
||||||
run: |
|
run: |
|
||||||
qmake
|
ninja --version
|
||||||
make
|
cmake --version
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
- name: install QT linux deploy
|
- name: install QT linux deploy
|
||||||
uses: miurahr/install-linuxdeploy-action@v1
|
uses: miurahr/install-linuxdeploy-action@v1
|
||||||
with:
|
with:
|
||||||
plugins: qt appimage
|
plugins: qt appimage
|
||||||
# 打包
|
|
||||||
|
- name: Check if svg file exists
|
||||||
|
run: if [ ! -f "${targetName}.svg" ]; then echo "File not found, creating..."; touch ${targetName}.svg; fi
|
||||||
|
|
||||||
- name: package
|
- name: package
|
||||||
run: |
|
run: |
|
||||||
# make sure Qt plugin finds QML sources so it can deploy the imported files
|
# make sure Qt plugin finds QML sources so it can deploy the imported files
|
||||||
export QML_SOURCES_PATHS=src
|
export QML_SOURCES_PATHS=./
|
||||||
# 拷贝依赖
|
# 拷贝依赖
|
||||||
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=bin/release/${targetName} --appdir bin/release/
|
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=bin/release/${targetName} --appdir bin/release/
|
||||||
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}.AppImage
|
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}.AppImage
|
||||||
# 上传artifacts
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}
|
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}
|
||||||
path: ${{ env.targetName }}.AppImage
|
path: ${{ env.targetName }}.AppImage
|
||||||
# tag 上传Release
|
|
||||||
- name: uploadRelease
|
- name: uploadRelease
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
if: startsWith(github.event.ref, 'refs/tags/')
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: ${{ env.targetName }}.AppImage
|
file: ${{ env.targetName }}.AppImage
|
||||||
asset_name: ${{ env.targetName }}_${{ matrix.os }}_${{ matrix.qt_ver }}.AppImage
|
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.AppImage
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
91
.github/workflows/windows-mingw.yml
vendored
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
name: Windows MinGW
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '*.txt'
|
||||||
|
- 'src/**'
|
||||||
|
- 'example/**'
|
||||||
|
- 'scripts/**'
|
||||||
|
- '.github/workflows/windows-mingw.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '*.txt'
|
||||||
|
- 'example/**'
|
||||||
|
- 'src/**'
|
||||||
|
- 'scripts/**'
|
||||||
|
- '.github/workflows/windows-mingw.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: windows-2022
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- qt_arch: win64_mingw
|
||||||
|
qt_ver: 6.4.3
|
||||||
|
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
|
||||||
|
qt_tools_mingw_install: mingw900_64
|
||||||
|
env:
|
||||||
|
targetName: example.exe
|
||||||
|
fileName: example
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install Qt
|
||||||
|
uses: jurplel/install-qt-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.qt_ver }}
|
||||||
|
arch: ${{ matrix.qt_arch }}
|
||||||
|
cache: ${{steps.cache-qt.outputs.cache-hit}}
|
||||||
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||||
|
|
||||||
|
- name: Qt6 environment configuration
|
||||||
|
if: ${{ startsWith( matrix.qt_ver, 6 ) }}
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
Write-Output "${{ env.Qt6_DIR }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
Write-Output "${{ env.Qt6_DIR }}/../../Tools/${{ matrix.qt_tools_mingw_install }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
|
||||||
|
- name: where is cmake & where is mingw32-make
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
Get-Command -Name 'cmake' | Format-List
|
||||||
|
Get-Command -Name 'mingw32-make' | Format-List
|
||||||
|
|
||||||
|
- name: mingw-build
|
||||||
|
id: build
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
|
cmake --build . --target all --config Release --parallel
|
||||||
|
|
||||||
|
- name: package
|
||||||
|
id: package
|
||||||
|
env:
|
||||||
|
archiveName: ${{ env.fileName }}-${{ matrix.qt_arch }}-${{ matrix.qt_ver }}
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
& scripts\windows-mingw-publish.ps1 ${env:archiveName} ${env:targetName}
|
||||||
|
$name = ${env:archiveName}
|
||||||
|
echo "::set-output name=packageName::$name"
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ${{ steps.package.outputs.packageName }}
|
||||||
|
path: ${{ steps.package.outputs.packageName }}
|
||||||
|
|
||||||
|
- name: uploadRelease
|
||||||
|
if: startsWith(github.event.ref, 'refs/tags/')
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
file: ${{ steps.package.outputs.packageName }}.zip
|
||||||
|
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.zip
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
overwrite: true
|
53
.github/workflows/windows.yml
vendored
@ -1,25 +1,27 @@
|
|||||||
name: Windows
|
name: Windows
|
||||||
on:
|
on:
|
||||||
# push代码时触发workflow
|
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- '*.pro'
|
- '*.txt'
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
|
- 'example/**'
|
||||||
|
- 'scripts/**'
|
||||||
- '.github/workflows/windows.yml'
|
- '.github/workflows/windows.yml'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '*.pro'
|
- '*.txt'
|
||||||
|
- 'example/**'
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
- '.github/workflows/windows.yml'
|
- 'scripts/**'
|
||||||
|
- '.github/workflows/windows.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
# 运行平台, windows-latest目前是windows server 2019
|
runs-on: ${{ matrix.os }}
|
||||||
# 参考文档 https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
|
|
||||||
runs-on: windows-2019
|
|
||||||
strategy:
|
strategy:
|
||||||
# 矩阵配置
|
|
||||||
matrix:
|
matrix:
|
||||||
|
os: [windows-2019]
|
||||||
include:
|
include:
|
||||||
- qt_ver: 6.4.3
|
- qt_ver: 6.4.3
|
||||||
qt_arch: win64_msvc2019_64
|
qt_arch: win64_msvc2019_64
|
||||||
@ -28,34 +30,34 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
targetName: example.exe
|
targetName: example.exe
|
||||||
fileName: example
|
fileName: example
|
||||||
# 步骤
|
|
||||||
steps:
|
steps:
|
||||||
# 安装Qt
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
# 使用外部action。这个action专门用来安装Qt
|
|
||||||
uses: jurplel/install-qt-action@v3
|
uses: jurplel/install-qt-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.qt_ver }}
|
version: ${{ matrix.qt_ver }}
|
||||||
arch: ${{ matrix.qt_arch }}
|
arch: ${{ matrix.qt_arch }}
|
||||||
cached: 'false'
|
cache: ${{steps.cache-qt.outputs.cache-hit}}
|
||||||
modules: 'qt5compat qtmultimedia qtshadertools'
|
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
|
||||||
# 拉取代码
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
# msvc编译
|
|
||||||
- name: msvc-build
|
- name: msvc-build
|
||||||
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 (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
|
||||||
qmake
|
mkdir build
|
||||||
nmake
|
cd build
|
||||||
|
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
|
||||||
|
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%
|
||||||
echo vcToolsInstallDir=%VCToolsInstallDir% >> %GITHUB_ENV%
|
echo vcToolsInstallDir=%VCToolsInstallDir% >> %GITHUB_ENV%
|
||||||
echo vcToolsRedistDir=%VCToolsRedistDir% >> %GITHUB_ENV%
|
echo vcToolsRedistDir=%VCToolsRedistDir% >> %GITHUB_ENV%
|
||||||
# 打包
|
|
||||||
- name: package
|
- name: package
|
||||||
id: package
|
id: package
|
||||||
env:
|
env:
|
||||||
@ -66,20 +68,19 @@ jobs:
|
|||||||
& scripts\windows-publish.ps1 ${env:archiveName} ${env:targetName}
|
& scripts\windows-publish.ps1 ${env:archiveName} ${env:targetName}
|
||||||
# 记录packageName给后续step
|
# 记录packageName给后续step
|
||||||
$name = ${env:archiveName}
|
$name = ${env:archiveName}
|
||||||
echo "::set-output name=packageName::$name"
|
echo "::set-output name=packageName::$name"
|
||||||
# tag 查询github-Release
|
|
||||||
# 上传artifacts
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.package.outputs.packageName }}
|
name: ${{ steps.package.outputs.packageName }}
|
||||||
path: ${{ steps.package.outputs.packageName }}
|
path: ${{ steps.package.outputs.packageName }}
|
||||||
# tag 上传Release
|
|
||||||
- name: uploadRelease
|
- name: uploadRelease
|
||||||
if: startsWith(github.event.ref, 'refs/tags/')
|
if: startsWith(github.event.ref, 'refs/tags/')
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: ${{ steps.package.outputs.packageName }}.zip
|
file: ${{ steps.package.outputs.packageName }}.zip
|
||||||
asset_name: ${{ steps.package.outputs.packageName }}.zip
|
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.zip
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
4
.gitignore
vendored
@ -32,4 +32,6 @@ target_wrapper.*
|
|||||||
CMakeLists.txt.user*
|
CMakeLists.txt.user*
|
||||||
|
|
||||||
src/build-preset/plugins.qmltypes
|
src/build-preset/plugins.qmltypes
|
||||||
bin
|
bin
|
||||||
|
.DS_Store
|
||||||
|
build
|
BIN
3rdparty/mingw/libgcc_s_seh-1.dll
vendored
Normal file
BIN
3rdparty/mingw/libstdc++-6.dll
vendored
Normal file
BIN
3rdparty/mingw/libwinpthread-1.dll
vendored
Normal file
BIN
3rdparty/msvc/libcrypto-1_1-x64.dll
vendored
Normal file
BIN
3rdparty/msvc/libssl-1_1-x64.dll
vendored
Normal file
5
CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
project(FluentUI VERSION 0.1 LANGUAGES CXX)
|
||||||
|
|
||||||
|
add_subdirectory(src)
|
||||||
|
add_subdirectory(example)
|
@ -1,6 +0,0 @@
|
|||||||
TEMPLATE = subdirs
|
|
||||||
|
|
||||||
SUBDIRS += \
|
|
||||||
src/FluentUI.pro \
|
|
||||||
example
|
|
||||||
example.depends = src/FluentUI.pro
|
|
21
License
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2023 zhuzichu
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
22
README.md
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## 简介
|
## 简介
|
||||||
|
|
||||||
这是一个漂亮的Fluent组件库,使用QML插件开发的
|
这是一个漂亮的Fluent组件库,使用QML插件开发的。main分支是Qt6.4.3,如果需要qt5的请切换至qt5分支,<a href="https://github.com/zhuzichu520/FluentUI/wiki/%E6%96%B0%E6%89%8B%E5%85%A5%E9%97%A8" target="_blank">如何使用?</a>
|
||||||
|
|
||||||
## 编译状态
|
## 编译状态
|
||||||
| [Windows][win-link]| [Ubuntu][ubuntu-link]|[MacOS][macos-link]|
|
| [Windows][win-link]| [Ubuntu][ubuntu-link]|[MacOS][macos-link]|
|
||||||
@ -62,6 +62,12 @@
|
|||||||
|FluDatePicker|日期选择器||
|
|FluDatePicker|日期选择器||
|
||||||
|FluMenu|菜单Popup||
|
|FluMenu|菜单Popup||
|
||||||
|FluNavigationView|响应式导航布局||
|
|FluNavigationView|响应式导航布局||
|
||||||
|
|FluScrollbar|滚动条||
|
||||||
|
|FluToggleButton|开关按钮||
|
||||||
|
|FluPagination|分页组件||
|
||||||
|
|FluTableView|表格组件||
|
||||||
|
|FluMediaPlayer|播放器||
|
||||||
|
|FluFlipView|FlipView||
|
||||||
|
|
||||||
# 部分效果预览
|
# 部分效果预览
|
||||||
|
|
||||||
@ -77,6 +83,10 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## TableView表格组件
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## FluTreeView树组件
|
## FluTreeView树组件
|
||||||
|
|
||||||

|

|
||||||
@ -85,13 +95,5 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## InfoBar提示框组件
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 多窗口路由跳转
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### ⚡ Visitor count
|
### ⚡ Visitor count
|
||||||

|

|
||||||
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 383 KiB After Width: | Height: | Size: 204 KiB |
Before Width: | Height: | Size: 382 KiB |
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 218 KiB |
Before Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 103 KiB |
BIN
doc/preview/tableview.png
Normal file
After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 49 KiB |
@ -1,24 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
Window {
|
|
||||||
id:app
|
|
||||||
color: "#00000000"
|
|
||||||
Component.onCompleted: {
|
|
||||||
FluApp.init(app,properties)
|
|
||||||
FluTheme.frameless = ("windows" === Qt.platform.os)
|
|
||||||
FluTheme.dark = false
|
|
||||||
FluApp.routes = {
|
|
||||||
"/":"qrc:/page/MainPage.qml",
|
|
||||||
"/about":"qrc:/page/AboutPage.qml",
|
|
||||||
"/login":"qrc:/page/LoginPage.qml",
|
|
||||||
"/chat":"qrc:/page/ChatPage.qml",
|
|
||||||
}
|
|
||||||
FluApp.initialRoute = "/"
|
|
||||||
FluApp.run()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
87
example/CMakeLists.txt
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
project(example VERSION 0.1 LANGUAGES CXX)
|
||||||
|
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
#获取文件路径分隔符(解决执行命令的时候有些平台会报错)
|
||||||
|
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
|
||||||
|
|
||||||
|
#设置可执行文件输出目录
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/debug)
|
||||||
|
else()
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/release)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(Qt6 REQUIRED COMPONENTS Quick REQUIRED)
|
||||||
|
|
||||||
|
#遍历所有Cpp文件
|
||||||
|
file(GLOB_RECURSE CPP_FILES *.cpp *.h)
|
||||||
|
foreach(filepath ${CPP_FILES})
|
||||||
|
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
|
||||||
|
list(APPEND sources_files ${filename})
|
||||||
|
endforeach(filepath)
|
||||||
|
|
||||||
|
#遍历所有qml文件
|
||||||
|
file(GLOB_RECURSE QML_PATHS *.qml)
|
||||||
|
foreach(filepath ${QML_PATHS})
|
||||||
|
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
|
||||||
|
list(APPEND qml_files ${filename})
|
||||||
|
endforeach(filepath)
|
||||||
|
|
||||||
|
#遍历所有资源文件
|
||||||
|
file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp)
|
||||||
|
foreach(filepath ${RES_PATHS})
|
||||||
|
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
|
||||||
|
list(APPEND resource_files ${filename})
|
||||||
|
endforeach(filepath)
|
||||||
|
|
||||||
|
#添加可执行文件
|
||||||
|
qt_add_executable(example
|
||||||
|
${sources_files}
|
||||||
|
)
|
||||||
|
|
||||||
|
#复制动态库到可执行文件同级目录下
|
||||||
|
if(WIN32)
|
||||||
|
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
||||||
|
set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/msvc/*.dll)
|
||||||
|
else()
|
||||||
|
set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/mingw/*.dll)
|
||||||
|
endif()
|
||||||
|
string(REPLACE "/" ${PATH_SEPARATOR} DLLPATH "${DLLPATH}")
|
||||||
|
file(GLOB DLL_FILES ${DLLPATH})
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
|
${DLL_FILES}
|
||||||
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#添加qml模块
|
||||||
|
qt_add_qml_module(example
|
||||||
|
URI example
|
||||||
|
VERSION 1.0
|
||||||
|
QML_FILES ${qml_files} qml/global/qmldir
|
||||||
|
RESOURCES ${resource_files}
|
||||||
|
)
|
||||||
|
|
||||||
|
#设置属性
|
||||||
|
set_target_properties(example PROPERTIES
|
||||||
|
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
|
||||||
|
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
||||||
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||||
|
MACOSX_BUNDLE TRUE
|
||||||
|
WIN32_EXECUTABLE TRUE
|
||||||
|
)
|
||||||
|
|
||||||
|
#链接库
|
||||||
|
target_link_libraries(example
|
||||||
|
PRIVATE Qt6::Quick
|
||||||
|
)
|
||||||
|
|
||||||
|
#安装
|
||||||
|
install(TARGETS example
|
||||||
|
BUNDLE DESTINATION .
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
@ -1,29 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>NSAppTransportSecurity</key>
|
|
||||||
<dict>
|
|
||||||
<key>NSAllowsArbitraryLoads</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>example</string>
|
|
||||||
<key>CFBundleIconFile</key>
|
|
||||||
<string></string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>com.zhuzichu.example</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>APPL</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>LSMinimumSystemVersion</key>
|
|
||||||
<string>10.13</string>
|
|
||||||
<key>NOTE</key>
|
|
||||||
<string>This file was generated by Qt/QMake.</string>
|
|
||||||
<key>NSPrincipalClass</key>
|
|
||||||
<string>NSApplication</string>
|
|
||||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,23 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"CheckBox"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
FluCheckBox{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
}
|
|
||||||
|
|
||||||
FluCheckBox{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
text:"Text"
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"Dialog"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
FluContentDialog{
|
|
||||||
id:dialog
|
|
||||||
title:"友情提示"
|
|
||||||
message:"确定要退出程序么?"
|
|
||||||
negativeText:"取消"
|
|
||||||
onNegativeClicked:{
|
|
||||||
showSuccess("点击取消按钮")
|
|
||||||
}
|
|
||||||
positiveText:"确定"
|
|
||||||
onPositiveClicked:{
|
|
||||||
showSuccess("点击确定按钮")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluButton{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
text:"Show Dialog"
|
|
||||||
onClicked: {
|
|
||||||
dialog.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,65 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"Expander"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
FluExpander{
|
|
||||||
headerText:"打开一个单选框"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
Item{
|
|
||||||
anchors.fill: parent
|
|
||||||
ColumnLayout{
|
|
||||||
spacing: 8
|
|
||||||
anchors{
|
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
|
||||||
topMargin: 15
|
|
||||||
leftMargin: 15
|
|
||||||
}
|
|
||||||
Repeater{
|
|
||||||
id:repeater
|
|
||||||
property int selecIndex : 0
|
|
||||||
model: 3
|
|
||||||
delegate: FluRadioButton{
|
|
||||||
selected : repeater.selecIndex===index
|
|
||||||
text:"Radio Button_"+index
|
|
||||||
onClicked:{
|
|
||||||
repeater.selecIndex = index
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluExpander{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
headerText:"打开一个滑动文本框"
|
|
||||||
Item{
|
|
||||||
anchors.fill: parent
|
|
||||||
Flickable{
|
|
||||||
id:scrollview
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height
|
|
||||||
contentWidth: width
|
|
||||||
contentHeight: text_info.height
|
|
||||||
ScrollBar.vertical: FluScrollBar {}
|
|
||||||
FluText{
|
|
||||||
id:text_info
|
|
||||||
width: scrollview.width
|
|
||||||
wrapMode: Text.WrapAnywhere
|
|
||||||
padding: 14
|
|
||||||
text:"先帝创业未半而中道崩殂,今天下三分,益州疲弊,此诚危急存亡之秋也。然侍卫之臣不懈于内,忠志之士忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气,不宜妄自菲薄,引喻失义,以塞忠谏之路也。宫中府中,俱为一体;陟罚臧否,不宜异同。若有作奸犯科及为忠善者,宜付有司论其刑赏,以昭陛下平明之理,不宜偏私,使内外异法也。侍中、侍郎郭攸之、费祎、董允等,此皆良实,志虑忠纯,是以先帝简拔以遗陛下。愚以为宫中之事,事无大小,悉以咨之,然后施行,必能裨补阙漏,有所广益。将军向宠,性行淑均,晓畅军事,试用于昔日,先帝称之曰能,是以众议举宠为督。愚以为营中之事,悉以咨之,必能使行阵和睦,优劣得所。亲贤臣,远小人,此先汉所以兴隆也;亲小人,远贤臣,此后汉所以倾颓也。先帝在时,每与臣论此事,未尝不叹息痛恨于桓、灵也。侍中、尚书、长史、参军,此悉贞良死节之臣,愿陛下亲之信之,则汉室之隆,可计日而待也。臣本布衣,躬耕于南阳,苟全性命于乱世,不求闻达于诸侯。先帝不以臣卑鄙,猥自枉屈,三顾臣于草庐之中,咨臣以当世之事,由是感激,遂许先帝以驱驰。后值倾覆,受任于败军之际,奉命于危难之间,尔来二十有一年矣。先帝知臣谨慎,故临崩寄臣以大事也。受命以来,夙夜忧叹,恐托付不效,以伤先帝之明;故五月渡泸,深入不毛。今南方已定,兵甲已足,当奖率三军,北定中原,庶竭驽钝,攘除奸凶,兴复汉室,还于旧都。此臣所以报先帝而忠陛下之职分也。至于斟酌损益,进尽忠言,则攸之、祎、允之任也。愿陛下托臣以讨贼兴复之效,不效,则治臣之罪,以告先帝之灵。若无兴德之言,则责攸之、祎、允等之慢,以彰其咎;陛下亦宜自谋,以咨诹善道,察纳雅言,深追先帝遗诏。臣不胜受恩感激。今当远离,临表涕零,不知所言。"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"InfoBar"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
FluButton{
|
|
||||||
text:"Info"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
onClicked: {
|
|
||||||
showInfo("这是一个Info样式的InfoBar")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluButton{
|
|
||||||
text:"Warning"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
onClicked: {
|
|
||||||
showWarning("这是一个Warning样式的InfoBar")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluButton{
|
|
||||||
text:"Error"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
onClicked: {
|
|
||||||
showError("这是一个Error样式的InfoBar")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluButton{
|
|
||||||
text:"Success"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
onClicked: {
|
|
||||||
showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"Menu"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
FluButton{
|
|
||||||
text:"左击菜单"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
onClicked:{
|
|
||||||
menu.popup()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FluButton{
|
|
||||||
text:"右击菜单"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
onClicked: {
|
|
||||||
showSuccess("请按鼠标右击")
|
|
||||||
}
|
|
||||||
MouseArea{
|
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.RightButton
|
|
||||||
onClicked: {
|
|
||||||
menu.popup()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluMenu{
|
|
||||||
id:menu
|
|
||||||
FluMenuItem{
|
|
||||||
text:"删除"
|
|
||||||
onClicked: {
|
|
||||||
showError("删除")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluMenuItem{
|
|
||||||
text:"修改"
|
|
||||||
onClicked: {
|
|
||||||
showError("修改")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"MultiWindow"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
property string password: ""
|
|
||||||
|
|
||||||
property var loginPageRegister: registerForPageResult("/login")
|
|
||||||
|
|
||||||
Connections{
|
|
||||||
target: loginPageRegister
|
|
||||||
function onResult(data)
|
|
||||||
{
|
|
||||||
password = data.password
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluArea{
|
|
||||||
width: parent.width
|
|
||||||
height: 100
|
|
||||||
paddings: 10
|
|
||||||
Layout.topMargin: 20
|
|
||||||
|
|
||||||
Column{
|
|
||||||
spacing: 15
|
|
||||||
anchors{
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
left: parent.left
|
|
||||||
}
|
|
||||||
FluText{
|
|
||||||
text:"页面跳转,不携带任何参数"
|
|
||||||
}
|
|
||||||
FluButton{
|
|
||||||
text:"点击跳转"
|
|
||||||
onClicked: {
|
|
||||||
FluApp.navigate("/about")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluArea{
|
|
||||||
width: parent.width
|
|
||||||
height: 130
|
|
||||||
paddings: 10
|
|
||||||
Layout.topMargin: 20
|
|
||||||
|
|
||||||
Column{
|
|
||||||
spacing: 15
|
|
||||||
anchors{
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
left: parent.left
|
|
||||||
}
|
|
||||||
FluText{
|
|
||||||
text:"页面跳转,并携带参数用户名:zhuzichu"
|
|
||||||
}
|
|
||||||
FluButton{
|
|
||||||
text:"点击跳转到登录"
|
|
||||||
onClicked: {
|
|
||||||
loginPageRegister.launch({username:"zhuzichu"})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluText{
|
|
||||||
text:"登录窗口返回过来的密码->"+password
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"Progress"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
FluProgressBar{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
}
|
|
||||||
FluProgressRing{
|
|
||||||
Layout.topMargin: 10
|
|
||||||
}
|
|
||||||
FluProgressBar{
|
|
||||||
id:progress_bar
|
|
||||||
Layout.topMargin: 20
|
|
||||||
indeterminate: false
|
|
||||||
}
|
|
||||||
FluProgressRing{
|
|
||||||
id:progress_ring
|
|
||||||
Layout.topMargin: 10
|
|
||||||
indeterminate: false
|
|
||||||
}
|
|
||||||
FluSlider{
|
|
||||||
Layout.topMargin: 30
|
|
||||||
value:50
|
|
||||||
onValueChanged:{
|
|
||||||
progress_bar.progress = value/100
|
|
||||||
progress_ring.progress = value/100
|
|
||||||
}
|
|
||||||
Layout.bottomMargin: 30
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,117 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Window
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"Rectangle"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
RowLayout{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
color:"#0078d4"
|
|
||||||
radius:[0,0,0,0]
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
color:"#744da9"
|
|
||||||
radius:[15,15,15,15]
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
color:"#ffeb3b"
|
|
||||||
radius:[15,0,0,0]
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
color:"#f7630c"
|
|
||||||
radius:[0,15,0,0]
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
color:"#e71123"
|
|
||||||
radius:[0,0,15,0]
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
color:"#b4009e"
|
|
||||||
radius:[0,0,0,15]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluText{
|
|
||||||
text:"配合图片使用"
|
|
||||||
fontStyle: FluText.SubTitle
|
|
||||||
Layout.topMargin: 20
|
|
||||||
}
|
|
||||||
RowLayout{
|
|
||||||
spacing: 14
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
radius:[25,0,25,25]
|
|
||||||
Image {
|
|
||||||
asynchronous: true
|
|
||||||
anchors.fill: parent
|
|
||||||
source: "qrc:/res/svg/avatar_1.svg"
|
|
||||||
sourceSize: Qt.size(width,height)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
radius:[10,10,10,10]
|
|
||||||
Image {
|
|
||||||
asynchronous: true
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceSize: Qt.size(width,height)
|
|
||||||
source: "qrc:/res/svg/avatar_2.svg"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
radius:[25,25,25,25]
|
|
||||||
Image {
|
|
||||||
asynchronous: true
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceSize: Qt.size(width,height)
|
|
||||||
source: "qrc:/res/svg/avatar_3.svg"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
radius:[0,25,25,25]
|
|
||||||
Image {
|
|
||||||
asynchronous: true
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceSize: Qt.size(width,height)
|
|
||||||
source: "qrc:/res/svg/avatar_4.svg"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluRectangle{
|
|
||||||
width: 1080/5
|
|
||||||
height: 1439/5
|
|
||||||
radius:[25,25,25,25]
|
|
||||||
Image {
|
|
||||||
asynchronous: true
|
|
||||||
source: "qrc:/res/image/image_huoyin.webp"
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceSize: Qt.size(width,height)
|
|
||||||
}
|
|
||||||
Layout.topMargin: 10
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"Slider"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
FluSlider{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
value: 50
|
|
||||||
Layout.leftMargin: 10
|
|
||||||
}
|
|
||||||
FluSlider{
|
|
||||||
vertical:true
|
|
||||||
Layout.topMargin: 20
|
|
||||||
Layout.leftMargin: 10
|
|
||||||
Layout.bottomMargin: 20
|
|
||||||
value: 50
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"TextBox"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
FluTextBox{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
placeholderText: "单行输入框"
|
|
||||||
Layout.preferredWidth: 300
|
|
||||||
disabled:toggle_switch.selected
|
|
||||||
}
|
|
||||||
FluMultiLineTextBox{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
Layout.preferredWidth: 300
|
|
||||||
placeholderText: "多行输入框"
|
|
||||||
disabled:toggle_switch.selected
|
|
||||||
}
|
|
||||||
FluAutoSuggestBox{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
items:generateRandomNames(100)
|
|
||||||
placeholderText: "AutoSuggestBox"
|
|
||||||
Layout.preferredWidth: 300
|
|
||||||
disabled:toggle_switch.selected
|
|
||||||
}
|
|
||||||
|
|
||||||
FluToggleSwitch{
|
|
||||||
id:toggle_switch
|
|
||||||
text:"Disabled"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateRandomNames(numNames) {
|
|
||||||
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
||||||
const names = [];
|
|
||||||
function generateRandomName() {
|
|
||||||
const nameLength = Math.floor(Math.random() * 5) + 4;
|
|
||||||
let name = '';
|
|
||||||
for (let i = 0; i < nameLength; i++) {
|
|
||||||
const letterIndex = Math.floor(Math.random() * 26);
|
|
||||||
name += alphabet.charAt(letterIndex);
|
|
||||||
}
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
for (let i = 0; i < numNames; i++) {
|
|
||||||
const name = generateRandomName();
|
|
||||||
names.push({title:name});
|
|
||||||
}
|
|
||||||
return names;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"Theme"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
RowLayout{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
Repeater{
|
|
||||||
model: [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
|
|
||||||
delegate: FluRectangle{
|
|
||||||
width: 42
|
|
||||||
height: 42
|
|
||||||
radius: [4,4,4,4]
|
|
||||||
color: mouse_item.containsMouse ? Qt.lighter(modelData.normal,1.1) : modelData.normal
|
|
||||||
FluIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
iconSource: FluentIcons.AcceptMedium
|
|
||||||
iconSize: 15
|
|
||||||
visible: modelData === FluTheme.primaryColor
|
|
||||||
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
|
||||||
}
|
|
||||||
MouseArea{
|
|
||||||
id:mouse_item
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: {
|
|
||||||
FluTheme.primaryColor = modelData
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluText{
|
|
||||||
text:"夜间模式"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
}
|
|
||||||
FluToggleSwitch{
|
|
||||||
selected: FluTheme.dark
|
|
||||||
clickFunc:function(){
|
|
||||||
FluTheme.dark = !FluTheme.dark
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluText{
|
|
||||||
text:"native文本渲染"
|
|
||||||
Layout.topMargin: 20
|
|
||||||
}
|
|
||||||
FluToggleSwitch{
|
|
||||||
selected: FluTheme.nativeText
|
|
||||||
clickFunc:function(){
|
|
||||||
FluTheme.nativeText = !FluTheme.nativeText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluScrollablePage{
|
|
||||||
|
|
||||||
title:"ToggleSwitch"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
FluToggleSwitch{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
}
|
|
||||||
FluToggleSwitch{
|
|
||||||
Layout.topMargin: 20
|
|
||||||
text:"Text"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,144 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluContentPage {
|
|
||||||
|
|
||||||
title:"TreeView"
|
|
||||||
leftPadding:10
|
|
||||||
rightPadding:10
|
|
||||||
bottomPadding:20
|
|
||||||
|
|
||||||
function randomName() {
|
|
||||||
var names = ["张三", "李四", "王五", "赵六", "钱七", "孙八", "周九", "吴十"]
|
|
||||||
return names[Math.floor(Math.random() * names.length)]
|
|
||||||
}
|
|
||||||
|
|
||||||
function randomCompany() {
|
|
||||||
var companies = ["阿里巴巴", "腾讯", "百度", "京东", "华为", "小米", "字节跳动", "美团", "滴滴"]
|
|
||||||
return companies[Math.floor(Math.random() * companies.length)]
|
|
||||||
}
|
|
||||||
|
|
||||||
function randomDepartment() {
|
|
||||||
var departments = ["技术部", "销售部", "市场部", "人事部", "财务部", "客服部", "产品部", "设计部", "运营部"]
|
|
||||||
return departments[Math.floor(Math.random() * departments.length)]
|
|
||||||
}
|
|
||||||
|
|
||||||
function createEmployee() {
|
|
||||||
var name = randomName()
|
|
||||||
return tree_view.createItem(name, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
function createSubtree(numEmployees) {
|
|
||||||
var employees = []
|
|
||||||
for (var i = 0; i < numEmployees; i++) {
|
|
||||||
employees.push(createEmployee())
|
|
||||||
}
|
|
||||||
return tree_view.createItem(randomDepartment(), true, employees)
|
|
||||||
}
|
|
||||||
|
|
||||||
function createOrg(numLevels, numSubtrees, numEmployees) {
|
|
||||||
if (numLevels === 0) {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
var subtrees = []
|
|
||||||
for (var i = 0; i < numSubtrees; i++) {
|
|
||||||
subtrees.push(createSubtree(numEmployees))
|
|
||||||
}
|
|
||||||
return [tree_view.createItem(randomCompany(), true, subtrees)].concat(createOrg(numLevels - 1, numSubtrees, numEmployees))
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FluTreeView{
|
|
||||||
id:tree_view
|
|
||||||
width:240
|
|
||||||
anchors{
|
|
||||||
top:parent.top
|
|
||||||
left:parent.left
|
|
||||||
bottom:parent.bottom
|
|
||||||
}
|
|
||||||
onItemClicked:
|
|
||||||
(model)=>{
|
|
||||||
showSuccess(model.text)
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
var org = createOrg(3, 3, 3)
|
|
||||||
updateData(org)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ColumnLayout{
|
|
||||||
anchors{
|
|
||||||
left: tree_view.right
|
|
||||||
right: parent.right
|
|
||||||
top: parent.top
|
|
||||||
}
|
|
||||||
|
|
||||||
FluText{
|
|
||||||
text:{
|
|
||||||
if(tree_view.selectionMode === FluTreeView.None){
|
|
||||||
return "selectionMode->FluTreeView.None"
|
|
||||||
}
|
|
||||||
if(tree_view.selectionMode === FluTreeView.Single){
|
|
||||||
return "selectionMode->FluTreeView.Single"
|
|
||||||
}
|
|
||||||
if(tree_view.selectionMode === FluTreeView.Multiple){
|
|
||||||
return "selectionMode->FluTreeView.Multiple"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluButton{
|
|
||||||
text:"None"
|
|
||||||
onClicked: {
|
|
||||||
tree_view.selectionMode = FluTreeView.None
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluButton{
|
|
||||||
text:"Single"
|
|
||||||
onClicked: {
|
|
||||||
tree_view.selectionMode = FluTreeView.Single
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluButton{
|
|
||||||
text:"Multiple"
|
|
||||||
onClicked: {
|
|
||||||
tree_view.selectionMode = FluTreeView.Multiple
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluFilledButton{
|
|
||||||
text:"获取选中的数据"
|
|
||||||
onClicked: {
|
|
||||||
if(tree_view.selectionMode === FluTreeView.None){
|
|
||||||
showError("当前非选择模式,没有选中的数据")
|
|
||||||
}
|
|
||||||
if(tree_view.selectionMode === FluTreeView.Single){
|
|
||||||
if(!tree_view.signleData()){
|
|
||||||
showError("没有选中数据")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
showSuccess(tree_view.signleData().text)
|
|
||||||
}
|
|
||||||
if(tree_view.selectionMode === FluTreeView.Multiple){
|
|
||||||
if(tree_view.multipData().length===0){
|
|
||||||
showError("没有选中数据")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var info = []
|
|
||||||
tree_view.multipData().map((value)=>info.push(value.text))
|
|
||||||
showSuccess(info.join(","))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
QT += quick quickcontrols2 concurrent network multimedia
|
|
||||||
CONFIG += c++11
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS QT_NO_WARNING_OUTPUT
|
|
||||||
|
|
||||||
HEADERS += \
|
|
||||||
ChatController.h
|
|
||||||
|
|
||||||
SOURCES += \
|
|
||||||
ChatController.cpp \
|
|
||||||
main.cpp
|
|
||||||
|
|
||||||
RESOURCES += qml.qrc
|
|
||||||
|
|
||||||
RC_ICONS = favicon.ico
|
|
||||||
|
|
||||||
QML_IMPORT_PATH =
|
|
||||||
QML_DESIGNER_IMPORT_PATH =
|
|
||||||
|
|
||||||
CONFIG(debug,debug|release) {
|
|
||||||
DESTDIR = $$absolute_path($${_PRO_FILE_PWD_}/../bin/debug)
|
|
||||||
} else {
|
|
||||||
DESTDIR = $$absolute_path($${_PRO_FILE_PWD_}/../bin/release)
|
|
||||||
}
|
|
||||||
|
|
||||||
win32 {
|
|
||||||
contains(QT_ARCH, i386) {
|
|
||||||
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/Win_x86/*.dll) $$DESTDIR
|
|
||||||
contains(QMAKE_CC, cl) {
|
|
||||||
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, \\)
|
|
||||||
} else {
|
|
||||||
QMAKE_PRE_LINK += $$QMAKE_COPY $$COPYDLL
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/Win_x64/*.dll) $$DESTDIR
|
|
||||||
contains(QMAKE_CC, cl) {
|
|
||||||
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, \\)
|
|
||||||
} else {
|
|
||||||
QMAKE_PRE_LINK += $$QMAKE_COPY $$COPYDLL
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
|
||||||
!isEmpty(target.path): INSTALLS += target
|
|
||||||
|
|
||||||
mac: {
|
|
||||||
QMAKE_INFO_PLIST = Info.plist
|
|
||||||
}
|
|
Before Width: | Height: | Size: 116 KiB |
@ -1,21 +0,0 @@
|
|||||||
pragma Singleton
|
|
||||||
|
|
||||||
import QtQuick
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluObject{
|
|
||||||
id:footer_items
|
|
||||||
FluPaneItemSeparator{}
|
|
||||||
FluPaneItem{
|
|
||||||
title:"意见反馈"
|
|
||||||
onTap:{
|
|
||||||
Qt.openUrlExternally("https://github.com/zhuzichu520/FluentUI/issues/new")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluPaneItem{
|
|
||||||
title:"关于"
|
|
||||||
onTap:{
|
|
||||||
FluApp.navigate("/about")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,286 +0,0 @@
|
|||||||
pragma Singleton
|
|
||||||
|
|
||||||
import QtQuick
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
|
|
||||||
FluObject{
|
|
||||||
|
|
||||||
property var navigationView
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Home"
|
|
||||||
icon:FluentIcons.Home
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Home.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Inputs"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Buttons"
|
|
||||||
image:"qrc:/res/image/control/Button.png"
|
|
||||||
recentlyUpdated:true
|
|
||||||
desc:"A control that responds to user input and raisesa Click event."
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Buttons.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Slider"
|
|
||||||
image:"qrc:/res/image/control/Slider.png"
|
|
||||||
recentlyUpdated:true
|
|
||||||
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Slider.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"CheckBox"
|
|
||||||
image:"qrc:/res/image/control/Checkbox.png"
|
|
||||||
recentlyUpdated:true
|
|
||||||
desc:"A control that a user can select or clear."
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_CheckBox.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"ToggleSwitch"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_ToggleSwitch.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Form"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"TextBox"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_TextBox.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"TimePicker"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_TimePicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"DatePicker"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_DatePicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"CalendarPicker"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_CalendarPicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"ColorPicker"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_ColorPicker.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Surface"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"InfoBar"
|
|
||||||
image:"qrc:/res/image/control/InfoBar.png"
|
|
||||||
recentlyUpdated:true
|
|
||||||
desc:"An inline message to display app-wide statuschange information."
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_InfoBar.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Progress"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Progress.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Badge"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Badge.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Rectangle"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Rectangle.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Carousel"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Carousel.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Expander"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Expander.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Popus"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Dialog"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Dialog.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Tooltip"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Tooltip.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Menu"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Menu.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Navigation"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"TabView"
|
|
||||||
image:"qrc:/res/image/control/TabView.png"
|
|
||||||
recentlyAdded:true
|
|
||||||
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_TabView.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"TreeView"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_TreeView.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"MultiWindow"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_MultiWindow.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Theming"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Theme"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Theme.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Awesome"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Awesome.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FluPaneItem{
|
|
||||||
title:"Typography"
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_Typography.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItemHeader{
|
|
||||||
title:"Media"
|
|
||||||
}
|
|
||||||
|
|
||||||
FluPaneItem{
|
|
||||||
title:"MediaPlayer"
|
|
||||||
image:"qrc:/res/image/control/MediaPlayerElement.png"
|
|
||||||
recentlyAdded:true
|
|
||||||
desc:"A control to display video and image content."
|
|
||||||
onTap:{
|
|
||||||
navigationView.push("qrc:/T_MediaPlayer.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getRecentlyAddedData(){
|
|
||||||
var arr = []
|
|
||||||
for(var i=0;i<children.length;i++){
|
|
||||||
var item = children[i]
|
|
||||||
if(item instanceof FluPaneItem && item.recentlyAdded){
|
|
||||||
arr.push(item)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arr
|
|
||||||
}
|
|
||||||
|
|
||||||
function getRecentlyUpdatedData(){
|
|
||||||
var arr = []
|
|
||||||
for(var i=0;i<children.length;i++){
|
|
||||||
var item = children[i]
|
|
||||||
if(item instanceof FluPaneItem && item.recentlyUpdated){
|
|
||||||
arr.push(item)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arr
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSearchData(){
|
|
||||||
var arr = []
|
|
||||||
for(var i=0;i<children.length;i++){
|
|
||||||
var item = children[i]
|
|
||||||
if(item instanceof FluPaneItem){
|
|
||||||
arr.push({title:item.title,key:item.key})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arr
|
|
||||||
}
|
|
||||||
|
|
||||||
function startPageByItem(item){
|
|
||||||
for(var i=0;i<children.length;i++){
|
|
||||||
if(children[i].key === item.key){
|
|
||||||
if(navigationView.getCurrentIndex() === i){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
children[i].tap()
|
|
||||||
navigationView.setCurrentIndex(i)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
#include <QGuiApplication>
|
|
||||||
#include <QQmlApplicationEngine>
|
|
||||||
#include <QQmlContext>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QQuickWindow>
|
|
||||||
#include <QQuickStyle>
|
|
||||||
#include <QProcess>
|
|
||||||
#include "ChatController.h"
|
|
||||||
|
|
||||||
QMap<QString, QVariant> properties(){
|
|
||||||
QMap<QString, QVariant> map;
|
|
||||||
// map["installHelper"] = QVariant::fromValue(QVariant::fromValue(InstallHelper::getInstance()));
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
QCoreApplication::setOrganizationName("ZhuZiChu");
|
|
||||||
QCoreApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
|
||||||
QCoreApplication::setApplicationName("FluentUI");
|
|
||||||
// QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);
|
|
||||||
QQuickStyle::setStyle("Basic");
|
|
||||||
QGuiApplication app(argc, argv);
|
|
||||||
QQmlApplicationEngine engine;
|
|
||||||
|
|
||||||
qmlRegisterType<ChatController>("Controller",1,0,"ChatController");
|
|
||||||
|
|
||||||
QMapIterator<QString, QVariant> iterator(properties());
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
iterator.next();
|
|
||||||
QString key = iterator.key();
|
|
||||||
QVariant value = iterator.value();
|
|
||||||
engine.rootContext()->setContextProperty(key,value);
|
|
||||||
}
|
|
||||||
engine.rootContext()->setContextProperty("properties",properties());
|
|
||||||
const QUrl url(QStringLiteral("qrc:/App.qml"));
|
|
||||||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
|
||||||
&app, [url](QObject *obj, const QUrl &objUrl) {
|
|
||||||
if (!obj && url == objUrl)
|
|
||||||
QCoreApplication::exit(-1);
|
|
||||||
}, Qt::QueuedConnection);
|
|
||||||
engine.load(url);
|
|
||||||
return app.exec();
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import "qrc:///global/"
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
FluWindow {
|
|
||||||
id:rootwindow
|
|
||||||
width: 1000
|
|
||||||
height: 640
|
|
||||||
title: "FluentUI"
|
|
||||||
minimumWidth: 520
|
|
||||||
minimumHeight: 460
|
|
||||||
|
|
||||||
FluAppBar{
|
|
||||||
id:appbar
|
|
||||||
z:10
|
|
||||||
showDark: true
|
|
||||||
width:parent.width
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FluNavigationView{
|
|
||||||
id:nav_view
|
|
||||||
anchors.fill: parent
|
|
||||||
items: ItemsOriginal
|
|
||||||
footerItems:ItemsFooter
|
|
||||||
logo: "qrc:/res/image/favicon.ico"
|
|
||||||
z: 11
|
|
||||||
title:"FluentUI"
|
|
||||||
autoSuggestBox:FluAutoSuggestBox{
|
|
||||||
width: 280
|
|
||||||
anchors.centerIn: parent
|
|
||||||
iconSource: FluentIcons.Zoom
|
|
||||||
items: ItemsOriginal.getSearchData()
|
|
||||||
placeholderText: "查找"
|
|
||||||
onItemClicked:
|
|
||||||
(data)=>{
|
|
||||||
ItemsOriginal.startPageByItem(data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
ItemsOriginal.navigationView = nav_view
|
|
||||||
nav_view.setCurrentIndex(0)
|
|
||||||
nav_view.push("qrc:/T_Home.qml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
156
example/qml.qrc
@ -1,156 +0,0 @@
|
|||||||
<RCC>
|
|
||||||
<qresource prefix="/">
|
|
||||||
<file>App.qml</file>
|
|
||||||
<file>res/image/image_huoyin.webp</file>
|
|
||||||
<file>res/svg/avatar_1.svg</file>
|
|
||||||
<file>res/svg/avatar_2.svg</file>
|
|
||||||
<file>res/svg/avatar_3.svg</file>
|
|
||||||
<file>res/svg/avatar_4.svg</file>
|
|
||||||
<file>res/svg/avatar_5.svg</file>
|
|
||||||
<file>res/svg/avatar_6.svg</file>
|
|
||||||
<file>res/svg/avatar_7.svg</file>
|
|
||||||
<file>res/svg/avatar_8.svg</file>
|
|
||||||
<file>res/svg/avatar_9.svg</file>
|
|
||||||
<file>res/svg/avatar_10.svg</file>
|
|
||||||
<file>res/svg/avatar_11.svg</file>
|
|
||||||
<file>res/svg/avatar_12.svg</file>
|
|
||||||
<file>page/AboutPage.qml</file>
|
|
||||||
<file>page/MainPage.qml</file>
|
|
||||||
<file>page/LoginPage.qml</file>
|
|
||||||
<file>T_ToggleSwitch.qml</file>
|
|
||||||
<file>T_Typography.qml</file>
|
|
||||||
<file>T_Awesome.qml</file>
|
|
||||||
<file>T_Buttons.qml</file>
|
|
||||||
<file>T_Rectangle.qml</file>
|
|
||||||
<file>T_InfoBar.qml</file>
|
|
||||||
<file>T_Progress.qml</file>
|
|
||||||
<file>T_Slider.qml</file>
|
|
||||||
<file>T_TextBox.qml</file>
|
|
||||||
<file>T_Theme.qml</file>
|
|
||||||
<file>T_Dialog.qml</file>
|
|
||||||
<file>T_TreeView.qml</file>
|
|
||||||
<file>T_Expander.qml</file>
|
|
||||||
<file>T_TimePicker.qml</file>
|
|
||||||
<file>T_DatePicker.qml</file>
|
|
||||||
<file>T_MultiWindow.qml</file>
|
|
||||||
<file>T_Menu.qml</file>
|
|
||||||
<file>res/image/banner_1.jpg</file>
|
|
||||||
<file>res/image/banner_2.jpg</file>
|
|
||||||
<file>res/image/banner_3.jpg</file>
|
|
||||||
<file>res/image/logo_openai.png</file>
|
|
||||||
<file>page/ChatPage.qml</file>
|
|
||||||
<file>T_Tooltip.qml</file>
|
|
||||||
<file>T_Badge.qml</file>
|
|
||||||
<file>T_CalendarPicker.qml</file>
|
|
||||||
<file>T_ColorPicker.qml</file>
|
|
||||||
<file>T_Carousel.qml</file>
|
|
||||||
<file>T_MediaPlayer.qml</file>
|
|
||||||
<file>T_TabView.qml</file>
|
|
||||||
<file>res/image/favicon.ico</file>
|
|
||||||
<file>T_Home.qml</file>
|
|
||||||
<file>res/image/bg_home_header.png</file>
|
|
||||||
<file>res/image/ic_home_github.png</file>
|
|
||||||
<file>res/image/control/Acrylic.png</file>
|
|
||||||
<file>res/image/control/AnimatedIcon.png</file>
|
|
||||||
<file>res/image/control/AnimatedVisualPlayer.png</file>
|
|
||||||
<file>res/image/control/AnimationInterop.png</file>
|
|
||||||
<file>res/image/control/AppBarButton.png</file>
|
|
||||||
<file>res/image/control/AppBarSeparator.png</file>
|
|
||||||
<file>res/image/control/AppBarToggleButton.png</file>
|
|
||||||
<file>res/image/control/AutomationProperties.png</file>
|
|
||||||
<file>res/image/control/AutoSuggestBox.png</file>
|
|
||||||
<file>res/image/control/Border.png</file>
|
|
||||||
<file>res/image/control/BreadcrumbBar.png</file>
|
|
||||||
<file>res/image/control/Button.png</file>
|
|
||||||
<file>res/image/control/CalendarDatePicker.png</file>
|
|
||||||
<file>res/image/control/CalendarView.png</file>
|
|
||||||
<file>res/image/control/Canvas.png</file>
|
|
||||||
<file>res/image/control/Checkbox.png</file>
|
|
||||||
<file>res/image/control/Clipboard.png</file>
|
|
||||||
<file>res/image/control/ColorPaletteResources.png</file>
|
|
||||||
<file>res/image/control/ColorPicker.png</file>
|
|
||||||
<file>res/image/control/ComboBox.png</file>
|
|
||||||
<file>res/image/control/CommandBar.png</file>
|
|
||||||
<file>res/image/control/CommandBarFlyout.png</file>
|
|
||||||
<file>res/image/control/CompactSizing.png</file>
|
|
||||||
<file>res/image/control/ConnectedAnimation.png</file>
|
|
||||||
<file>res/image/control/ContentDialog.png</file>
|
|
||||||
<file>res/image/control/CreateMultipleWindows.png</file>
|
|
||||||
<file>res/image/control/DataGrid.png</file>
|
|
||||||
<file>res/image/control/DatePicker.png</file>
|
|
||||||
<file>res/image/control/DropDownButton.png</file>
|
|
||||||
<file>res/image/control/EasingFunction.png</file>
|
|
||||||
<file>res/image/control/Expander.png</file>
|
|
||||||
<file>res/image/control/FilePicker.png</file>
|
|
||||||
<file>res/image/control/FlipView.png</file>
|
|
||||||
<file>res/image/control/Flyout.png</file>
|
|
||||||
<file>res/image/control/Grid.png</file>
|
|
||||||
<file>res/image/control/GridView.png</file>
|
|
||||||
<file>res/image/control/HyperlinkButton.png</file>
|
|
||||||
<file>res/image/control/IconElement.png</file>
|
|
||||||
<file>res/image/control/Image.png</file>
|
|
||||||
<file>res/image/control/ImplicitTransition.png</file>
|
|
||||||
<file>res/image/control/InfoBadge.png</file>
|
|
||||||
<file>res/image/control/InfoBar.png</file>
|
|
||||||
<file>res/image/control/InkCanvas.png</file>
|
|
||||||
<file>res/image/control/InkToolbar.png</file>
|
|
||||||
<file>res/image/control/InputValidation.png</file>
|
|
||||||
<file>res/image/control/ItemsRepeater.png</file>
|
|
||||||
<file>res/image/control/Line.png</file>
|
|
||||||
<file>res/image/control/ListBox.png</file>
|
|
||||||
<file>res/image/control/ListView.png</file>
|
|
||||||
<file>res/image/control/MediaPlayerElement.png</file>
|
|
||||||
<file>res/image/control/MenuBar.png</file>
|
|
||||||
<file>res/image/control/MenuFlyout.png</file>
|
|
||||||
<file>res/image/control/NavigationView.png</file>
|
|
||||||
<file>res/image/control/NumberBox.png</file>
|
|
||||||
<file>res/image/control/PageTransition.png</file>
|
|
||||||
<file>res/image/control/ParallaxView.png</file>
|
|
||||||
<file>res/image/control/PasswordBox.png</file>
|
|
||||||
<file>res/image/control/PersonPicture.png</file>
|
|
||||||
<file>res/image/control/PipsPager.png</file>
|
|
||||||
<file>res/image/control/Pivot.png</file>
|
|
||||||
<file>res/image/control/ProgressBar.png</file>
|
|
||||||
<file>res/image/control/ProgressRing.png</file>
|
|
||||||
<file>res/image/control/PullToRefresh.png</file>
|
|
||||||
<file>res/image/control/RadialGradientBrush.png</file>
|
|
||||||
<file>res/image/control/RadioButton.png</file>
|
|
||||||
<file>res/image/control/RadioButtons.png</file>
|
|
||||||
<file>res/image/control/RatingControl.png</file>
|
|
||||||
<file>res/image/control/RelativePanel.png</file>
|
|
||||||
<file>res/image/control/RepeatButton.png</file>
|
|
||||||
<file>res/image/control/RevealFocus.png</file>
|
|
||||||
<file>res/image/control/RichEditBox.png</file>
|
|
||||||
<file>res/image/control/RichTextBlock.png</file>
|
|
||||||
<file>res/image/control/ScrollViewer.png</file>
|
|
||||||
<file>res/image/control/SemanticZoom.png</file>
|
|
||||||
<file>res/image/control/Shape.png</file>
|
|
||||||
<file>res/image/control/Slider.png</file>
|
|
||||||
<file>res/image/control/Sound.png</file>
|
|
||||||
<file>res/image/control/SplitButton.png</file>
|
|
||||||
<file>res/image/control/SplitView.png</file>
|
|
||||||
<file>res/image/control/StackPanel.png</file>
|
|
||||||
<file>res/image/control/StandardUICommand.png</file>
|
|
||||||
<file>res/image/control/SwipeControl.png</file>
|
|
||||||
<file>res/image/control/TabView.png</file>
|
|
||||||
<file>res/image/control/TeachingTip.png</file>
|
|
||||||
<file>res/image/control/TextBlock.png</file>
|
|
||||||
<file>res/image/control/TextBox.png</file>
|
|
||||||
<file>res/image/control/ThemeTransition.png</file>
|
|
||||||
<file>res/image/control/TimePicker.png</file>
|
|
||||||
<file>res/image/control/TitleBar.png</file>
|
|
||||||
<file>res/image/control/ToggleButton.png</file>
|
|
||||||
<file>res/image/control/ToggleSplitButton.png</file>
|
|
||||||
<file>res/image/control/ToggleSwitch.png</file>
|
|
||||||
<file>res/image/control/ToolTip.png</file>
|
|
||||||
<file>res/image/control/TreeView.png</file>
|
|
||||||
<file>res/image/control/VariableSizedWrapGrid.png</file>
|
|
||||||
<file>res/image/control/Viewbox.png</file>
|
|
||||||
<file>res/image/control/WebView.png</file>
|
|
||||||
<file>res/image/control/XamlUICommand.png</file>
|
|
||||||
<file>T_CheckBox.qml</file>
|
|
||||||
<file>global/ItemsOriginal.qml</file>
|
|
||||||
<file>global/qmldir</file>
|
|
||||||
<file>global/ItemsFooter.qml</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
26
example/qml/App.qml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
Window {
|
||||||
|
id:app
|
||||||
|
Component.onCompleted: {
|
||||||
|
FluApp.init(app)
|
||||||
|
FluTheme.frameless = ("windows" === Qt.platform.os)
|
||||||
|
FluTheme.darkMode = FluDarkMode.System
|
||||||
|
FluApp.routes = {
|
||||||
|
"/":"qrc:/example/qml/window/MainWindow.qml",
|
||||||
|
"/about":"qrc:/example/qml/window/AboutWindow.qml",
|
||||||
|
"/login":"qrc:/example/qml/window/LoginWindow.qml",
|
||||||
|
"/chat":"qrc:/example/qml/window/ChatWindow.qml",
|
||||||
|
"/media":"qrc:/example/qml/window/MediaWindow.qml",
|
||||||
|
"/singleTaskWindow":"qrc:/example/qml/window/SingleTaskWindow.qml",
|
||||||
|
"/standardWindow":"qrc:/example/qml/window/StandardWindow.qml",
|
||||||
|
"/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml"
|
||||||
|
}
|
||||||
|
FluApp.initialRoute = "/"
|
||||||
|
FluApp.run()
|
||||||
|
}
|
||||||
|
}
|
132
example/qml/component/CodeExpander.qml
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluExpander{
|
||||||
|
|
||||||
|
property string code: ""
|
||||||
|
|
||||||
|
headerText: "Source"
|
||||||
|
contentHeight:content.height
|
||||||
|
|
||||||
|
FluMultilineTextBox{
|
||||||
|
id:content
|
||||||
|
width:parent.width
|
||||||
|
readOnly:true
|
||||||
|
text:highlightQmlCode(code)
|
||||||
|
focus:false
|
||||||
|
textFormat: FluMultilineTextBox.RichText
|
||||||
|
KeyNavigation.priority: KeyNavigation.BeforeItem
|
||||||
|
background:Rectangle{
|
||||||
|
radius: 4
|
||||||
|
color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||||
|
border.color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
|
||||||
|
border.width: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluIconButton{
|
||||||
|
iconSource:FluentIcons.Copy
|
||||||
|
anchors{
|
||||||
|
right: parent.right
|
||||||
|
top: parent.top
|
||||||
|
rightMargin: 5
|
||||||
|
topMargin: 5
|
||||||
|
}
|
||||||
|
onClicked:{
|
||||||
|
FluApp.clipText(content.text)
|
||||||
|
showSuccess("复制成功")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function htmlEncode(e){
|
||||||
|
var i,s;
|
||||||
|
for(i in s={
|
||||||
|
"&":/&/g,//""//":/"/g,"'":/'/g,
|
||||||
|
"<":/</g,">":/>/g,"<br/>":/\n/g,
|
||||||
|
" ":/ /g," ":/\t/g
|
||||||
|
})e=e.replace(s[i],i);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
function highlightQmlCode(code) {
|
||||||
|
// 定义 QML 关键字列表
|
||||||
|
var qmlKeywords = [
|
||||||
|
"FluTextButton",
|
||||||
|
"FluAppBar",
|
||||||
|
"FluAutoSuggestBox",
|
||||||
|
"FluBadge",
|
||||||
|
"FluButton",
|
||||||
|
"FluCalendarPicker",
|
||||||
|
"FluCalendarView",
|
||||||
|
"FluCarousel",
|
||||||
|
"FluCheckBox",
|
||||||
|
"FluColorPicker",
|
||||||
|
"FluColorView",
|
||||||
|
"FluComboBox",
|
||||||
|
"FluContentDialog",
|
||||||
|
"FluContentPage",
|
||||||
|
"FluDatePicker",
|
||||||
|
"FluDivider",
|
||||||
|
"FluDropDownButton",
|
||||||
|
"FluExpander",
|
||||||
|
"FluFilledButton",
|
||||||
|
"FluFlipView",
|
||||||
|
"FluFocusRectangle",
|
||||||
|
"FluIcon",
|
||||||
|
"FluIconButton",
|
||||||
|
"FluInfoBar",
|
||||||
|
"FluItem",
|
||||||
|
"FluMediaPlayer",
|
||||||
|
"FluMenu",
|
||||||
|
"FluMenuItem",
|
||||||
|
"FluMultilineTextBox",
|
||||||
|
"FluNavigationView",
|
||||||
|
"FluObject",
|
||||||
|
"FluPaneItem",
|
||||||
|
"FluPaneItemExpander",
|
||||||
|
"FluPaneItemHeader",
|
||||||
|
"FluPaneItemSeparator",
|
||||||
|
"FluPivot",
|
||||||
|
"FluPivotItem",
|
||||||
|
"FluProgressBar",
|
||||||
|
"FluProgressRing",
|
||||||
|
"FluRadioButton",
|
||||||
|
"FluRectangle",
|
||||||
|
"FluScrollablePage",
|
||||||
|
"FluScrollBar",
|
||||||
|
"FluShadow",
|
||||||
|
"FluSlider",
|
||||||
|
"FluTabView",
|
||||||
|
"FluText",
|
||||||
|
"FluTextArea",
|
||||||
|
"FluTextBox",
|
||||||
|
"FluTextBoxBackground",
|
||||||
|
"FluTextBoxMenu",
|
||||||
|
"FluTextButton",
|
||||||
|
"FluTextFiled",
|
||||||
|
"FluTimePicker",
|
||||||
|
"FluToggleSwitch",
|
||||||
|
"FluTooltip",
|
||||||
|
"FluTreeView",
|
||||||
|
"FluWindow",
|
||||||
|
"FluWindowResize",
|
||||||
|
"FluToggleButton",
|
||||||
|
"FluTableView",
|
||||||
|
"FluColors",
|
||||||
|
"FluTheme",
|
||||||
|
"FluStatusView",
|
||||||
|
"FluRatingControl",
|
||||||
|
"FluPasswordBox",
|
||||||
|
"FluBreadcrumbBar"
|
||||||
|
];
|
||||||
|
code = code.replace(/\n/g, "<br>");
|
||||||
|
code = code.replace(/ /g, " ");
|
||||||
|
return code.replace(RegExp("\\b(" + qmlKeywords.join("|") + ")\\b", "g"), "<span style='color: #c23a80'>$1</span>");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
26
example/qml/global/ItemsFooter.qml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluObject{
|
||||||
|
id:footer_items
|
||||||
|
|
||||||
|
property var navigationView
|
||||||
|
|
||||||
|
FluPaneItemSeparator{}
|
||||||
|
FluPaneItem{
|
||||||
|
title:lang.about
|
||||||
|
icon:FluentIcons.Contact
|
||||||
|
tapFunc:function(){
|
||||||
|
FluApp.navigate("/about")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:lang.settings
|
||||||
|
icon:FluentIcons.Settings
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Settings.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
326
example/qml/global/ItemsOriginal.qml
Normal file
@ -0,0 +1,326 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluObject{
|
||||||
|
|
||||||
|
property var navigationView
|
||||||
|
|
||||||
|
FluPaneItem{
|
||||||
|
title:lang.home
|
||||||
|
// icon:FluentIcons.Home
|
||||||
|
cusIcon: Image{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
source: FluTheme.dark ? "qrc:/example/res/svg/home_dark.svg" : "qrc:/example/res/svg/home.svg"
|
||||||
|
sourceSize: Qt.size(30,30)
|
||||||
|
width: 18
|
||||||
|
height: 18
|
||||||
|
}
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Home.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:lang.basic_input
|
||||||
|
icon:FluentIcons.CheckboxComposite
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Buttons"
|
||||||
|
image:"qrc:/example/res/image/control/Button.png"
|
||||||
|
recentlyUpdated:true
|
||||||
|
desc:"A control that responds to user input and raisesa Click event."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Buttons.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Slider"
|
||||||
|
image:"qrc:/example/res/image/control/Slider.png"
|
||||||
|
recentlyUpdated:true
|
||||||
|
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Slider.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"CheckBox"
|
||||||
|
image:"qrc:/example/res/image/control/Checkbox.png"
|
||||||
|
recentlyUpdated:true
|
||||||
|
desc:"A control that a user can select or clear."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_CheckBox.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"ToggleSwitch"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_ToggleSwitch.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:lang.form
|
||||||
|
icon:FluentIcons.GridView
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TextBox"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_TextBox.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TimePicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_TimePicker.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"DatePicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_DatePicker.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"CalendarPicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_CalendarPicker.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"ColorPicker"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_ColorPicker.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:lang.surface
|
||||||
|
icon:FluentIcons.SurfaceHub
|
||||||
|
FluPaneItem{
|
||||||
|
title:"InfoBar"
|
||||||
|
image:"qrc:/example/res/image/control/InfoBar.png"
|
||||||
|
recentlyUpdated:true
|
||||||
|
desc:"An inline message to display app-wide statuschange information."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_InfoBar.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Progress"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Progress.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"RatingControl"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_RatingControl.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Badge"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Badge.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Rectangle"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Rectangle.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"StatusView"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_StatusView.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Carousel"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Carousel.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Expander"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Expander.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:lang.popus
|
||||||
|
icon:FluentIcons.ButtonMenu
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Dialog"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Dialog.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Tooltip"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Tooltip.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Menu"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Menu.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:lang.navigation
|
||||||
|
icon:FluentIcons.AllApps
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Pivot"
|
||||||
|
image:"qrc:/example/res/image/control/Pivot.png"
|
||||||
|
recentlyAdded:true
|
||||||
|
order:3
|
||||||
|
desc:"Presents information from different sources in atabbed view."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Pivot.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"BreadcrumbBar"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_BreadcrumbBar.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TabView"
|
||||||
|
image:"qrc:/example/res/image/control/TabView.png"
|
||||||
|
recentlyAdded:true
|
||||||
|
order:1
|
||||||
|
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_TabView.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TreeView"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_TreeView.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"TableView"
|
||||||
|
image:"qrc:/example/res/image/control/DataGrid.png"
|
||||||
|
recentlyAdded:true
|
||||||
|
order:4
|
||||||
|
desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_TableView.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"MultiWindow"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_MultiWindow.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"FlipView"
|
||||||
|
image:"qrc:/example/res/image/control/FlipView.png"
|
||||||
|
recentlyAdded:true
|
||||||
|
order:2
|
||||||
|
desc:"Presents a collection of items that the user canflip through, one item at a time."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_FlipView.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:lang.theming
|
||||||
|
icon:FluentIcons.Brightness
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Theme"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Theme.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Typography"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Typography.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPaneItem{
|
||||||
|
title:"Awesome"
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_Awesome.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluPaneItemExpander{
|
||||||
|
title:lang.media
|
||||||
|
icon:FluentIcons.Media
|
||||||
|
FluPaneItem{
|
||||||
|
title:"MediaPlayer"
|
||||||
|
image:"qrc:/example/res/image/control/MediaPlayerElement.png"
|
||||||
|
recentlyAdded:true
|
||||||
|
order:0
|
||||||
|
desc:"A control to display video and image content."
|
||||||
|
onTap:{
|
||||||
|
navigationView.push("qrc:/example/qml/page/T_MediaPlayer.qml")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRecentlyAddedData(){
|
||||||
|
var arr = []
|
||||||
|
for(var i=0;i<children.length;i++){
|
||||||
|
var item = children[i]
|
||||||
|
if(item instanceof FluPaneItem && item.recentlyAdded){
|
||||||
|
arr.push(item)
|
||||||
|
}
|
||||||
|
if(item instanceof FluPaneItemExpander){
|
||||||
|
for(var j=0;j<item.children.length;j++){
|
||||||
|
var itemChild = item.children[j]
|
||||||
|
if(itemChild instanceof FluPaneItem && itemChild.recentlyAdded){
|
||||||
|
arr.push(itemChild)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
arr.sort(function(o1,o2){ return o2.order-o1.order })
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRecentlyUpdatedData(){
|
||||||
|
var arr = []
|
||||||
|
var items = navigationView.getItems();
|
||||||
|
for(var i=0;i<items.length;i++){
|
||||||
|
var item = items[i]
|
||||||
|
if(item instanceof FluPaneItem && item.recentlyUpdated){
|
||||||
|
arr.push(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSearchData(){
|
||||||
|
var arr = []
|
||||||
|
var items = navigationView.getItems();
|
||||||
|
for(var i=0;i<items.length;i++){
|
||||||
|
var item = items[i]
|
||||||
|
if(item instanceof FluPaneItem){
|
||||||
|
arr.push({title:item.title,key:item.key})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
|
||||||
|
function startPageByItem(data){
|
||||||
|
navigationView.startPageByItem(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
9
example/qml/global/MainEvent.qml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
property int displayMode : FluNavigationView.Auto
|
||||||
|
}
|
@ -1,2 +1,3 @@
|
|||||||
singleton ItemsOriginal 1.0 ItemsOriginal.qml
|
singleton ItemsOriginal 1.0 ItemsOriginal.qml
|
||||||
singleton ItemsFooter 1.0 ItemsFooter.qml
|
singleton ItemsFooter 1.0 ItemsFooter.qml
|
||||||
|
singleton MainEvent 1.0 MainEvent.qml
|
@ -67,7 +67,6 @@ FluContentPage {
|
|||||||
width:parent.width
|
width:parent.width
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
text: modelData.name
|
text: modelData.name
|
||||||
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -11,9 +12,10 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 106
|
height: 106
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -99,5 +101,20 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'Rectangle{
|
||||||
|
width: 40
|
||||||
|
height: 40
|
||||||
|
radius: 8
|
||||||
|
color: Qt.rgba(191/255,191/255,191/255,1)
|
||||||
|
FluBadge{
|
||||||
|
count: 100
|
||||||
|
isDot: false
|
||||||
|
color: Qt.rgba(82/255,196/255,26/255,1)
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
98
example/qml/page/T_BreadcrumbBar.qml
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"BreadcurmbBar"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
var items = []
|
||||||
|
for(var i=0;i<10;i++){
|
||||||
|
items.push({title:"Item_"+(i+1)})
|
||||||
|
}
|
||||||
|
breadcrumb_1.items = items
|
||||||
|
breadcrumb_2.items = items
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
FluBreadcrumbBar{
|
||||||
|
id:breadcrumb_1
|
||||||
|
width:parent.width
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onClickItem:
|
||||||
|
(model)=>{
|
||||||
|
showSuccess(model.title)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 100
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width:parent.width
|
||||||
|
spacing: 10
|
||||||
|
|
||||||
|
FluFilledButton{
|
||||||
|
text:"Reset sample"
|
||||||
|
onClicked:{
|
||||||
|
var items = []
|
||||||
|
for(var i=0;i<10;i++){
|
||||||
|
items.push({title:"Item_"+(i+1)})
|
||||||
|
}
|
||||||
|
breadcrumb_2.items = items
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluBreadcrumbBar{
|
||||||
|
id:breadcrumb_2
|
||||||
|
separator:">"
|
||||||
|
spacing:8
|
||||||
|
textSize:18
|
||||||
|
Layout.fillWidth: true
|
||||||
|
onClickItem:
|
||||||
|
(model)=>{
|
||||||
|
//不是点击最后一个item元素
|
||||||
|
if(model.index+1!==count()){
|
||||||
|
breadcrumb_2.remove(model.index+1,count()-model.index-1)
|
||||||
|
}
|
||||||
|
showSuccess(model.title)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluBreadcrumbBar{
|
||||||
|
width:parent.width
|
||||||
|
separator:">"
|
||||||
|
spacing:8
|
||||||
|
textSize:18
|
||||||
|
onClickItem: (model)=>{
|
||||||
|
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -2,16 +2,17 @@
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Controls.Basic
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
title:"Buttons"
|
title:"Buttons"
|
||||||
|
|
||||||
spacing: 20
|
|
||||||
|
|
||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
@ -19,9 +20,10 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
FluTextButton{
|
FluTextButton{
|
||||||
disabled:text_button_switch.selected
|
disabled:text_button_switch.selected
|
||||||
@ -48,11 +50,22 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluTextButton{
|
||||||
|
text:"Text Button"
|
||||||
|
onClicked: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
FluButton{
|
FluButton{
|
||||||
disabled:button_switch.selected
|
disabled:button_switch.selected
|
||||||
@ -79,10 +92,21 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluButton{
|
||||||
|
text:"Standard Button"
|
||||||
|
onClicked: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
|
Layout.topMargin: 20
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
FluFilledButton{
|
FluFilledButton{
|
||||||
@ -110,13 +134,65 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluFilledButton{
|
||||||
|
text:"Filled Button"
|
||||||
|
onClicked: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
Layout.topMargin: 20
|
||||||
|
paddings: 10
|
||||||
|
|
||||||
|
FluToggleButton{
|
||||||
|
disabled:toggle_button_switch.selected
|
||||||
|
text:"Toggle Button"
|
||||||
|
onClicked: {
|
||||||
|
selected = !selected
|
||||||
|
}
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row{
|
||||||
|
spacing: 5
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:toggle_button_switch
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
text:"Disabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluToggleButton{
|
||||||
|
text:"Toggle Button"
|
||||||
|
onClicked: {
|
||||||
|
selected = !selected
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
iconSource:FluentIcons.ChromeCloseContrast
|
iconSource:FluentIcons.ChromeCloseContrast
|
||||||
disabled:icon_button_switch.selected
|
disabled:icon_button_switch.selected
|
||||||
@ -143,12 +219,22 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluIconButton{
|
||||||
|
iconSource:FluentIcons.ChromeCloseContrast
|
||||||
|
onClicked: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
FluDropDownButton{
|
FluDropDownButton{
|
||||||
disabled:drop_down_button_switch.selected
|
disabled:drop_down_button_switch.selected
|
||||||
text:"DropDownButton"
|
text:"DropDownButton"
|
||||||
@ -184,12 +270,33 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluDropDownButton{
|
||||||
|
text:"DropDownButton"
|
||||||
|
items:[
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Menu_1"
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Menu_2"
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Menu_3"
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Menu_4"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 100
|
height: 100
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
spacing: 8
|
spacing: 8
|
||||||
anchors{
|
anchors{
|
||||||
@ -225,13 +332,24 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluRadioButton{
|
||||||
|
selected:true
|
||||||
|
text:"Text Button"
|
||||||
|
onClicked: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
FluCheckBox{
|
FluCheckBox{
|
||||||
disabled:check_box_switch.selected
|
disabled:check_box_switch.selected
|
||||||
text:"Check Box"
|
text:"Check Box"
|
||||||
@ -240,8 +358,6 @@ FluScrollablePage{
|
|||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Row{
|
Row{
|
||||||
spacing: 5
|
spacing: 5
|
||||||
anchors{
|
anchors{
|
||||||
@ -255,6 +371,11 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluCheckBox{
|
||||||
|
text:"Check Box"
|
||||||
|
}'
|
||||||
|
}
|
||||||
}
|
}
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,18 +11,26 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 350
|
height: 350
|
||||||
paddings: 10
|
paddings: 10
|
||||||
FluCalendarView{
|
FluCalendarView{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluCalendarView{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -34,5 +43,12 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluCalendarPicker{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
|||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,9 +11,10 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 370
|
height: 370
|
||||||
paddings: 10
|
paddings: 10
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
@ -30,9 +32,20 @@ FluScrollablePage{
|
|||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
Layout.leftMargin: 5
|
Layout.leftMargin: 5
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
carousel.setData([{url:"qrc:/res/image/banner_1.jpg"},{url:"qrc:/res/image/banner_2.jpg"},{url:"qrc:/res/image/banner_3.jpg"}])
|
carousel.setData([{url:"qrc:/example/res/image/banner_1.jpg"},{url:"qrc:/example/res/image/banner_2.jpg"},{url:"qrc:/example/res/image/banner_3.jpg"}])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluCarousel{
|
||||||
|
width: 400
|
||||||
|
height: 300
|
||||||
|
Component.onCompleted: {
|
||||||
|
setData([{url:"qrc:/example/res/image/banner_1.jpg"},{url:"qrc:/example/res/image/banner_2.jpg"},{url:"qrc:/example/res/image/banner_3.jpg"}])
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
}
|
}
|
39
example/qml/page/T_CheckBox.qml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"CheckBox"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
Row{
|
||||||
|
spacing: 30
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
FluCheckBox{
|
||||||
|
}
|
||||||
|
FluCheckBox{
|
||||||
|
text:"Text"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluCheckBox{
|
||||||
|
text:"Text"
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,9 +11,10 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 280
|
height: 280
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -37,9 +39,16 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluColorView{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 60
|
height: 60
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -54,6 +63,13 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluColorPicker{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,44 +11,43 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
|
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text:"showYear=true"
|
text:"showYear=true"
|
||||||
}
|
}
|
||||||
|
|
||||||
FluDatePicker{
|
FluDatePicker{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluDatePicker{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
|
|
||||||
anchors{
|
anchors{
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
left: parent.left
|
left: parent.left
|
||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text:"showYear=false"
|
text:"showYear=false"
|
||||||
}
|
}
|
||||||
@ -56,8 +56,14 @@ FluScrollablePage{
|
|||||||
showYear:false
|
showYear:false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluDatePicker{
|
||||||
|
showYear:false
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
122
example/qml/page/T_Dialog.qml
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"Dialog"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
FluButton{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
Layout.topMargin: 20
|
||||||
|
text:"Show Double Button Dialog"
|
||||||
|
onClicked: {
|
||||||
|
double_btn_dialog.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluContentDialog{
|
||||||
|
id:dialog
|
||||||
|
title:"友情提示"
|
||||||
|
message:"确定要退出程序么?"
|
||||||
|
negativeText:"取消"
|
||||||
|
buttonFlags: FluContentDialog.NegativeButton | FluContentDialog.PositiveButton
|
||||||
|
onNegativeClicked:{
|
||||||
|
showSuccess("点击取消按钮")
|
||||||
|
}
|
||||||
|
positiveText:"确定"
|
||||||
|
onPositiveClicked:{
|
||||||
|
showSuccess("点击确定按钮")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog.open()'
|
||||||
|
}
|
||||||
|
|
||||||
|
FluContentDialog{
|
||||||
|
id:double_btn_dialog
|
||||||
|
title:"友情提示"
|
||||||
|
message:"确定要退出程序么?"
|
||||||
|
buttonFlags: FluContentDialog.NegativeButton | FluContentDialog.PositiveButton
|
||||||
|
negativeText:"取消"
|
||||||
|
onNegativeClicked:{
|
||||||
|
showSuccess("点击取消按钮")
|
||||||
|
}
|
||||||
|
positiveText:"确定"
|
||||||
|
onPositiveClicked:{
|
||||||
|
showSuccess("点击确定按钮")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
FluButton{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
Layout.topMargin: 20
|
||||||
|
text:"Show Triple Button Dialog"
|
||||||
|
onClicked: {
|
||||||
|
triple_btn_dialog.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluContentDialog{
|
||||||
|
id:dialog
|
||||||
|
title:"友情提示"
|
||||||
|
message:"确定要退出程序么?"
|
||||||
|
negativeText:"取消"
|
||||||
|
buttonFlags: FluContentDialog.NeutralButton | FluContentDialog.NegativeButton | FluContentDialog.PositiveButton
|
||||||
|
negativeText:"取消"
|
||||||
|
onNegativeClicked:{
|
||||||
|
showSuccess("点击取消按钮")
|
||||||
|
}
|
||||||
|
positiveText:"确定"
|
||||||
|
onPositiveClicked:{
|
||||||
|
showSuccess("点击确定按钮")
|
||||||
|
}
|
||||||
|
neutralText:"最小化"
|
||||||
|
onNeutralClicked:{
|
||||||
|
showSuccess("点击最小化按钮")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog.open()'
|
||||||
|
}
|
||||||
|
|
||||||
|
FluContentDialog{
|
||||||
|
id:triple_btn_dialog
|
||||||
|
title:"友情提示"
|
||||||
|
message:"确定要退出程序么?"
|
||||||
|
buttonFlags: FluContentDialog.NeutralButton | FluContentDialog.NegativeButton | FluContentDialog.PositiveButton
|
||||||
|
negativeText:"取消"
|
||||||
|
onNegativeClicked:{
|
||||||
|
showSuccess("点击取消按钮")
|
||||||
|
}
|
||||||
|
positiveText:"确定"
|
||||||
|
onPositiveClicked:{
|
||||||
|
showSuccess("点击确定按钮")
|
||||||
|
}
|
||||||
|
neutralText:"最小化"
|
||||||
|
onNeutralClicked:{
|
||||||
|
showSuccess("点击最小化按钮")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
109
example/qml/page/T_Expander.qml
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"Expander"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: layout_column.height+20
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
Column{
|
||||||
|
id:layout_column
|
||||||
|
spacing: 15
|
||||||
|
anchors{
|
||||||
|
top:parent.top
|
||||||
|
left:parent.left
|
||||||
|
}
|
||||||
|
|
||||||
|
FluExpander{
|
||||||
|
headerText:"打开一个单选框"
|
||||||
|
Layout.topMargin: 20
|
||||||
|
Item{
|
||||||
|
anchors.fill: parent
|
||||||
|
ColumnLayout{
|
||||||
|
spacing: 8
|
||||||
|
anchors{
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
topMargin: 15
|
||||||
|
leftMargin: 15
|
||||||
|
}
|
||||||
|
Repeater{
|
||||||
|
id:repeater
|
||||||
|
property int selecIndex : 0
|
||||||
|
model: 3
|
||||||
|
delegate: FluRadioButton{
|
||||||
|
selected : repeater.selecIndex===index
|
||||||
|
text:"Radio Button_"+index
|
||||||
|
onClicked:{
|
||||||
|
repeater.selecIndex = index
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluExpander{
|
||||||
|
Layout.topMargin: 20
|
||||||
|
headerText:"打开一个滑动文本框"
|
||||||
|
Item{
|
||||||
|
anchors.fill: parent
|
||||||
|
Flickable{
|
||||||
|
id:scrollview
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
contentWidth: width
|
||||||
|
contentHeight: text_info.height
|
||||||
|
ScrollBar.vertical: FluScrollBar {}
|
||||||
|
FluText{
|
||||||
|
id:text_info
|
||||||
|
width: scrollview.width
|
||||||
|
wrapMode: Text.WrapAnywhere
|
||||||
|
padding: 14
|
||||||
|
text:"先帝创业未半而中道崩殂,今天下三分,益州疲弊,此诚危急存亡之秋也。然侍卫之臣不懈于内,忠志之士忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气,不宜妄自菲薄,引喻失义,以塞忠谏之路也。宫中府中,俱为一体;陟罚臧否,不宜异同。若有作奸犯科及为忠善者,宜付有司论其刑赏,以昭陛下平明之理,不宜偏私,使内外异法也。侍中、侍郎郭攸之、费祎、董允等,此皆良实,志虑忠纯,是以先帝简拔以遗陛下。愚以为宫中之事,事无大小,悉以咨之,然后施行,必能裨补阙漏,有所广益。将军向宠,性行淑均,晓畅军事,试用于昔日,先帝称之曰能,是以众议举宠为督。愚以为营中之事,悉以咨之,必能使行阵和睦,优劣得所。亲贤臣,远小人,此先汉所以兴隆也;亲小人,远贤臣,此后汉所以倾颓也。先帝在时,每与臣论此事,未尝不叹息痛恨于桓、灵也。侍中、尚书、长史、参军,此悉贞良死节之臣,愿陛下亲之信之,则汉室之隆,可计日而待也。臣本布衣,躬耕于南阳,苟全性命于乱世,不求闻达于诸侯。先帝不以臣卑鄙,猥自枉屈,三顾臣于草庐之中,咨臣以当世之事,由是感激,遂许先帝以驱驰。后值倾覆,受任于败军之际,奉命于危难之间,尔来二十有一年矣。先帝知臣谨慎,故临崩寄臣以大事也。受命以来,夙夜忧叹,恐托付不效,以伤先帝之明;故五月渡泸,深入不毛。今南方已定,兵甲已足,当奖率三军,北定中原,庶竭驽钝,攘除奸凶,兴复汉室,还于旧都。此臣所以报先帝而忠陛下之职分也。至于斟酌损益,进尽忠言,则攸之、祎、允之任也。愿陛下托臣以讨贼兴复之效,不效,则治臣之罪,以告先帝之灵。若无兴德之言,则责攸之、祎、允等之慢,以彰其咎;陛下亦宜自谋,以咨诹善道,察纳雅言,深追先帝遗诏。臣不胜受恩感激。今当远离,临表涕零,不知所言。"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluExpander{
|
||||||
|
headerText:"打开一个单选框"
|
||||||
|
Item{
|
||||||
|
anchors.fill: parent
|
||||||
|
Flickable{
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
contentWidth: width
|
||||||
|
contentHeight: text_info.height
|
||||||
|
ScrollBar.vertical: FluScrollBar {}
|
||||||
|
FluText{
|
||||||
|
id:text_info
|
||||||
|
width: scrollview.width
|
||||||
|
wrapMode: Text.WrapAnywhere
|
||||||
|
padding: 14
|
||||||
|
text:"先帝创业未半而中道崩殂,今天下三分......""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
122
example/qml/page/T_FlipView.qml
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"FlipView"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 340
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
FluText{
|
||||||
|
text:"水平方向的FlipView"
|
||||||
|
}
|
||||||
|
FluFlipView{
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_2.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_3.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluFlipView{
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 340
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
ColumnLayout{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
FluText{
|
||||||
|
text:"垂直方向的FlipView"
|
||||||
|
}
|
||||||
|
FluFlipView{
|
||||||
|
vertical:true
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
sourceSize: Qt.size(400,300)
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_2.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_3.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluFlipView{
|
||||||
|
vertical:true
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
source: "qrc:/example/res/image/banner_1.jpg"
|
||||||
|
asynchronous: true
|
||||||
|
fillMode:Image.PreserveAspectCrop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
}
|
@ -2,7 +2,7 @@
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import "qrc:///global/"
|
import "qrc:///example/qml/global/"
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
@ -15,7 +15,7 @@ FluScrollablePage{
|
|||||||
ListModel{
|
ListModel{
|
||||||
id:model_header
|
id:model_header
|
||||||
ListElement{
|
ListElement{
|
||||||
icon:"qrc:/res/image/ic_home_github.png"
|
icon:"qrc:/example/res/image/ic_home_github.png"
|
||||||
title:"FluentUI GitHub"
|
title:"FluentUI GitHub"
|
||||||
desc:"The latest FluentUI controls and styles for your applications."
|
desc:"The latest FluentUI controls and styles for your applications."
|
||||||
url:"https://github.com/zhuzichu520/FluentUI"
|
url:"https://github.com/zhuzichu520/FluentUI"
|
||||||
@ -30,7 +30,7 @@ FluScrollablePage{
|
|||||||
fillMode:Image.PreserveAspectCrop
|
fillMode:Image.PreserveAspectCrop
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
verticalAlignment: Qt.AlignTop
|
verticalAlignment: Qt.AlignTop
|
||||||
source: "qrc:/res/image/bg_home_header.png"
|
source: "qrc:/example/res/image/bg_home_header.png"
|
||||||
}
|
}
|
||||||
Rectangle{
|
Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -129,7 +129,7 @@ FluScrollablePage{
|
|||||||
id:item_mouse
|
id:item_mouse
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onWheel: {
|
onWheel: (wheel)=>{
|
||||||
if (wheel.angleDelta.y > 0) scrollbar_header.decrease()
|
if (wheel.angleDelta.y > 0) scrollbar_header.decrease()
|
||||||
else scrollbar_header.increase()
|
else scrollbar_header.increase()
|
||||||
}
|
}
|
||||||
@ -142,20 +142,6 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel{
|
|
||||||
id:model_added
|
|
||||||
Component.onCompleted: {
|
|
||||||
append(ItemsOriginal.getRecentlyAddedData())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel{
|
|
||||||
id:model_update
|
|
||||||
Component.onCompleted: {
|
|
||||||
append(ItemsOriginal.getRecentlyUpdatedData())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id:com_item
|
id:com_item
|
||||||
Item{
|
Item{
|
||||||
@ -187,7 +173,7 @@ FluScrollablePage{
|
|||||||
id:item_icon
|
id:item_icon
|
||||||
height: 40
|
height: 40
|
||||||
width: 40
|
width: 40
|
||||||
source: model.image
|
source: modelData.image
|
||||||
anchors{
|
anchors{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: 20
|
leftMargin: 20
|
||||||
@ -197,7 +183,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:item_title
|
id:item_title
|
||||||
text:model.title
|
text:modelData.title
|
||||||
fontStyle: FluText.BodyStrong
|
fontStyle: FluText.BodyStrong
|
||||||
anchors{
|
anchors{
|
||||||
left: item_icon.right
|
left: item_icon.right
|
||||||
@ -208,7 +194,7 @@ FluScrollablePage{
|
|||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:item_desc
|
id:item_desc
|
||||||
text:model.desc
|
text:modelData.desc
|
||||||
color:FluColors.Grey120
|
color:FluColors.Grey120
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
@ -241,7 +227,7 @@ FluScrollablePage{
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ItemsOriginal.startPageByItem(model)
|
ItemsOriginal.startPageByItem(modelData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,7 +246,7 @@ FluScrollablePage{
|
|||||||
implicitHeight: contentHeight
|
implicitHeight: contentHeight
|
||||||
cellHeight: 120
|
cellHeight: 120
|
||||||
cellWidth: 320
|
cellWidth: 320
|
||||||
model:model_added
|
model:ItemsOriginal.getRecentlyAddedData()
|
||||||
interactive: false
|
interactive: false
|
||||||
delegate: com_item
|
delegate: com_item
|
||||||
}
|
}
|
||||||
@ -278,7 +264,7 @@ FluScrollablePage{
|
|||||||
cellHeight: 120
|
cellHeight: 120
|
||||||
cellWidth: 320
|
cellWidth: 320
|
||||||
interactive: false
|
interactive: false
|
||||||
model: model_update
|
model: ItemsOriginal.getRecentlyUpdatedData()
|
||||||
delegate: com_item
|
delegate: com_item
|
||||||
}
|
}
|
||||||
|
|
64
example/qml/page/T_InfoBar.qml
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"InfoBar"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 200
|
||||||
|
paddings: 10
|
||||||
|
ColumnLayout{
|
||||||
|
spacing: 14
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"Info"
|
||||||
|
onClicked: {
|
||||||
|
showInfo("这是一个Info样式的InfoBar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"Warning"
|
||||||
|
onClicked: {
|
||||||
|
showWarning("这是一个Warning样式的InfoBar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"Error"
|
||||||
|
onClicked: {
|
||||||
|
showError("这是一个Error样式的InfoBar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"Success"
|
||||||
|
onClicked: {
|
||||||
|
showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'showInfo("这是一个Info样式的InfoBar")
|
||||||
|
|
||||||
|
showWarning("这是一个Warning样式的InfoBar")
|
||||||
|
|
||||||
|
showError("这是一个Error样式的InfoBar")
|
||||||
|
|
||||||
|
showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")'
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if(visible){
|
if(visible){
|
||||||
@ -18,9 +20,8 @@ FluScrollablePage{
|
|||||||
player.pause()
|
player.pause()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
height: 320
|
height: 320
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -31,11 +32,35 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
FluMediaPlayer{
|
FluMediaPlayer{
|
||||||
id:player
|
id:player
|
||||||
// source:"http://mirror.aarnet.edu.au/pub/TED-talks/911Mothers_2010W-480p.mp4"
|
|
||||||
source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
|
source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
|
||||||
// source:"http://video.chinanews.com/flv/2019/04/23/400/111773_web.mp4"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluMediaPlayer{
|
||||||
|
id:player
|
||||||
|
source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
Layout.topMargin: 20
|
||||||
|
paddings: 10
|
||||||
|
FluButton{
|
||||||
|
text:"跳转到视频播放器窗口"
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onClicked:{
|
||||||
|
FluApp.navigate("/media",{source:"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
92
example/qml/page/T_Menu.qml
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"Menu"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 100
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
Column{
|
||||||
|
id:layout_column
|
||||||
|
spacing: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left:parent.left
|
||||||
|
}
|
||||||
|
|
||||||
|
FluButton{
|
||||||
|
text:"左击菜单"
|
||||||
|
Layout.topMargin: 20
|
||||||
|
onClicked:{
|
||||||
|
menu.popup()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluButton{
|
||||||
|
text:"右击菜单"
|
||||||
|
Layout.topMargin: 20
|
||||||
|
onClicked: {
|
||||||
|
showSuccess("请按鼠标右击")
|
||||||
|
}
|
||||||
|
MouseArea{
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.RightButton
|
||||||
|
onClicked: {
|
||||||
|
menu.popup()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluMenu{
|
||||||
|
id:menu
|
||||||
|
FluMenuItem:{
|
||||||
|
text:"删除"
|
||||||
|
onClicked: {
|
||||||
|
showError("删除")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluMenuItem:{
|
||||||
|
text:"修改"
|
||||||
|
onClicked: {
|
||||||
|
showInfo"修改")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
menu.popup()
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
|
FluMenu{
|
||||||
|
id:menu
|
||||||
|
FluMenuItem{
|
||||||
|
text:"删除"
|
||||||
|
onClicked: {
|
||||||
|
showError("删除")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluMenuItem{
|
||||||
|
text:"修改"
|
||||||
|
onClicked: {
|
||||||
|
showInfo("修改")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
190
example/qml/page/T_MultiWindow.qml
Normal file
@ -0,0 +1,190 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
property string password: ""
|
||||||
|
property var loginPageRegister: registerForWindowResult("/login")
|
||||||
|
|
||||||
|
title:"MultiWindow"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
Connections{
|
||||||
|
target: loginPageRegister
|
||||||
|
function onResult(data)
|
||||||
|
{
|
||||||
|
password = data.password
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 86
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
Column{
|
||||||
|
spacing: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"<font color='red'>Standard</font>模式窗口,每次都会创建新窗口"
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"点击创建窗口"
|
||||||
|
onClicked: {
|
||||||
|
FluApp.navigate("/standardWindow")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 86
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 10
|
||||||
|
Column{
|
||||||
|
spacing: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"<font color='red'>SingleTask</font>模式窗口,如果窗口存在,这激活该窗口"
|
||||||
|
textFormat: Text.RichText
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"点击创建窗口"
|
||||||
|
onClicked: {
|
||||||
|
FluApp.navigate("/singleTaskWindow")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 86
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 10
|
||||||
|
Column{
|
||||||
|
spacing: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"<font color='red'>SingleInstance</font>模式窗口,如果窗口存在,则销毁窗口,然后新建窗口"
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"点击创建窗口"
|
||||||
|
onClicked: {
|
||||||
|
FluApp.navigate("/singleInstanceWindow")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluWindow{
|
||||||
|
//launchMode: FluWindow.Standard
|
||||||
|
//launchMode: FluWindow.SingleTask
|
||||||
|
launchMode: FluWindow.SingleInstance
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 100
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
Column{
|
||||||
|
spacing: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"页面跳转,不携带任何参数"
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"点击跳转"
|
||||||
|
onClicked: {
|
||||||
|
FluApp.navigate("/about")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluButton{
|
||||||
|
text:"点击跳转"
|
||||||
|
onClicked: {
|
||||||
|
FluApp.navigate("/about")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 130
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
Column{
|
||||||
|
spacing: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"页面跳转,并携带参数用户名:zhuzichu"
|
||||||
|
}
|
||||||
|
FluButton{
|
||||||
|
text:"点击跳转到登录"
|
||||||
|
onClicked: {
|
||||||
|
loginPageRegister.launch({username:"zhuzichu"})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"登录窗口返回过来的密码->"+password
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'property var loginPageRegister: registerForWindowResult("/login")
|
||||||
|
|
||||||
|
Connections{
|
||||||
|
target: loginPageRegister
|
||||||
|
function onResult(data)
|
||||||
|
{
|
||||||
|
password = data.password
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluButton{
|
||||||
|
text:"点击跳转"
|
||||||
|
onClicked: {
|
||||||
|
loginPageRegister.launch({username:"zhuzichu"})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
84
example/qml/page/T_Pivot.qml
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"Pivot"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 400
|
||||||
|
paddings: 10
|
||||||
|
|
||||||
|
FluPivot{
|
||||||
|
anchors.fill: parent
|
||||||
|
currentIndex: 2
|
||||||
|
FluPivotItem{
|
||||||
|
title:"All"
|
||||||
|
contentItem:FluText{
|
||||||
|
text:"All emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem{
|
||||||
|
title:"Unread"
|
||||||
|
contentItem:FluText{
|
||||||
|
text:"Unread emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem{
|
||||||
|
title:"Flagged"
|
||||||
|
contentItem:FluText{
|
||||||
|
text:"Flagged emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem{
|
||||||
|
title:"Urgent"
|
||||||
|
contentItem:FluText{
|
||||||
|
text:"Urgent emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluPivot{
|
||||||
|
anchors.fill: parent
|
||||||
|
FluPivotItem:{
|
||||||
|
text:"All"
|
||||||
|
contentItem: FluText{
|
||||||
|
text:"All emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem:{
|
||||||
|
text:"Unread"
|
||||||
|
contentItem: FluText{
|
||||||
|
text:"Unread emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem:{
|
||||||
|
text:"Flagged"
|
||||||
|
contentItem: FluText{
|
||||||
|
text:"Flagged emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluPivotItem:{
|
||||||
|
text:"Urgent"
|
||||||
|
contentItem: FluText{
|
||||||
|
text:"Urgent emails go here."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
70
example/qml/page/T_Progress.qml
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"Progress"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 260
|
||||||
|
paddings: 10
|
||||||
|
ColumnLayout{
|
||||||
|
spacing: 20
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
FluProgressBar{
|
||||||
|
}
|
||||||
|
FluProgressRing{
|
||||||
|
}
|
||||||
|
FluProgressBar{
|
||||||
|
id:progress_bar
|
||||||
|
indeterminate: false
|
||||||
|
}
|
||||||
|
FluProgressRing{
|
||||||
|
id:progress_ring
|
||||||
|
indeterminate: false
|
||||||
|
}
|
||||||
|
FluSlider{
|
||||||
|
value:50
|
||||||
|
onValueChanged:{
|
||||||
|
progress_bar.progress = value/100
|
||||||
|
progress_ring.progress = value/100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluProgressBar{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
FluProgressRing{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
FluProgressBar{
|
||||||
|
indeterminate: false
|
||||||
|
}
|
||||||
|
|
||||||
|
FluProgressRing{
|
||||||
|
indeterminate: false
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
44
example/qml/page/T_RatingControl.qml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"RatingControl"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 100
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
Column{
|
||||||
|
spacing: 10
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
FluRatingControl{
|
||||||
|
|
||||||
|
}
|
||||||
|
FluRatingControl{
|
||||||
|
number:10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluRatingControl{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
152
example/qml/page/T_Rectangle.qml
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"Rectangle"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 480
|
||||||
|
paddings: 10
|
||||||
|
|
||||||
|
Column{
|
||||||
|
spacing: 15
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout{
|
||||||
|
Layout.topMargin: 20
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
color:"#0078d4"
|
||||||
|
radius:[0,0,0,0]
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
color:"#744da9"
|
||||||
|
radius:[15,15,15,15]
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
color:"#ffeb3b"
|
||||||
|
radius:[15,0,0,0]
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
color:"#f7630c"
|
||||||
|
radius:[0,15,0,0]
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
color:"#e71123"
|
||||||
|
radius:[0,0,15,0]
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
color:"#b4009e"
|
||||||
|
radius:[0,0,0,15]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"配合图片使用"
|
||||||
|
fontStyle: FluText.SubTitle
|
||||||
|
Layout.topMargin: 20
|
||||||
|
}
|
||||||
|
RowLayout{
|
||||||
|
spacing: 14
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
radius:[25,0,25,25]
|
||||||
|
Image {
|
||||||
|
asynchronous: true
|
||||||
|
anchors.fill: parent
|
||||||
|
source: "qrc:/example/res/svg/avatar_1.svg"
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
radius:[10,10,10,10]
|
||||||
|
Image {
|
||||||
|
asynchronous: true
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
|
source: "qrc:/example/res/svg/avatar_2.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
radius:[25,25,25,25]
|
||||||
|
Image {
|
||||||
|
asynchronous: true
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
|
source: "qrc:/example/res/svg/avatar_3.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
radius:[0,25,25,25]
|
||||||
|
Image {
|
||||||
|
asynchronous: true
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
|
source: "qrc:/example/res/svg/avatar_4.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluRectangle{
|
||||||
|
width: 1080/5
|
||||||
|
height: 1439/5
|
||||||
|
radius:[25,25,25,25]
|
||||||
|
Image {
|
||||||
|
asynchronous: true
|
||||||
|
source: "qrc:/example/res/image/image_huoyin.webp"
|
||||||
|
anchors.fill: parent
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
|
}
|
||||||
|
Layout.topMargin: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluRectangle{
|
||||||
|
radius: [25,25,25,25]
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
Image{
|
||||||
|
asynchronous: true
|
||||||
|
anchors.fill: parent
|
||||||
|
source: "qrc:/example/res/svg/avatar_4.svg"
|
||||||
|
sourceSize: Qt.size(width,height)
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
117
example/qml/page/T_Settings.qml
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "qrc:///example/qml/global/"
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"Settings"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 136
|
||||||
|
paddings: 10
|
||||||
|
|
||||||
|
ColumnLayout{
|
||||||
|
spacing: 10
|
||||||
|
anchors{
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:lang.dark_mode
|
||||||
|
fontStyle: FluText.BodyStrong
|
||||||
|
Layout.bottomMargin: 4
|
||||||
|
}
|
||||||
|
Repeater{
|
||||||
|
model: [{title:"System",mode:FluDarkMode.System},{title:"Light",mode:FluDarkMode.Light},{title:"Dark",mode:FluDarkMode.Dark}]
|
||||||
|
delegate: FluRadioButton{
|
||||||
|
selected : FluTheme.darkMode === modelData.mode
|
||||||
|
text:modelData.title
|
||||||
|
onClicked:{
|
||||||
|
FluTheme.darkMode = modelData.mode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 168
|
||||||
|
paddings: 10
|
||||||
|
|
||||||
|
ColumnLayout{
|
||||||
|
spacing: 10
|
||||||
|
anchors{
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
|
||||||
|
FluText{
|
||||||
|
text:lang.navigation_view_display_mode
|
||||||
|
fontStyle: FluText.BodyStrong
|
||||||
|
Layout.bottomMargin: 4
|
||||||
|
}
|
||||||
|
Repeater{
|
||||||
|
model: [{title:"Open",mode:FluNavigationView.Open},{title:"Compact",mode:FluNavigationView.Compact},{title:"Minimal",mode:FluNavigationView.Minimal},{title:"Auto",mode:FluNavigationView.Auto}]
|
||||||
|
delegate: FluRadioButton{
|
||||||
|
selected : MainEvent.displayMode===modelData.mode
|
||||||
|
text:modelData.title
|
||||||
|
onClicked:{
|
||||||
|
MainEvent.displayMode = modelData.mode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 80
|
||||||
|
paddings: 10
|
||||||
|
|
||||||
|
ColumnLayout{
|
||||||
|
spacing: 10
|
||||||
|
anchors{
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
|
||||||
|
FluText{
|
||||||
|
text:lang.locale
|
||||||
|
fontStyle: FluText.BodyStrong
|
||||||
|
Layout.bottomMargin: 4
|
||||||
|
}
|
||||||
|
|
||||||
|
Flow{
|
||||||
|
spacing: 5
|
||||||
|
Repeater{
|
||||||
|
model: ["Zh","En"]
|
||||||
|
delegate: FluRadioButton{
|
||||||
|
selected : appInfo.lang.objectName === modelData
|
||||||
|
text:modelData
|
||||||
|
onClicked:{
|
||||||
|
console.debug(modelData)
|
||||||
|
appInfo.changeLang(modelData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
58
example/qml/page/T_Slider.qml
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import "../component"
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"Slider"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 100
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
FluSlider{
|
||||||
|
value: 50
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluSlider{
|
||||||
|
value:50
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 200
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
FluSlider{
|
||||||
|
value: 50
|
||||||
|
vertical:true
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 20
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluSlider{
|
||||||
|
vertical:true
|
||||||
|
value:50
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
92
example/qml/page/T_StatusView.qml
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"StatusView"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
id:layout_actions
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 50
|
||||||
|
paddings: 10
|
||||||
|
RowLayout{
|
||||||
|
spacing: 14
|
||||||
|
FluDropDownButton{
|
||||||
|
id:btn_status_mode
|
||||||
|
Layout.preferredWidth: 140
|
||||||
|
text:"Loading"
|
||||||
|
items:[
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Loading"
|
||||||
|
onClicked: {
|
||||||
|
btn_status_mode.text = text
|
||||||
|
status_view.statusMode = FluStatusView.Loading
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Empty"
|
||||||
|
onClicked: {
|
||||||
|
btn_status_mode.text = text
|
||||||
|
status_view.statusMode = FluStatusView.Empty
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Error"
|
||||||
|
onClicked: {
|
||||||
|
btn_status_mode.text = text
|
||||||
|
status_view.statusMode = FluStatusView.Error
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Success"
|
||||||
|
onClicked: {
|
||||||
|
btn_status_mode.text = text
|
||||||
|
status_view.statusMode = FluStatusView.Success
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 10
|
||||||
|
height: 380
|
||||||
|
paddings: 10
|
||||||
|
FluStatusView{
|
||||||
|
id:status_view
|
||||||
|
anchors.fill: parent
|
||||||
|
onErrorClicked:{
|
||||||
|
showError("点击重新加载")
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color:FluTheme.primaryColor.dark
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluStatusView{
|
||||||
|
anchors.fill: parent
|
||||||
|
statusMode: FluStatusView.Loading
|
||||||
|
Rectangle{
|
||||||
|
anchors.fill: parent
|
||||||
|
color:FluTheme.primaryColor.dark
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
property var colors : [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
|
property var colors : [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
|
||||||
|
|
||||||
@ -22,7 +24,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
function newTab(){
|
function newTab(){
|
||||||
tab_view.appendTab("qrc:/res/image/favicon.ico","Document "+tab_view.count(),com_page,colors[Math.floor(Math.random() * 8)].dark)
|
tab_view.appendTab("qrc:/example/res/image/favicon.ico","Document "+tab_view.count(),com_page,colors[Math.floor(Math.random() * 8)].dark)
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
@ -32,7 +34,7 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 50
|
height: 50
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -69,7 +71,7 @@ FluScrollablePage{
|
|||||||
FluDropDownButton{
|
FluDropDownButton{
|
||||||
id:btn_close_button_visibility
|
id:btn_close_button_visibility
|
||||||
text:"Always"
|
text:"Always"
|
||||||
Layout.preferredWidth: 120
|
Layout.preferredWidth: 120
|
||||||
items:[
|
items:[
|
||||||
FluMenuItem{
|
FluMenuItem{
|
||||||
text:"Nerver"
|
text:"Nerver"
|
||||||
@ -98,8 +100,8 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 5
|
Layout.topMargin: 15
|
||||||
height: 400
|
height: 400
|
||||||
paddings: 10
|
paddings: 10
|
||||||
FluTabView{
|
FluTabView{
|
||||||
@ -109,5 +111,28 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluTabView{
|
||||||
|
anchors.fill: parent
|
||||||
|
Component.onCompleted: {
|
||||||
|
newTab()
|
||||||
|
newTab()
|
||||||
|
newTab()
|
||||||
|
}
|
||||||
|
Component{
|
||||||
|
id:com_page
|
||||||
|
Rectangle{
|
||||||
|
anchors.fill: parent
|
||||||
|
color: argument
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function newTab(){
|
||||||
|
tab_view.appendTab("qrc:/example/res/image/favicon.ico","Document 1",com_page,argument)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
159
example/qml/page/T_TableView.qml
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"TableView"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '姓名',
|
||||||
|
dataIndex: 'name',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '年龄',
|
||||||
|
dataIndex: 'age',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '住址',
|
||||||
|
dataIndex: 'address',
|
||||||
|
width:200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '别名',
|
||||||
|
dataIndex: 'nickname',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
dataIndex: 'action',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
];
|
||||||
|
table_view.columns = columns
|
||||||
|
loadData(1,10)
|
||||||
|
}
|
||||||
|
|
||||||
|
FluTableView{
|
||||||
|
id:table_view
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
pageCurrent:1
|
||||||
|
pageCount:10
|
||||||
|
itemCount: 1000
|
||||||
|
onRequestPage:
|
||||||
|
(page,count)=> {
|
||||||
|
loadData(page,count)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component{
|
||||||
|
id:com_action
|
||||||
|
Item{
|
||||||
|
Row{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 10
|
||||||
|
FluFilledButton{
|
||||||
|
text:"编辑"
|
||||||
|
topPadding:3
|
||||||
|
bottomPadding:3
|
||||||
|
leftPadding:6
|
||||||
|
rightPadding:6
|
||||||
|
onClicked:{
|
||||||
|
console.debug(dataModel.index)
|
||||||
|
showSuccess(JSON.stringify(dataObject))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluFilledButton{
|
||||||
|
text:"删除"
|
||||||
|
topPadding:3
|
||||||
|
bottomPadding:3
|
||||||
|
leftPadding:6
|
||||||
|
rightPadding:6
|
||||||
|
onClicked:{
|
||||||
|
showError(JSON.stringify(dataObject))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadData(page,count){
|
||||||
|
const dataSource = []
|
||||||
|
for(var i=0;i<count;i++){
|
||||||
|
dataSource.push({
|
||||||
|
name: "孙悟空%1".arg(((page-1)*count+i)),
|
||||||
|
age: 500,
|
||||||
|
address: "钟灵毓秀的花果山,如神仙仙境的水帘洞",
|
||||||
|
nickname: "齐天大圣",
|
||||||
|
action:com_action
|
||||||
|
})
|
||||||
|
}
|
||||||
|
table_view.dataSource = dataSource
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 10
|
||||||
|
code:'FluTableView{
|
||||||
|
id:table_view
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
pageCurrent:1
|
||||||
|
pageCount:10
|
||||||
|
itemCount: 1000
|
||||||
|
onRequestPage:
|
||||||
|
(page,count)=> {
|
||||||
|
loadData(page,count)
|
||||||
|
}
|
||||||
|
Component.onCompleted: {
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: "姓名",
|
||||||
|
dataIndex: "name",
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "年龄",
|
||||||
|
dataIndex: "age",
|
||||||
|
width:100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "住址",
|
||||||
|
dataIndex: "address",
|
||||||
|
width:200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "别名",
|
||||||
|
dataIndex: "nickname",
|
||||||
|
width:100
|
||||||
|
}
|
||||||
|
];
|
||||||
|
table_view.columns = columns
|
||||||
|
const dataSource = [
|
||||||
|
{
|
||||||
|
name: "孙悟空”,
|
||||||
|
age: 500,
|
||||||
|
address:"钟灵毓秀的花果山,如神仙仙境的水帘洞",
|
||||||
|
nickname:"齐天大圣"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
table_view.dataSource = columns
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
193
example/qml/page/T_TextBox.qml
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"TextBox"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
FluTextBox{
|
||||||
|
Layout.topMargin: 20
|
||||||
|
placeholderText: "单行输入框"
|
||||||
|
Layout.preferredWidth: 300
|
||||||
|
disabled:text_box_switch.selected
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row{
|
||||||
|
spacing: 5
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:text_box_switch
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
text:"Disabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluTextBox{
|
||||||
|
placeholderText:"单行输入框"
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
FluPasswordBox{
|
||||||
|
Layout.topMargin: 20
|
||||||
|
placeholderText: "请输入密码"
|
||||||
|
Layout.preferredWidth: 300
|
||||||
|
disabled:password_box_switch.selected
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row{
|
||||||
|
spacing: 5
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:password_box_switch
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
text:"Disabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluPasswordBox{
|
||||||
|
placeholderText:"请输入密码"
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 36+multiine_textbox.height
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
FluMultilineTextBox{
|
||||||
|
id:multiine_textbox
|
||||||
|
Layout.topMargin: 20
|
||||||
|
placeholderText: "多行输入框"
|
||||||
|
Layout.preferredWidth: 300
|
||||||
|
disabled:text_box_multi_switch.selected
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row{
|
||||||
|
spacing: 5
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:text_box_multi_switch
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
text:"Disabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluMultilineTextBox{
|
||||||
|
placeholderText:"多行输入框"
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
FluAutoSuggestBox{
|
||||||
|
Layout.topMargin: 20
|
||||||
|
placeholderText: "AutoSuggestBox"
|
||||||
|
Layout.preferredWidth: 300
|
||||||
|
items:generateRandomNames(100)
|
||||||
|
disabled:text_box_suggest_switch.selected
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row{
|
||||||
|
spacing: 5
|
||||||
|
anchors{
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
id:text_box_suggest_switch
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
text:"Disabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluAutoSuggestBox{
|
||||||
|
placeholderText:"AutoSuggestBox"
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function generateRandomNames(numNames) {
|
||||||
|
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||||
|
const names = [];
|
||||||
|
function generateRandomName() {
|
||||||
|
const nameLength = Math.floor(Math.random() * 5) + 4;
|
||||||
|
let name = '';
|
||||||
|
for (let i = 0; i < nameLength; i++) {
|
||||||
|
const letterIndex = Math.floor(Math.random() * 26);
|
||||||
|
name += alphabet.charAt(letterIndex);
|
||||||
|
}
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < numNames; i++) {
|
||||||
|
const name = generateRandomName();
|
||||||
|
names.push({title:name});
|
||||||
|
}
|
||||||
|
return names;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
92
example/qml/page/T_Theme.qml
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"Theme"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 210
|
||||||
|
paddings: 10
|
||||||
|
ColumnLayout{
|
||||||
|
spacing:0
|
||||||
|
anchors{
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
RowLayout{
|
||||||
|
Layout.topMargin: 10
|
||||||
|
Repeater{
|
||||||
|
model: [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
|
||||||
|
delegate: FluRectangle{
|
||||||
|
width: 42
|
||||||
|
height: 42
|
||||||
|
radius: [4,4,4,4]
|
||||||
|
color: mouse_item.containsMouse ? Qt.lighter(modelData.normal,1.1) : modelData.normal
|
||||||
|
FluIcon {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
iconSource: FluentIcons.AcceptMedium
|
||||||
|
iconSize: 15
|
||||||
|
visible: modelData === FluTheme.primaryColor
|
||||||
|
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
||||||
|
}
|
||||||
|
MouseArea{
|
||||||
|
id:mouse_item
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: {
|
||||||
|
FluTheme.primaryColor = modelData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"夜间模式"
|
||||||
|
Layout.topMargin: 20
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
Layout.topMargin: 5
|
||||||
|
selected: FluTheme.dark
|
||||||
|
clickFunc:function(){
|
||||||
|
if(FluTheme.dark){
|
||||||
|
FluTheme.darkMode = FluDarkMode.Light
|
||||||
|
}else{
|
||||||
|
FluTheme.darkMode = FluDarkMode.Dark
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluText{
|
||||||
|
text:"native文本渲染"
|
||||||
|
Layout.topMargin: 20
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
Layout.topMargin: 5
|
||||||
|
selected: FluTheme.nativeText
|
||||||
|
clickFunc:function(){
|
||||||
|
FluTheme.nativeText = !FluTheme.nativeText
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluTheme.primaryColor = FluColors.Orange
|
||||||
|
|
||||||
|
FluTheme.dark = true
|
||||||
|
|
||||||
|
FluTheme.nativeText = true'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,9 +11,10 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -33,10 +35,16 @@ FluScrollablePage{
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluTimePicker{
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 80
|
height: 80
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -49,15 +57,21 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
text:"hourFormat=FluTimePicker.HH"
|
text:"hourFormat=FluTimePicker.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
FluTimePicker{
|
FluTimePicker{
|
||||||
hourFormat:FluTimePicker.HH
|
hourFormat:FluTimePicker.HH
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluTimePicker{
|
||||||
|
hourFormat:FluTimePicker.HH
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
40
example/qml/page/T_ToggleSwitch.qml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage{
|
||||||
|
|
||||||
|
title:"ToggleSwitch"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
height: 68
|
||||||
|
paddings: 10
|
||||||
|
Layout.topMargin: 20
|
||||||
|
Row{
|
||||||
|
spacing: 30
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
FluToggleSwitch{
|
||||||
|
}
|
||||||
|
FluToggleSwitch{
|
||||||
|
text:"Text"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluToggleSwitch{
|
||||||
|
text:"Text"
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -3,6 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
FluScrollablePage{
|
FluScrollablePage{
|
||||||
|
|
||||||
@ -10,15 +11,15 @@ FluScrollablePage{
|
|||||||
leftPadding:10
|
leftPadding:10
|
||||||
rightPadding:10
|
rightPadding:10
|
||||||
bottomPadding:20
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
text:"鼠标悬停不动,弹出Tooltip"
|
text:"鼠标悬停不动,弹出Tooltip"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -42,9 +43,22 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluIconButton{
|
||||||
|
iconSource:FluentIcons.ChromeCloseContrast
|
||||||
|
iconSize: 15
|
||||||
|
text:"删除"
|
||||||
|
onClicked:{
|
||||||
|
showSuccess("点击IconButton")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
FluArea{
|
FluArea{
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
height: 68
|
height: 68
|
||||||
paddings: 10
|
paddings: 10
|
||||||
@ -72,6 +86,22 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluButton{
|
||||||
|
id:button_1
|
||||||
|
text:"删除"
|
||||||
|
FluTooltip{
|
||||||
|
visible: button_1.hovered
|
||||||
|
text:button_1.text
|
||||||
|
delay: 1000
|
||||||
|
}
|
||||||
|
onClicked:{
|
||||||
|
showSuccess("点击一个Button")
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
162
example/qml/page/T_TreeView.qml
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import FluentUI
|
||||||
|
import "../component"
|
||||||
|
|
||||||
|
FluScrollablePage {
|
||||||
|
|
||||||
|
title:"TreeView"
|
||||||
|
leftPadding:10
|
||||||
|
rightPadding:10
|
||||||
|
bottomPadding:20
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
function randomName() {
|
||||||
|
var names = ["张三", "李四", "王五", "赵六", "钱七", "孙八", "周九", "吴十"]
|
||||||
|
return names[Math.floor(Math.random() * names.length)]
|
||||||
|
}
|
||||||
|
|
||||||
|
function randomCompany() {
|
||||||
|
var companies = ["阿里巴巴", "腾讯", "百度", "京东", "华为", "小米", "字节跳动", "美团", "滴滴"]
|
||||||
|
return companies[Math.floor(Math.random() * companies.length)]
|
||||||
|
}
|
||||||
|
|
||||||
|
function randomDepartment() {
|
||||||
|
var departments = ["技术部", "销售部", "市场部", "人事部", "财务部", "客服部", "产品部", "设计部", "运营部"]
|
||||||
|
return departments[Math.floor(Math.random() * departments.length)]
|
||||||
|
}
|
||||||
|
|
||||||
|
function createEmployee() {
|
||||||
|
var name = randomName()
|
||||||
|
return tree_view.createItem(name, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
function createSubtree(numEmployees) {
|
||||||
|
var employees = []
|
||||||
|
for (var i = 0; i < numEmployees; i++) {
|
||||||
|
employees.push(createEmployee())
|
||||||
|
}
|
||||||
|
return tree_view.createItem(randomDepartment(), true, employees)
|
||||||
|
}
|
||||||
|
|
||||||
|
function createOrg(numLevels, numSubtrees, numEmployees) {
|
||||||
|
if (numLevels === 0) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
var subtrees = []
|
||||||
|
for (var i = 0; i < numSubtrees; i++) {
|
||||||
|
subtrees.push(createSubtree(numEmployees))
|
||||||
|
}
|
||||||
|
return [tree_view.createItem(randomCompany(), true, subtrees)].concat(createOrg(numLevels - 1, numSubtrees, numEmployees))
|
||||||
|
}
|
||||||
|
|
||||||
|
FluArea{
|
||||||
|
id:layout_actions
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 20
|
||||||
|
height: 50
|
||||||
|
paddings: 10
|
||||||
|
RowLayout{
|
||||||
|
spacing: 14
|
||||||
|
FluDropDownButton{
|
||||||
|
id:btn_selection_model
|
||||||
|
Layout.preferredWidth: 140
|
||||||
|
text:"None"
|
||||||
|
items:[
|
||||||
|
FluMenuItem{
|
||||||
|
text:"None"
|
||||||
|
onClicked: {
|
||||||
|
btn_selection_model.text = text
|
||||||
|
tree_view.selectionMode = FluTabView.Equal
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Single"
|
||||||
|
onClicked: {
|
||||||
|
btn_selection_model.text = text
|
||||||
|
tree_view.selectionMode = FluTabView.SizeToContent
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FluMenuItem{
|
||||||
|
text:"Muiltple"
|
||||||
|
onClicked: {
|
||||||
|
btn_selection_model.text = text
|
||||||
|
tree_view.selectionMode = FluTabView.Compact
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
FluFilledButton{
|
||||||
|
text:"获取选中的数据"
|
||||||
|
onClicked: {
|
||||||
|
if(tree_view.selectionMode === FluTreeView.None){
|
||||||
|
showError("当前非选择模式,没有选中的数据")
|
||||||
|
}
|
||||||
|
if(tree_view.selectionMode === FluTreeView.Single){
|
||||||
|
if(!tree_view.signleData()){
|
||||||
|
showError("没有选中数据")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
showSuccess(tree_view.signleData().text)
|
||||||
|
}
|
||||||
|
if(tree_view.selectionMode === FluTreeView.Multiple){
|
||||||
|
if(tree_view.multipData().length===0){
|
||||||
|
showError("没有选中数据")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var info = []
|
||||||
|
tree_view.multipData().map((value)=>info.push(value.text))
|
||||||
|
showSuccess(info.join(","))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FluArea{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 10
|
||||||
|
paddings: 10
|
||||||
|
height: 400
|
||||||
|
FluTreeView{
|
||||||
|
id:tree_view
|
||||||
|
width:240
|
||||||
|
anchors{
|
||||||
|
top:parent.top
|
||||||
|
left:parent.left
|
||||||
|
bottom:parent.bottom
|
||||||
|
}
|
||||||
|
onItemClicked:
|
||||||
|
(model)=>{
|
||||||
|
showSuccess(model.text)
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
var org = createOrg(3, 3, 3)
|
||||||
|
createItem()
|
||||||
|
updateData(org)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeExpander{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: -1
|
||||||
|
code:'FluTreeView{
|
||||||
|
id:tree_view
|
||||||
|
width:240
|
||||||
|
height:600
|
||||||
|
Component.onCompleted: {
|
||||||
|
var datas = []
|
||||||
|
datas.push(createItem("Node1",false))
|
||||||
|
datas.push(createItem("Node2",false))
|
||||||
|
datas.push(createItem("Node2",true,[createItem("Node2-1",false),createItem("Node2-2",false)]))
|
||||||
|
updateData(datas)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -15,15 +15,19 @@ FluContentPage {
|
|||||||
slider.seek(0)
|
slider.seek(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollView{
|
FluArea{
|
||||||
clip: true
|
anchors{
|
||||||
width: parent.width
|
top:parent.top
|
||||||
contentWidth: parent.width
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
topMargin: 20
|
||||||
|
}
|
||||||
|
paddings: 10
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
spacing: 0
|
spacing: 0
|
||||||
FluText{
|
FluText{
|
||||||
text:"Display"
|
text:"Display"
|
||||||
Layout.topMargin: 20
|
|
||||||
padding: 0
|
padding: 0
|
||||||
pixelSize: textSize
|
pixelSize: textSize
|
||||||
fontStyle: FluText.Display
|
fontStyle: FluText.Display
|
||||||
@ -65,21 +69,26 @@ FluContentPage {
|
|||||||
fontStyle: FluText.Caption
|
fontStyle: FluText.Caption
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FluSlider{
|
||||||
|
id:slider
|
||||||
|
vertical:true
|
||||||
|
anchors{
|
||||||
|
right: parent.right
|
||||||
|
rightMargin: 45
|
||||||
|
top: parent.top
|
||||||
|
topMargin: 30
|
||||||
|
}
|
||||||
|
onValueChanged:{
|
||||||
|
textSize = value/100*6+FluTheme.textSize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluSlider{
|
|
||||||
id:slider
|
|
||||||
vertical:true
|
|
||||||
anchors{
|
|
||||||
right: parent.right
|
|
||||||
rightMargin: 45
|
|
||||||
top: parent.top
|
|
||||||
topMargin: 30
|
|
||||||
}
|
|
||||||
onValueChanged:{
|
|
||||||
textSize = value/100*6+FluTheme.textSize
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -5,14 +5,15 @@ import FluentUI
|
|||||||
|
|
||||||
FluWindow {
|
FluWindow {
|
||||||
|
|
||||||
width: 500
|
id:window
|
||||||
height: 600
|
|
||||||
minimumWidth: 500
|
|
||||||
minimumHeight: 600
|
|
||||||
maximumWidth: 500
|
|
||||||
maximumHeight: 600
|
|
||||||
|
|
||||||
title:"关于"
|
title:"关于"
|
||||||
|
width: 600
|
||||||
|
height: 600
|
||||||
|
minimumWidth: 600
|
||||||
|
minimumHeight: 600
|
||||||
|
maximumWidth: 600
|
||||||
|
maximumHeight: 600
|
||||||
|
launchMode: FluWindow.SingleTask
|
||||||
|
|
||||||
FluAppBar{
|
FluAppBar{
|
||||||
id:appbar
|
id:appbar
|
||||||
@ -36,7 +37,7 @@ FluWindow {
|
|||||||
fontStyle: FluText.Title
|
fontStyle: FluText.Title
|
||||||
}
|
}
|
||||||
FluText{
|
FluText{
|
||||||
text:"v1.1.6"
|
text:"v%1".arg(appInfo.version)
|
||||||
fontStyle: FluText.Body
|
fontStyle: FluText.Body
|
||||||
Layout.alignment: Qt.AlignBottom
|
Layout.alignment: Qt.AlignBottom
|
||||||
}
|
}
|
||||||
@ -57,13 +58,14 @@ FluWindow {
|
|||||||
|
|
||||||
RowLayout{
|
RowLayout{
|
||||||
spacing: 14
|
spacing: 14
|
||||||
Layout.topMargin: 20
|
|
||||||
Layout.leftMargin: 15
|
Layout.leftMargin: 15
|
||||||
FluText{
|
FluText{
|
||||||
text:"GitHub:"
|
text:"GitHub:"
|
||||||
}
|
}
|
||||||
FluTextButton{
|
FluTextButton{
|
||||||
id:text_hublink
|
id:text_hublink
|
||||||
|
topPadding:0
|
||||||
|
bottomPadding:0
|
||||||
text:"https://github.com/zhuzichu520/FluentUI"
|
text:"https://github.com/zhuzichu520/FluentUI"
|
||||||
Layout.alignment: Qt.AlignBottom
|
Layout.alignment: Qt.AlignBottom
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@ -71,13 +73,30 @@ FluWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RowLayout{
|
||||||
|
spacing: 14
|
||||||
|
Layout.leftMargin: 15
|
||||||
|
FluText{
|
||||||
|
text:"B站:"
|
||||||
|
}
|
||||||
|
FluTextButton{
|
||||||
|
topPadding:0
|
||||||
|
bottomPadding:0
|
||||||
|
text:"https://www.bilibili.com/video/BV1mg4y1M71w/"
|
||||||
|
Layout.alignment: Qt.AlignBottom
|
||||||
|
onClicked: {
|
||||||
|
Qt.openUrlExternally(text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout{
|
RowLayout{
|
||||||
spacing: 14
|
spacing: 14
|
||||||
Layout.topMargin: 20
|
|
||||||
Layout.leftMargin: 15
|
Layout.leftMargin: 15
|
||||||
FluText{
|
FluText{
|
||||||
id:text_info
|
id:text_info
|
||||||
text:"如果该项目对你有作用,就请点击上方链接给一个免费的star吧!"
|
text:"如果该项目对你有作用,就请点击上方链接给一个免费的star,或者一键三连,谢谢!"
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
id: animation
|
id: animation
|
||||||
target: text_info
|
target: text_info
|
||||||
@ -91,5 +110,43 @@ FluWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RowLayout{
|
||||||
|
spacing: 14
|
||||||
|
Layout.leftMargin: 15
|
||||||
|
FluText{
|
||||||
|
text:"捐赠:"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item{
|
||||||
|
Layout.preferredWidth: parent.width
|
||||||
|
Layout.preferredHeight: 252
|
||||||
|
Row{
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
spacing: 60
|
||||||
|
Image{
|
||||||
|
width: 164.55
|
||||||
|
height: 224.25
|
||||||
|
source: "qrc:/example/res/image/qrcode_wx.jpg"
|
||||||
|
}
|
||||||
|
Image{
|
||||||
|
width: 162
|
||||||
|
height: 252
|
||||||
|
source: "qrc:/example/res/image/qrcode_zfb.jpg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout{
|
||||||
|
spacing: 14
|
||||||
|
Layout.leftMargin: 15
|
||||||
|
FluText{
|
||||||
|
id:text_desc
|
||||||
|
text:"个人开发,维护不易,你们的捐赠就是我继续更新的动力!\n有什么问题提Issues,只要时间充足我就会解决的!!"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -7,13 +7,12 @@ import QtQuick.Dialogs
|
|||||||
|
|
||||||
FluWindow {
|
FluWindow {
|
||||||
|
|
||||||
|
title:"ChatGPT"
|
||||||
width: 680
|
width: 680
|
||||||
height: 600
|
height: 600
|
||||||
minimumWidth: 500
|
minimumWidth: 500
|
||||||
minimumHeight: 600
|
minimumHeight: 600
|
||||||
|
|
||||||
title:"ChatGPT"
|
|
||||||
|
|
||||||
onInitArgument:
|
onInitArgument:
|
||||||
(argument)=>{
|
(argument)=>{
|
||||||
scrollview.focus = true
|
scrollview.focus = true
|
||||||
@ -121,7 +120,7 @@ FluWindow {
|
|||||||
asynchronous: true
|
asynchronous: true
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
sourceSize: Qt.size(100,100)
|
sourceSize: Qt.size(100,100)
|
||||||
source: isMy ? "qrc:/res/svg/avatar_2.svg" : "qrc:/res/image/logo_openai.png"
|
source: isMy ? "qrc:/example/res/svg/avatar_2.svg" : "qrc:/example/res/image/logo_openai.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +182,7 @@ FluWindow {
|
|||||||
rightMargin: 10
|
rightMargin: 10
|
||||||
}
|
}
|
||||||
height: Math.min(textbox.implicitHeight,64)
|
height: Math.min(textbox.implicitHeight,64)
|
||||||
FluMultiLineTextBox{
|
FluMultilineTextBox{
|
||||||
id:textbox
|
id:textbox
|
||||||
focus:true
|
focus:true
|
||||||
placeholderText: "请输入消息"
|
placeholderText: "请输入消息"
|
@ -1,19 +1,18 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Controls
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
FluWindow {
|
FluWindow {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
|
title:"登录"
|
||||||
width: 400
|
width: 400
|
||||||
height: 400
|
height: 400
|
||||||
minimumWidth: 400
|
minimumWidth: 400
|
||||||
minimumHeight: 400
|
minimumHeight: 400
|
||||||
maximumWidth: 400
|
maximumWidth: 400
|
||||||
maximumHeight: 400
|
maximumHeight: 400
|
||||||
modality:2
|
|
||||||
|
|
||||||
title:"登录"
|
|
||||||
|
|
||||||
onInitArgument:
|
onInitArgument:
|
||||||
(argument)=>{
|
(argument)=>{
|
112
example/qml/window/MainWindow.qml
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Qt.labs.platform
|
||||||
|
import FluentUI
|
||||||
|
import example
|
||||||
|
import "qrc:///example/qml/global/"
|
||||||
|
|
||||||
|
FluWindow {
|
||||||
|
|
||||||
|
id:window
|
||||||
|
title: "FluentUI"
|
||||||
|
width: 1000
|
||||||
|
height: 640
|
||||||
|
closeDestory:false
|
||||||
|
minimumWidth: 520
|
||||||
|
minimumHeight: 460
|
||||||
|
|
||||||
|
closeFunc:function(event){
|
||||||
|
close_app.open()
|
||||||
|
event.accepted = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections{
|
||||||
|
target: appInfo
|
||||||
|
function onActiveWindow(){
|
||||||
|
window.show()
|
||||||
|
window.raise()
|
||||||
|
window.requestActivate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluAppBar{
|
||||||
|
id:appbar
|
||||||
|
z:9
|
||||||
|
showDark: true
|
||||||
|
width:parent.width
|
||||||
|
darkText: lang.dark_mode
|
||||||
|
}
|
||||||
|
|
||||||
|
SystemTrayIcon {
|
||||||
|
id:system_tray
|
||||||
|
visible: true
|
||||||
|
icon.source: "qrc:/example/res/image/favicon.ico"
|
||||||
|
tooltip: "FluentUI"
|
||||||
|
menu: Menu {
|
||||||
|
MenuItem {
|
||||||
|
text: "退出"
|
||||||
|
onTriggered: {
|
||||||
|
window.destoryWindow()
|
||||||
|
FluApp.closeApp()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onActivated:
|
||||||
|
(reason)=>{
|
||||||
|
if(reason === SystemTrayIcon.Trigger){
|
||||||
|
window.show()
|
||||||
|
window.raise()
|
||||||
|
window.requestActivate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluContentDialog{
|
||||||
|
id:close_app
|
||||||
|
title:"退出"
|
||||||
|
message:"确定要退出程序吗?"
|
||||||
|
negativeText:"最小化"
|
||||||
|
buttonFlags: FluContentDialog.NeutralButton | FluContentDialog.NegativeButton | FluContentDialog.PositiveButton
|
||||||
|
onNegativeClicked:{
|
||||||
|
system_tray.showMessage("友情提示","FluentUI已隐藏至托盘,点击托盘可再次激活窗口");
|
||||||
|
window.hide()
|
||||||
|
}
|
||||||
|
positiveText:"退出"
|
||||||
|
neutralText:"取消"
|
||||||
|
onPositiveClicked:{
|
||||||
|
window.destoryWindow()
|
||||||
|
FluApp.closeApp()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
FluNavigationView{
|
||||||
|
id:nav_view
|
||||||
|
anchors.fill: parent
|
||||||
|
items: ItemsOriginal
|
||||||
|
footerItems:ItemsFooter
|
||||||
|
z:11
|
||||||
|
displayMode:MainEvent.displayMode
|
||||||
|
logo: "qrc:/example/res/image/favicon.ico"
|
||||||
|
title:"FluentUI"
|
||||||
|
autoSuggestBox:FluAutoSuggestBox{
|
||||||
|
width: 280
|
||||||
|
anchors.centerIn: parent
|
||||||
|
iconSource: FluentIcons.Search
|
||||||
|
items: ItemsOriginal.getSearchData()
|
||||||
|
placeholderText: lang.search
|
||||||
|
onItemClicked:
|
||||||
|
(data)=>{
|
||||||
|
ItemsOriginal.startPageByItem(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Component.onCompleted: {
|
||||||
|
ItemsOriginal.navigationView = nav_view
|
||||||
|
ItemsFooter.navigationView = nav_view
|
||||||
|
nav_view.setCurrentIndex(0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
35
example/qml/window/MediaWindow.qml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluWindow {
|
||||||
|
|
||||||
|
title:"视频播放器"
|
||||||
|
width: 640
|
||||||
|
height: 480
|
||||||
|
minimumWidth: 640
|
||||||
|
minimumHeight: 480
|
||||||
|
|
||||||
|
onInitArgument:
|
||||||
|
(argument)=>{
|
||||||
|
player.source = argument.source
|
||||||
|
}
|
||||||
|
|
||||||
|
FluAppBar{
|
||||||
|
id:appbar
|
||||||
|
title:"视频播放器"
|
||||||
|
width:parent.width
|
||||||
|
}
|
||||||
|
|
||||||
|
FluMediaPlayer{
|
||||||
|
id:player
|
||||||
|
anchors{
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
top: appbar.bottom
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
44
example/qml/window/SingleInstanceWindow.qml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluWindow {
|
||||||
|
|
||||||
|
id:window
|
||||||
|
title:"SingleInstance"
|
||||||
|
width: 500
|
||||||
|
height: 600
|
||||||
|
minimumWidth: 500
|
||||||
|
minimumHeight: 600
|
||||||
|
maximumWidth: 500
|
||||||
|
maximumHeight: 600
|
||||||
|
launchMode: FluWindow.SingleInstance
|
||||||
|
|
||||||
|
FluAppBar{
|
||||||
|
id:appbar
|
||||||
|
title:"SingleInstance"
|
||||||
|
width:parent.width
|
||||||
|
}
|
||||||
|
|
||||||
|
FluTextBox{
|
||||||
|
anchors{
|
||||||
|
top:parent.top
|
||||||
|
topMargin:60
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluText{
|
||||||
|
wrapMode: Text.WrapAnywhere
|
||||||
|
anchors{
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
leftMargin: 20
|
||||||
|
rightMargin: 20
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
text:"我是一个SingleInstance模式的窗口,如果我存在,我会销毁之前的窗口,并创建一个新窗口"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
29
example/qml/window/SingleTaskWindow.qml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluWindow {
|
||||||
|
|
||||||
|
id:window
|
||||||
|
title:"SingleTask"
|
||||||
|
width: 500
|
||||||
|
height: 600
|
||||||
|
minimumWidth: 500
|
||||||
|
minimumHeight: 600
|
||||||
|
maximumWidth: 500
|
||||||
|
maximumHeight: 600
|
||||||
|
launchMode: FluWindow.SingleTask
|
||||||
|
|
||||||
|
FluAppBar{
|
||||||
|
id:appbar
|
||||||
|
title:"SingleTask"
|
||||||
|
width:parent.width
|
||||||
|
}
|
||||||
|
|
||||||
|
FluText{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text:"我是一个SingleTask模式的窗口,如果我存在,我就激活窗口"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
29
example/qml/window/StandardWindow.qml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import FluentUI
|
||||||
|
|
||||||
|
FluWindow {
|
||||||
|
|
||||||
|
id:window
|
||||||
|
title:"Standard"
|
||||||
|
width: 500
|
||||||
|
height: 600
|
||||||
|
minimumWidth: 500
|
||||||
|
minimumHeight: 600
|
||||||
|
maximumWidth: 500
|
||||||
|
maximumHeight: 600
|
||||||
|
launchMode: FluWindow.Standard
|
||||||
|
|
||||||
|
FluAppBar{
|
||||||
|
id:appbar
|
||||||
|
title:"Standard"
|
||||||
|
width:parent.width
|
||||||
|
}
|
||||||
|
|
||||||
|
FluText{
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text:"我是一个Standard模式的窗口,每次我都会创建一个新的窗口"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
BIN
example/res/image/qrcode_wx.jpg
Normal file
After Width: | Height: | Size: 119 KiB |
BIN
example/res/image/qrcode_zfb.jpg
Normal file
After Width: | Height: | Size: 145 KiB |
1
example/res/svg/home.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1681271578882" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3664" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M923.733333 394.666667c-85.333333-70.4-206.933333-174.933333-362.666666-309.333334C533.333333 61.866667 490.666667 61.866667 462.933333 85.333333c-155.733333 134.4-277.333333 238.933333-362.666666 309.333334-14.933333 14.933333-25.6 34.133333-25.6 53.333333 0 38.4 32 70.4 70.4 70.4H192v358.4c0 29.866667 23.466667 53.333333 53.333333 53.333333H405.333333c29.866667 0 53.333333-23.466667 53.333334-53.333333v-206.933333h106.666666v206.933333c0 29.866667 23.466667 53.333333 53.333334 53.333333h160c29.866667 0 53.333333-23.466667 53.333333-53.333333V518.4h46.933333c38.4 0 70.4-32 70.4-70.4 0-21.333333-10.666667-40.533333-25.6-53.333333z m-44.8 59.733333h-57.6c-29.866667 0-53.333333 23.466667-53.333333 53.333333v358.4h-138.666667V661.333333c0-29.866667-23.466667-53.333333-53.333333-53.333333h-128c-29.866667 0-53.333333 23.466667-53.333333 53.333333v206.933334H256V507.733333c0-29.866667-23.466667-53.333333-53.333333-53.333333H145.066667c-4.266667 0-6.4-2.133333-6.4-6.4 0-2.133333 2.133333-4.266667 2.133333-6.4 85.333333-70.4 206.933333-174.933333 362.666667-309.333333 4.266667-4.266667 10.666667-4.266667 14.933333 0 155.733333 134.4 277.333333 238.933333 362.666667 309.333333 2.133333 2.133333 2.133333 2.133333 2.133333 4.266667 2.133333 6.4-2.133333 8.533333-4.266667 8.533333z" fill="#2c2c2c" p-id="3665"></path></svg>
|
After Width: | Height: | Size: 1.6 KiB |
1
example/res/svg/home_dark.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1681277986581" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3875" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M923.733333 394.666667c-85.333333-70.4-206.933333-174.933333-362.666666-309.333334C533.333333 61.866667 490.666667 61.866667 462.933333 85.333333c-155.733333 134.4-277.333333 238.933333-362.666666 309.333334-14.933333 14.933333-25.6 34.133333-25.6 53.333333 0 38.4 32 70.4 70.4 70.4H192v358.4c0 29.866667 23.466667 53.333333 53.333333 53.333333H405.333333c29.866667 0 53.333333-23.466667 53.333334-53.333333v-206.933333h106.666666v206.933333c0 29.866667 23.466667 53.333333 53.333334 53.333333h160c29.866667 0 53.333333-23.466667 53.333333-53.333333V518.4h46.933333c38.4 0 70.4-32 70.4-70.4 0-21.333333-10.666667-40.533333-25.6-53.333333z m-44.8 59.733333h-57.6c-29.866667 0-53.333333 23.466667-53.333333 53.333333v358.4h-138.666667V661.333333c0-29.866667-23.466667-53.333333-53.333333-53.333333h-128c-29.866667 0-53.333333 23.466667-53.333333 53.333333v206.933334H256V507.733333c0-29.866667-23.466667-53.333333-53.333333-53.333333H145.066667c-4.266667 0-6.4-2.133333-6.4-6.4 0-2.133333 2.133333-4.266667 2.133333-6.4 85.333333-70.4 206.933333-174.933333 362.666667-309.333333 4.266667-4.266667 10.666667-4.266667 14.933333 0 155.733333 134.4 277.333333 238.933333 362.666667 309.333333 2.133333 2.133333 2.133333 2.133333 2.133333 4.266667 2.133333 6.4-2.133333 8.533333-4.266667 8.533333z" fill="#ffffff" p-id="3876"></path></svg>
|
After Width: | Height: | Size: 1.6 KiB |
24
example/src/AppInfo.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include "AppInfo.h"
|
||||||
|
#include "lang/En.h"
|
||||||
|
#include "lang/Zh.h"
|
||||||
|
|
||||||
|
AppInfo::AppInfo(QObject *parent)
|
||||||
|
: QObject{parent}
|
||||||
|
{
|
||||||
|
version("1.2.8");
|
||||||
|
lang(new En());
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppInfo::changeLang(const QString& locale){
|
||||||
|
if(_lang){
|
||||||
|
_lang->deleteLater();
|
||||||
|
}
|
||||||
|
if(locale=="Zh"){
|
||||||
|
lang(new Zh());
|
||||||
|
}else if(locale=="En"){
|
||||||
|
lang(new En());
|
||||||
|
}else {
|
||||||
|
lang(new En());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|