Compare commits

...

91 Commits
1.1.4 ... 1.2.2

Author SHA1 Message Date
09e87e0fb8 update 2023-04-09 19:29:50 +08:00
0603a7603d update 2023-04-09 18:08:37 +08:00
d9a4f01e20 update 2023-04-09 17:59:00 +08:00
93709cd1dd update 2023-04-08 21:23:03 +08:00
0000e557a7 update 2023-04-08 20:44:27 +08:00
d2183e350e update 2023-04-08 20:26:49 +08:00
47caf4bb52 update 2023-04-08 20:20:44 +08:00
6fb9ee41fb update 2023-04-08 20:12:28 +08:00
b349c22434 update 2023-04-08 20:08:26 +08:00
12fa3487bb Merge pull request #29 from LiangLiang723/win32_cmake_fix
🐛 修复 windows 下生成 dll 库带 linux 前缀导致查找不到控件
2023-04-08 19:57:14 +08:00
a76806645a 🐛 修复 windows 下生成 dll 库带 linux 前缀导致查找不到控件 2023-04-08 19:45:39 +08:00
738db25c2c Merge pull request #28 from LiangLiang723/win32_cmake_fix
🐛 修复 windows 下生成 dll 库带 linux 前缀导致查找不到控件
2023-04-08 19:43:35 +08:00
9f8a5f5646 🐛 修复 windows 下生成 dll 库带 linux 前缀导致查找不到控件 2023-04-08 19:32:35 +08:00
c59c07e756 update 2023-04-07 20:48:04 +08:00
2084b5afa3 update 2023-04-07 20:19:18 +08:00
f8d717f41b update 2023-04-07 18:27:50 +08:00
be58fc5e7d update 2023-04-06 19:55:53 +08:00
1c0bc7208a update 2023-04-06 19:27:37 +08:00
d89aaec062 update 2023-04-06 17:32:21 +08:00
13abd275b4 update 2023-04-06 00:29:33 +08:00
e8460c2409 update 2023-04-05 21:42:12 +08:00
6de1b9d78f update 2023-04-05 17:48:17 +08:00
64fa2b6370 update 2023-04-05 17:05:05 +08:00
8970a0c09a update 2023-04-05 17:04:12 +08:00
e7cea72825 update 2023-04-05 16:37:27 +08:00
93186edfbe Merge pull request #16 from JesseGuoX/main
Optimize workflow
2023-04-04 17:21:19 +08:00
e60883bc60 Optimize workflow 2023-04-04 17:06:10 +08:00
47ab4dabbd update 2023-04-04 16:39:41 +08:00
206669e5f0 update 2023-04-04 15:09:34 +08:00
08457dc75e update 2023-04-04 09:08:10 +08:00
0c59a233ea update 2023-04-04 03:15:10 +08:00
fcb8da2c50 update 2023-04-04 02:37:20 +08:00
a8701256d4 update 2023-04-04 00:37:37 +08:00
8eaa4b6cbb update 2023-04-04 00:33:24 +08:00
af80a882d0 update 2023-04-04 00:18:39 +08:00
9d89328a43 update 2023-04-03 22:45:18 +08:00
0d4477437f update 2023-04-03 21:16:07 +08:00
6b3e73ce0b update 2023-04-03 21:13:50 +08:00
625bc74e26 update 2023-04-03 21:04:41 +08:00
731e4f27b4 update 2023-04-03 20:04:46 +08:00
fce64eccc6 Merge pull request #12 from JesseGuoX/main
add tag name into workflow release assets
2023-04-03 15:58:00 +08:00
689e0805e7 add tag name into update workflow release assets
before: example_ubuntu-20.04_6.4.3.AppImage

after: example_v1.1.8_ubuntu-20.04_Qt6.4.3.AppImage
2023-04-03 14:22:01 +08:00
986f1242dd update 2023-04-03 09:32:06 +08:00
a9c97a5c56 Merge pull request #10 from JesseGuoX/main
update workflow, speed up ci
2023-04-03 08:41:22 +08:00
81e78834d0 update workflow, speed up ci 2023-04-02 23:36:23 +08:00
5279a2c7b2 update 2023-04-02 14:05:54 +08:00
6391fc8dc6 update 2023-04-01 21:51:59 +08:00
9cf4b4b1af update 2023-04-01 21:42:32 +08:00
32c0b4ccd6 update 2023-04-01 21:37:07 +08:00
b2bfdd17da update 2023-04-01 21:06:39 +08:00
27db8160d4 update 2023-04-01 21:01:46 +08:00
ed0c9048b0 update 2023-04-01 10:22:05 +08:00
de2c891912 Create License 2023-04-01 09:31:18 +08:00
16daeb5268 update 2023-03-31 22:54:23 +08:00
0b37ddcb6e update 2023-03-31 22:05:25 +08:00
d2e3e6dd4b update 2023-03-31 18:11:55 +08:00
1e5bd75123 update 2023-03-31 17:59:20 +08:00
1b97b197a4 update 2023-03-31 13:03:36 +08:00
936a310ca6 update 2023-03-31 11:58:15 +08:00
3236be8a7f update 2023-03-30 23:25:48 +08:00
2008e0f524 update 2023-03-30 22:59:25 +08:00
4e53936bb7 update 2023-03-30 22:27:30 +08:00
eb758f7765 update 2023-03-30 22:18:42 +08:00
1ab69e401a update 2023-03-30 22:10:05 +08:00
e014aa774d update 2023-03-30 22:02:10 +08:00
0595e2e640 update 2023-03-30 21:59:32 +08:00
b5894158d2 update 2023-03-30 21:52:55 +08:00
4829ce58fd update 2023-03-30 19:58:57 +08:00
b5f44f4f7d update 2023-03-30 18:34:03 +08:00
cbd4c229aa update 2023-03-30 18:23:33 +08:00
7720208d17 update 2023-03-30 17:16:57 +08:00
9790ae12eb update 2023-03-30 11:49:35 +08:00
37ae17d92d update 2023-03-30 11:43:35 +08:00
036450f0a3 update 2023-03-29 22:42:08 +08:00
5a1b10fef8 update 2023-03-29 21:43:01 +08:00
a33a63abc9 update 2023-03-29 21:40:28 +08:00
ff4ec71379 update 2023-03-29 18:10:34 +08:00
76ed63eaf0 Merge branch 'main' of https://github.com/zhuzichu520/FluentUI 2023-03-29 15:44:39 +08:00
825a6f4461 update 2023-03-29 15:44:36 +08:00
98f4d970c6 update 2023-03-29 15:43:23 +08:00
38f4ae92db update 2023-03-28 22:41:43 +08:00
2e31ab902d update 2023-03-28 21:56:36 +08:00
850a1ba8d8 update 2023-03-28 21:53:55 +08:00
a298f43388 update 2023-03-28 21:37:10 +08:00
b70a982586 update 2023-03-28 18:14:14 +08:00
6a2a93561a update 2023-03-28 17:53:46 +08:00
96ad06c2e4 update 2023-03-28 13:10:30 +08:00
e7f6ad8b26 update 2023-03-28 13:01:28 +08:00
6174cbc2a4 update 2023-03-28 12:52:35 +08:00
e5bdd36e27 update 2023-03-28 12:37:03 +08:00
038cc37c12 update 2023-03-28 11:53:25 +08:00
263 changed files with 5799 additions and 2094 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -16,24 +16,25 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [macos-10.15,macos-11.0] os: [macos-12]
qt_ver: [5.15.2] 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: '⚙️ Cache Qt'
- name: prepare env id: cache-qt
if: ${{ matrix.os == 'macos-11.0' }} uses: actions/cache@v3
run: | with:
softwareupdate --all --install --force path: ${{ runner.workspace }}/Qt
sudo xcode-select --print-path key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
sudo xcode-select --switch /Library/Developer/CommandLineTools
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v2 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 }}
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 1 fetch-depth: 1
@ -58,6 +59,6 @@ jobs:
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

View File

@ -18,19 +18,27 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-18.04,ubuntu-20.04] os: [ubuntu-20.04]
qt_ver: [5.15.2] qt_ver: [6.4.3]
qt_arch: [gcc_64] qt_arch: [gcc_64]
env: env:
targetName: example targetName: example
steps: steps:
- name: '⚙️ Cache Qt'
id: cache-qt
uses: actions/cache@v3
with:
path: ${{ runner.workspace }}/Qt
key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v2 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 }}
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- name: ubuntu install GL library - name: ubuntu install GL library
run: sudo apt-get install -y libglew-dev libglfw3-dev qml-module-qtquick-controls qml-module-qtquick-controls2 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
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 1 fetch-depth: 1
@ -42,6 +50,8 @@ jobs:
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: |
@ -62,6 +72,6 @@ jobs:
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

View File

@ -13,40 +13,29 @@ on:
jobs: jobs:
build: build:
name: Build name: Build
runs-on: windows-2019 runs-on: windows-2022
strategy: strategy:
matrix: matrix:
include: include:
- qt_arch: win32_mingw81 - qt_arch: win64_mingw
qt_ver: 5.15.2 qt_ver: 6.4.3
qt_tools: "tools_mingw,8.1.0-1-202004170606,qt.tools.win32_mingw810" qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
qt_tools_mingw_install: mingw810_32 qt_tools_mingw_install: mingw900_64
- qt_arch: win64_mingw81
qt_ver: 5.15.2
qt_tools: "tools_mingw,8.1.0-1-202004170606,qt.tools.win64_mingw810"
qt_tools_mingw_install: mingw810_64
env: env:
targetName: example.exe targetName: example.exe
fileName: example fileName: example
steps: steps:
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v2 uses: jurplel/install-qt-action@v3
with: with:
version: ${{ matrix.qt_ver }} version: ${{ matrix.qt_ver }}
aqtversion: '==2.0.5'
arch: ${{ matrix.qt_arch }} arch: ${{ matrix.qt_arch }}
tools: ${{ matrix.qt_tools }} cache: ${{steps.cache-qt.outputs.cache-hit}}
cached: 'false' modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 1 fetch-depth: 1
- name: Qt 5 environment configuration - name: Qt6 environment configuration
if: ${{ startsWith( matrix.qt_ver, 5 ) }}
shell: pwsh
run: |
Write-Output "${{ env.Qt5_DIR }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Write-Output "${{ env.Qt5_DIR }}/../../Tools/${{ matrix.qt_tools_mingw_install }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Qt 6 environment configuration
if: ${{ startsWith( matrix.qt_ver, 6 ) }} if: ${{ startsWith( matrix.qt_ver, 6 ) }}
shell: pwsh shell: pwsh
run: | run: |
@ -82,6 +71,6 @@ jobs:
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

View File

@ -16,17 +16,13 @@ jobs:
name: Build name: Build
# 运行平台, windows-latest目前是windows server 2019 # 运行平台, windows-latest目前是windows server 2019
# 参考文档 https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md # 参考文档 https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
runs-on: windows-2019 runs-on: ${{ matrix.os }}
strategy: strategy:
# 矩阵配置 # 矩阵配置
matrix: matrix:
os: [windows-2019]
include: include:
# 5.15.2 参考 https://mirrors.cloud.tencent.com/qt/online/qtsdkrepository/windows_x86/desktop/qt5_5152/ - qt_ver: 6.4.3
- qt_ver: 5.15.2
qt_arch: win32_msvc2019
msvc_arch: x86
qt_arch_install: msvc2019
- qt_ver: 5.15.2
qt_arch: win64_msvc2019_64 qt_arch: win64_msvc2019_64
msvc_arch: x64 msvc_arch: x64
qt_arch_install: msvc2019_64 qt_arch_install: msvc2019_64
@ -35,18 +31,21 @@ jobs:
fileName: example fileName: example
# 步骤 # 步骤
steps: steps:
- name: '⚙️ Cache Qt'
id: cache-qt
uses: actions/cache@v3
with:
path: ${{ runner.workspace }}\Qt
key: ${{runner.os}}-qtcachedir-${{ matrix.qt_ver }}
# 安装Qt # 安装Qt
- name: Install Qt - name: Install Qt
# 使用外部action。这个action专门用来安装Qt # 使用外部action。这个action专门用来安装Qt
uses: jurplel/install-qt-action@v2 uses: jurplel/install-qt-action@v3
with: with:
# Version of Qt to install
version: ${{ matrix.qt_ver }} version: ${{ matrix.qt_ver }}
# Target platform for build
# target: ${{ matrix.qt_target }}
arch: ${{ matrix.qt_arch }} arch: ${{ matrix.qt_arch }}
cached: 'false' cache: ${{steps.cache-qt.outputs.cache-hit}}
aqtversion: '==2.0.5' modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
# 拉取代码 # 拉取代码
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
@ -88,6 +87,6 @@ jobs:
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

3
.gitignore vendored
View File

@ -32,4 +32,5 @@ target_wrapper.*
CMakeLists.txt.user* CMakeLists.txt.user*
src/build-preset/plugins.qmltypes src/build-preset/plugins.qmltypes
bin bin
.DS_Store

5
CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(FluentUI VERSION 0.1 LANGUAGES CXX)
add_subdirectory(src)
add_subdirectory(example)

21
License Normal file
View 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.

View File

@ -62,12 +62,18 @@
|FluDatePicker|日期选择器|| |FluDatePicker|日期选择器||
|FluMenu|菜单Popup|| |FluMenu|菜单Popup||
|FluNavigationView|响应式导航布局|| |FluNavigationView|响应式导航布局||
|FluScrollbar|滚动条||
|FluToggleButton|开关按钮||
|FluPagination|分页组件||
|FluTableView|表格组件||
|FluMediaPlayer|播放器||
|FluFlipView|FlipView||
# 部分效果预览 # 部分效果预览
## 一个聊天Demo调用了ChatGPT的接口 ## 首页
![](doc/preview/chatgpt.png) ![](doc/preview/home.png)
## 各种Button按钮 ## 各种Button按钮
@ -77,6 +83,10 @@
![](doc/preview/theme.png) ![](doc/preview/theme.png)
## TableView表格组件
![](doc/preview/tableview.png)
## FluTreeView树组件 ## FluTreeView树组件
![](doc/preview/treeview.png) ![](doc/preview/treeview.png)
@ -85,13 +95,5 @@
![](doc/preview/carousel.png) ![](doc/preview/carousel.png)
## InfoBar提示框组件
![](doc/preview/infobar.png)
## 多窗口路由跳转
![](doc/preview/multiwindow.png)
### ⚡ Visitor count ### ⚡ Visitor count
![](https://profile-counter.glitch.me/zhuzichu520-FluentUI/count.svg) ![](https://profile-counter.glitch.me/zhuzichu520-FluentUI/count.svg)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 KiB

BIN
doc/preview/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

BIN
doc/preview/tableview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -1,21 +1,25 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtGraphicalEffects 1.15 import QtMultimedia
import FluentUI 1.0 import FluentUI
Window { Window {
id:app id:app
color: "#00000000" color: "#00000000"
//初始化一个MediaPlayer解决macos切换到T_MediaPalyer页面崩溃问题
MediaPlayer{}
Component.onCompleted: { Component.onCompleted: {
FluApp.init(app,properties) FluApp.init(app,properties)
FluTheme.isDark = false FluTheme.frameless = ("windows" === Qt.platform.os)
FluTheme.dark = false
FluApp.routes = { FluApp.routes = {
"/":"qrc:/page/MainPage.qml", "/":"qrc:/page/MainPage.qml",
"/about":"qrc:/page/AboutPage.qml", "/about":"qrc:/page/AboutPage.qml",
"/login":"qrc:/page/LoginPage.qml", "/login":"qrc:/page/LoginPage.qml",
"/chat":"qrc:/page/ChatPage.qml", "/chat":"qrc:/page/ChatPage.qml",
"/media":"qrc:/page/MediaPage.qml",
} }
FluApp.initialRoute = "/" FluApp.initialRoute = "/"
FluApp.run() FluApp.run()

85
example/CMakeLists.txt Normal file
View File

@ -0,0 +1,85 @@
cmake_minimum_required(VERSION 3.16)
project(example)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_STANDARD 17)
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(platform 64)
else()
set(platform 32)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../bin/debug)
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../bin/release)
endif()
find_package(Qt6 COMPONENTS Core Quick QuickControls2 Concurrent Network Multimedia REQUIRED)
set(SOURCES
ChatController.cpp
main.cpp
)
set(HEADERS
ChatController.h
)
set(RESOURCES
qml.qrc
)
set(RC_ICONS
favicon.ico
)
qt_add_resources(QT_RESOURCES ${RESOURCES})
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${QT_RESOURCES} ${RC_ICONS})
if(WIN32)
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
set(DLLPATH ${CMAKE_CURRENT_SOURCE_DIR}/../third/msvc/*.dll)
else()
set(DLLPATH ${CMAKE_CURRENT_SOURCE_DIR}/../third/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()
target_compile_definitions(${PROJECT_NAME} PRIVATE
QT_DEPRECATED_WARNINGS
QT_NO_WARNING_OUTPUT
)
target_link_libraries(${PROJECT_NAME} PRIVATE
Qt6::Core
Qt6::Quick
Qt6::QuickControls2
Qt6::Concurrent
Qt6::Network
Qt6::Multimedia
)
if(WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE UNICODE WIN32 _WINDOWS)
target_link_libraries(${PROJECT_NAME} PRIVATE dwmapi user32)
endif()
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST Info.plist
)
endif()

View File

@ -2,10 +2,28 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
<true/> <true/>
</dict> </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> </dict>
</plist> </plist>

View File

@ -1,13 +1,17 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import FluentUI 1.0 import FluentUI
FluContentPage { FluContentPage {
title:"Awesome" title:"Awesome"
leftPadding:10
rightPadding:10
bottomPadding:20
FluTextBox{ FluTextBox{
id:text_box id:text_box
placeholderText: "请输入关键字" placeholderText: "请输入关键字"
@ -63,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
} }
} }

View File

@ -1,17 +1,21 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"Badge" title:"Badge"
leftPadding:10
rightPadding:10
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
@ -97,5 +101,19 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
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)
}
}'
}
} }

View File

@ -1,13 +1,17 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import FluentUI 1.0 import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
title:"Buttons" title:"Buttons"
spacing: 20 leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
FluText{ FluText{
Layout.topMargin: 20 Layout.topMargin: 20
@ -15,9 +19,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
@ -44,11 +49,21 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
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
@ -75,10 +90,20 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
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{
@ -106,13 +131,63 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
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
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
@ -139,12 +214,21 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
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"
@ -180,12 +264,32 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
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{
@ -221,13 +325,23 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
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"
@ -236,8 +350,6 @@ FluScrollablePage{
left: parent.left left: parent.left
} }
} }
Row{ Row{
spacing: 5 spacing: 5
anchors{ anchors{
@ -251,6 +363,10 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluCheckBox{
text:"Check Box"
}'
}
} }

View File

@ -1,24 +1,35 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import FluentUI 1.0 import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
title:"CalendarPicker" title:"CalendarPicker"
leftPadding:10
rightPadding:10
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
code:'FluCalendarView{
}'
}
FluArea{ FluArea{
width: parent.width Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 80 height: 80
paddings: 10 paddings: 10
@ -31,5 +42,11 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluCalendarPicker{
}'
}
} }

View File

@ -1,16 +1,20 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"Carousel" title:"Carousel"
leftPadding:10
rightPadding:10
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
@ -33,4 +37,14 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluCarousel{
width: 400
height: 300
Component.onCompleted: {
setData([{url:"qrc:/res/image/banner_1.jpg"},{url:"qrc:/res/image/banner_2.jpg"},{url:"qrc:/res/image/banner_3.jpg"}])
}
}'
}
} }

38
example/T_CheckBox.qml Normal file
View File

@ -0,0 +1,38 @@
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
code:'FluCheckBox{
text:"Text"
}'
}
}

View File

@ -1,16 +1,20 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"ColorPicker" title:"ColorPicker"
leftPadding:10
rightPadding:10
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
@ -35,9 +39,15 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluColorView{
}'
}
FluArea{ FluArea{
width: parent.width Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 60 height: 60
paddings: 10 paddings: 10
@ -52,6 +62,12 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluColorPicker{
}'
}
} }

View File

@ -1,51 +1,52 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import FluentUI 1.0 import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
title:"TimePicker" title:"TimePicker"
leftPadding:10
rightPadding:10
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
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"
} }
@ -54,8 +55,13 @@ FluScrollablePage{
showYear:false showYear:false
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluDatePicker{
showYear:false
}'
}
} }

View File

@ -1,12 +1,50 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"Dialog" 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 Dialog"
onClicked: {
dialog.open()
}
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluContentDialog{
id:dialog
title:"友情提示"
message:"确定要退出程序么?"
negativeText:"取消"
onNegativeClicked:{
showSuccess("点击取消按钮")
}
positiveText:"确定"
onPositiveClicked:{
showSuccess("点击确定按钮")
}
}
dialog.open()
'
}
FluContentDialog{ FluContentDialog{
id:dialog id:dialog
@ -22,11 +60,5 @@ FluScrollablePage{
} }
} }
FluButton{
Layout.topMargin: 20
text:"Show Dialog"
onClicked: {
dialog.open()
}
}
} }

View File

@ -1,60 +1,109 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"Expander"
FluExpander{ title:"Expander"
headerText:"打开一个单选框" leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
FluArea{
Layout.fillWidth: true
height: layout_column.height+40
paddings: 10
Layout.topMargin: 20 Layout.topMargin: 20
Item{ Column{
anchors.fill: parent id:layout_column
ColumnLayout{ spacing: 15
spacing: 8 anchors{
anchors{ verticalCenter: parent.verticalCenter
top: parent.top left:parent.left
left: parent.left }
topMargin: 15
leftMargin: 15 FluExpander{
} headerText:"打开一个单选框"
Repeater{ Layout.topMargin: 20
id:repeater Item{
property int selecIndex : 0 anchors.fill: parent
model: 3 ColumnLayout{
delegate: FluRadioButton{ spacing: 8
selected : repeater.selecIndex===index anchors{
text:"Radio Button_"+index top: parent.top
onClicked:{ left: parent.left
repeater.selecIndex = index 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:"先帝创业未半而中道崩殂,今天下三分,益州疲弊,此诚危急存亡之秋也。然侍卫之臣不懈于内,忠志之士忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气,不宜妄自菲薄,引喻失义,以塞忠谏之路也。宫中府中,俱为一体;陟罚臧否,不宜异同。若有作奸犯科及为忠善者,宜付有司论其刑赏,以昭陛下平明之理,不宜偏私,使内外异法也。侍中、侍郎郭攸之、费祎、董允等,此皆良实,志虑忠纯,是以先帝简拔以遗陛下。愚以为宫中之事,事无大小,悉以咨之,然后施行,必能裨补阙漏,有所广益。将军向宠,性行淑均,晓畅军事,试用于昔日,先帝称之曰能,是以众议举宠为督。愚以为营中之事,悉以咨之,必能使行阵和睦,优劣得所。亲贤臣,远小人,此先汉所以兴隆也;亲小人,远贤臣,此后汉所以倾颓也。先帝在时,每与臣论此事,未尝不叹息痛恨于桓、灵也。侍中、尚书、长史、参军,此悉贞良死节之臣,愿陛下亲之信之,则汉室之隆,可计日而待也。臣本布衣,躬耕于南阳,苟全性命于乱世,不求闻达于诸侯。先帝不以臣卑鄙,猥自枉屈,三顾臣于草庐之中,咨臣以当世之事,由是感激,遂许先帝以驱驰。后值倾覆,受任于败军之际,奉命于危难之间,尔来二十有一年矣。先帝知臣谨慎,故临崩寄臣以大事也。受命以来,夙夜忧叹,恐托付不效,以伤先帝之明;故五月渡泸,深入不毛。今南方已定,兵甲已足,当奖率三军,北定中原,庶竭驽钝,攘除奸凶,兴复汉室,还于旧都。此臣所以报先帝而忠陛下之职分也。至于斟酌损益,进尽忠言,则攸之、祎、允之任也。愿陛下托臣以讨贼兴复之效,不效,则治臣之罪,以告先帝之灵。若无兴德之言,则责攸之、祎、允等之慢,以彰其咎;陛下亦宜自谋,以咨诹善道,察纳雅言,深追先帝遗诏。臣不胜受恩感激。今当远离,临表涕零,不知所言。"
}
}
}
}
} }
} }
FluExpander{ CodeExpander{
Layout.topMargin: 20 Layout.fillWidth: true
headerText:"打开一个滑动文本框" code:'FluExpander{
Item{ headerText:"打开一个单选框"
anchors.fill: parent Item{
ScrollView{ anchors.fill: parent
id:scrollview Flickable{
width: parent.width width: parent.width
height: parent.height height: parent.height
contentWidth: parent.width contentWidth: width
FluText{ contentHeight: text_info.height
id:test ScrollBar.vertical: FluScrollBar {}
width: scrollview.width FluText{
wrapMode: Text.WrapAnywhere id:text_info
padding: 14 width: scrollview.width
text:"先帝创业未半而中道崩殂,今天下三分,益州疲弊,此诚危急存亡之秋也。然侍卫之臣不懈于内,忠志之士忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气,不宜妄自菲薄,引喻失义,以塞忠谏之路也。宫中府中,俱为一体;陟罚臧否,不宜异同。若有作奸犯科及为忠善者,宜付有司论其刑赏,以昭陛下平明之理,不宜偏私,使内外异法也。侍中、侍郎郭攸之、费祎、董允等,此皆良实,志虑忠纯,是以先帝简拔以遗陛下。愚以为宫中之事,事无大小,悉以咨之,然后施行,必能裨补阙漏,有所广益。将军向宠,性行淑均,晓畅军事,试用于昔日,先帝称之曰能,是以众议举宠为督。愚以为营中之事,悉以咨之,必能使行阵和睦,优劣得所。亲贤臣,远小人,此先汉所以兴隆也;亲小人,远贤臣,此后汉所以倾颓也。先帝在时,每与臣论此事,未尝不叹息痛恨于桓、灵也。侍中、尚书、长史、参军,此悉贞良死节之臣,愿陛下亲之信之,则汉室之隆,可计日而待也。臣本布衣,躬耕于南阳,苟全性命于乱世,不求闻达于诸侯。先帝不以臣卑鄙,猥自枉屈,三顾臣于草庐之中,咨臣以当世之事,由是感激,遂许先帝以驱驰。后值倾覆,受任于败军之际,奉命于危难之间,尔来二十有一年矣。先帝知臣谨慎,故临崩寄臣以大事也。受命以来,夙夜忧叹,恐托付不效,以伤先帝之明;故五月渡泸,深入不毛。今南方已定,兵甲已足,当奖率三军,北定中原,庶竭驽钝,攘除奸凶,兴复汉室,还于旧都。此臣所以报先帝而忠陛下之职分也。至于斟酌损益,进尽忠言,则攸之、祎、允之任也。愿陛下托臣以讨贼兴复之效,不效,则治臣之罪,以告先帝之灵。若无兴德之言,则责攸之、祎、允等之慢,以彰其咎;陛下亦宜自谋,以咨诹善道,察纳雅言,深追先帝遗诏。臣不胜受恩感激。今当远离,临表涕零,不知所言。" wrapMode: Text.WrapAnywhere
} padding: 14
text:"先帝创业未半而中道崩殂,今天下三分......""
} }
} }
} }
}'
}
} }

120
example/T_FlipView.qml Normal file
View File

@ -0,0 +1,120 @@
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:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_2.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_3.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
}
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluFlipView{
Image{
source: "qrc:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/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:/res/image/banner_1.jpg"
asynchronous: true
sourceSize: Qt.size(400,300)
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_2.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_3.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
}
}
}
CodeExpander{
Layout.fillWidth: true
code:'FluFlipView{
vertical:true
Image{
source: "qrc:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
Image{
source: "qrc:/res/image/banner_1.jpg"
asynchronous: true
fillMode:Image.PreserveAspectCrop
}
}
'
}
}

271
example/T_Home.qml Normal file
View File

@ -0,0 +1,271 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import "qrc:///global/"
import FluentUI
FluScrollablePage{
leftPadding:10
rightPadding:0
bottomPadding:20
ListModel{
id:model_header
ListElement{
icon:"qrc:/res/image/ic_home_github.png"
title:"FluentUI GitHub"
desc:"The latest FluentUI controls and styles for your applications."
url:"https://github.com/zhuzichu520/FluentUI"
}
}
Item{
Layout.fillWidth: true
height: 320
Image {
fillMode:Image.PreserveAspectCrop
anchors.fill: parent
verticalAlignment: Qt.AlignTop
source: "qrc:/res/image/bg_home_header.png"
}
Rectangle{
anchors.fill: parent
gradient: Gradient{
GradientStop { position: 0.8; color: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(1,1,1,0) }
GradientStop { position: 1.0; color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1) }
}
}
FluText{
text:"FluentUI Gallery"
fontStyle: FluText.TitleLarge
anchors{
top: parent.top
left: parent.left
topMargin: 20
leftMargin: 20
}
}
ListView{
anchors{
left: parent.left
right: parent.right
bottom: parent.bottom
}
orientation: ListView.Horizontal
height: 240
model: model_header
header: Item{height: 10;width: 10}
footer: Item{height: 10;width: 10}
ScrollBar.horizontal: FluScrollBar{
id: scrollbar_header
}
clip: false
delegate:Item{
width: 220
height: 240
FluArea{
radius: 8
width: 200
height: 220
anchors.centerIn: parent
Rectangle{
anchors.fill: parent
radius: 8
color:{
if(FluTheme.dark){
if(item_mouse.containsMouse){
return Qt.rgba(1,1,1,0.03)
}
return Qt.rgba(0,0,0,0)
}else{
if(item_mouse.containsMouse){
return Qt.rgba(0,0,0,0.03)
}
return Qt.rgba(0,0,0,0)
}
}
}
ColumnLayout{
Image {
Layout.topMargin: 20
Layout.leftMargin: 20
Layout.preferredWidth: 50
Layout.preferredHeight: 50
source: model.icon
}
FluText{
text: model.title
fontStyle: FluText.Body
Layout.topMargin: 20
Layout.leftMargin: 20
}
FluText{
text: model.desc
Layout.topMargin: 5
Layout.preferredWidth: 160
Layout.leftMargin: 20
color: FluColors.Grey120
font.pixelSize: 12
wrapMode: Text.WrapAnywhere
}
}
FluIcon{
iconSource: FluentIcons.OpenInNewWindow
iconSize: 15
anchors{
bottom: parent.bottom
right: parent.right
rightMargin: 10
bottomMargin: 10
}
}
MouseArea{
id:item_mouse
anchors.fill: parent
hoverEnabled: true
onWheel: (wheel)=>{
if (wheel.angleDelta.y > 0) scrollbar_header.decrease()
else scrollbar_header.increase()
}
onClicked: {
Qt.openUrlExternally(model.url)
}
}
}
}
}
}
Component{
id:com_item
Item{
width: 320
height: 120
FluArea{
radius: 8
width: 300
height: 100
anchors.centerIn: parent
Rectangle{
anchors.fill: parent
radius: 8
color:{
if(FluTheme.dark){
if(item_mouse.containsMouse){
return Qt.rgba(1,1,1,0.03)
}
return Qt.rgba(0,0,0,0)
}else{
if(item_mouse.containsMouse){
return Qt.rgba(0,0,0,0.03)
}
return Qt.rgba(0,0,0,0)
}
}
}
Image{
id:item_icon
height: 40
width: 40
source: modelData.image
anchors{
left: parent.left
leftMargin: 20
verticalCenter: parent.verticalCenter
}
}
FluText{
id:item_title
text:modelData.title
fontStyle: FluText.BodyStrong
anchors{
left: item_icon.right
leftMargin: 20
top: item_icon.top
}
}
FluText{
id:item_desc
text:modelData.desc
color:FluColors.Grey120
wrapMode: Text.WrapAnywhere
elide: Text.ElideRight
fontStyle: FluText.Caption
maximumLineCount: 2
anchors{
left: item_title.left
right: parent.right
rightMargin: 20
top: item_title.bottom
topMargin: 5
}
}
Rectangle{
height: 12
width: 12
radius: 6
color: FluTheme.primaryColor.dark
anchors{
right: parent.right
top: parent.top
rightMargin: 14
topMargin: 14
}
}
MouseArea{
id:item_mouse
anchors.fill: parent
hoverEnabled: true
onClicked: {
ItemsOriginal.startPageByItem(modelData)
}
}
}
}
}
FluText{
text: "Recently added samples"
fontStyle: FluText.Title
Layout.topMargin: 20
Layout.leftMargin: 20
}
GridView{
Layout.fillWidth: true
implicitHeight: contentHeight
cellHeight: 120
cellWidth: 320
model:ItemsOriginal.getRecentlyAddedData()
interactive: false
delegate: com_item
}
FluText{
text: "Recently updated samples"
fontStyle: FluText.Title
Layout.topMargin: 20
Layout.leftMargin: 20
}
GridView{
Layout.fillWidth: true
implicitHeight: contentHeight
cellHeight: 120
cellWidth: 320
interactive: false
model: ItemsOriginal.getRecentlyUpdatedData()
delegate: com_item
}
}

View File

@ -1,39 +1,63 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"InfoBar"
FluButton{ title:"InfoBar"
text:"Info" leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
onClicked: { height: 200
showInfo("这是一个Info样式的InfoBar") 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")
}
}
} }
} }
FluButton{ CodeExpander{
text:"Warning" Layout.fillWidth: true
Layout.topMargin: 20 code:'showInfo("这是一个Info样式的InfoBar")
onClicked: {
showWarning("这是一个Warning样式的InfoBar") showWarning("这是一个Warning样式的InfoBar")
}
} showError("这是一个Error样式的InfoBar")
FluButton{
text:"Error" showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")'
Layout.topMargin: 20
onClicked: {
showError("这是一个Error样式的InfoBar")
}
}
FluButton{
text:"Success"
Layout.topMargin: 20
onClicked: {
showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")
}
} }
} }

View File

@ -1,13 +1,17 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"MediaPlayer" title:"MediaPlayer"
leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
onVisibleChanged: { onVisibleChanged: {
if(visible){ if(visible){
@ -16,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
@ -27,17 +30,36 @@ FluScrollablePage{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left:parent.left left:parent.left
} }
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
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"})
}
} }
} }
} }

View File

@ -1,39 +1,76 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"Menu" title:"Menu"
leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
FluButton{ FluArea{
text:"左击菜单" Layout.fillWidth: true
height: 100
paddings: 10
Layout.topMargin: 20 Layout.topMargin: 20
Layout.leftMargin: 15 Column{
onClicked:{ id:layout_column
menu.popup() 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{
FluButton{ Layout.fillWidth: true
text:"右击菜单" code:'FluMenu{
Layout.topMargin: 20 id:menu
Layout.leftMargin: 15 FluMenuItem:{
text:"删除"
onClicked: { onClicked: {
showSuccess("请按鼠标右击") showError("删除")
} }
MouseArea{ }
anchors.fill: parent FluMenuItem:{
acceptedButtons: Qt.RightButton text:"修改"
onClicked: { onClicked: {
menu.popup() showInfo"修改")
}
} }
} }
}
menu.popup()
'
}
FluMenu{ FluMenu{
id:menu id:menu
@ -46,7 +83,7 @@ FluScrollablePage{
FluMenuItem{ FluMenuItem{
text:"修改" text:"修改"
onClicked: { onClicked: {
showError("修改") showInfo("修改")
} }
} }
} }

View File

@ -1,17 +1,21 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import FluentUI 1.0 import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
title:"MultiWindow"
property string password: "" property string password: ""
property var loginPageRegister: registerForPageResult("/login") property var loginPageRegister: registerForPageResult("/login")
title:"MultiWindow"
leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
Connections{ Connections{
target: loginPageRegister target: loginPageRegister
function onResult(data) function onResult(data)
@ -21,11 +25,10 @@ FluScrollablePage{
} }
FluArea{ FluArea{
width: parent.width Layout.fillWidth: true
height: 100 height: 100
paddings: 10 paddings: 10
Layout.topMargin: 20 Layout.topMargin: 20
Column{ Column{
spacing: 15 spacing: 15
anchors{ anchors{
@ -43,9 +46,19 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluButton{
text:"点击跳转"
onClicked: {
FluApp.navigate("/about")
}
}
'
}
FluArea{ FluArea{
width: parent.width Layout.fillWidth: true
height: 130 height: 130
paddings: 10 paddings: 10
Layout.topMargin: 20 Layout.topMargin: 20
@ -65,13 +78,30 @@ FluScrollablePage{
loginPageRegister.launch({username:"zhuzichu"}) loginPageRegister.launch({username:"zhuzichu"})
} }
} }
FluText{ FluText{
text:"登录窗口返回过来的密码->"+password text:"登录窗口返回过来的密码->"+password
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'property var loginPageRegister: registerForPageResult("/login")
Connections{
target: loginPageRegister
function onResult(data)
{
password = data.password
}
}
FluButton{
text:"点击跳转"
onClicked: {
loginPageRegister.launch({username:"zhuzichu"})
}
}
'
}
} }

82
example/T_Pivot.qml Normal file
View File

@ -0,0 +1,82 @@
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
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
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."
}
}
}
'
}
}

View File

@ -1,36 +1,69 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"Progress"
FluProgressBar{ title:"Progress"
leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
} height: 260
FluProgressRing{ paddings: 10
Layout.topMargin: 10 ColumnLayout{
} spacing: 20
FluProgressBar{ anchors{
id:progress_bar verticalCenter: parent.verticalCenter
Layout.topMargin: 20 left: parent.left
indeterminate: false }
} FluProgressBar{
FluProgressRing{ }
id:progress_ring FluProgressRing{
Layout.topMargin: 10 }
indeterminate: false FluProgressBar{
} id:progress_bar
FluSlider{ indeterminate: false
Layout.topMargin: 30 }
value:50 FluProgressRing{
onValueChanged:{ id:progress_ring
progress_bar.progress = value/100 indeterminate: false
progress_ring.progress = value/100 }
FluSlider{
value:50
onValueChanged:{
progress_bar.progress = value/100
progress_ring.progress = value/100
}
}
} }
Layout.bottomMargin: 30
} }
CodeExpander{
Layout.fillWidth: true
code:'FluProgressBar{
}
FluProgressRing{
}
FluProgressBar{
indeterminate: false
}
FluProgressRing{
indeterminate: false
}'
}
} }

View File

@ -1,114 +1,151 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Window 2.15 import QtQuick.Window
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"Rectangle"
RowLayout{ title:"Rectangle"
leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
FluRectangle{ height: 480
width: 50 paddings: 10
height: 50
color:"#0078d4" Column{
radius:[0,0,0,0] spacing: 15
} anchors{
FluRectangle{ verticalCenter: parent.verticalCenter
width: 50 left: parent.left
height: 50 }
color:"#744da9"
radius:[15,15,15,15] RowLayout{
} Layout.topMargin: 20
FluRectangle{ FluRectangle{
width: 50 width: 50
height: 50 height: 50
color:"#ffeb3b" color:"#0078d4"
radius:[15,0,0,0] radius:[0,0,0,0]
} }
FluRectangle{ FluRectangle{
width: 50 width: 50
height: 50 height: 50
color:"#f7630c" color:"#744da9"
radius:[0,15,0,0] radius:[15,15,15,15]
} }
FluRectangle{ FluRectangle{
width: 50 width: 50
height: 50 height: 50
color:"#e71123" color:"#ffeb3b"
radius:[0,0,15,0] radius:[15,0,0,0]
} }
FluRectangle{ FluRectangle{
width: 50 width: 50
height: 50 height: 50
color:"#b4009e" color:"#f7630c"
radius:[0,0,0,15] 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
}
} }
} }
FluText{ CodeExpander{
text:"配合图片使用" Layout.fillWidth: true
fontStyle: FluText.Subtitle code:'FluRectangle{
Layout.topMargin: 20 radius: [25,25,25,25]
width: 50
height: 50
Image{
asynchronous: true
anchors.fill: parent
source: "qrc:/res/svg/avatar_4.svg"
sourceSize: Qt.size(width,height)
} }
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
} }
} }

View File

@ -1,23 +1,56 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtGraphicalEffects 1.15 import "./component"
import FluentUI 1.0 import FluentUI
FluScrollablePage{ FluScrollablePage{
title:"Slider" title:"Slider"
leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
FluSlider{ FluArea{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.topMargin: 20 Layout.topMargin: 20
Layout.leftMargin: 15 FluSlider{
value: 50 value: 50
anchors.verticalCenter: parent.verticalCenter
}
} }
FluSlider{ CodeExpander{
orientation:FluSlider.Vertical Layout.fillWidth: true
code:'FluSlider{
value:50
}'
}
FluArea{
Layout.fillWidth: true
height: 200
paddings: 10
Layout.topMargin: 20 Layout.topMargin: 20
Layout.leftMargin: 15 FluSlider{
value: 50 value: 50
vertical:true
anchors.left: parent.left
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter
}
} }
CodeExpander{
Layout.fillWidth: true
code:'FluSlider{
vertical:true
value:50
}'
}
} }

91
example/T_StatusView.qml Normal file
View File

@ -0,0 +1,91 @@
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
code:'FluStatusView{
anchors.fill: parent
statusMode: FluStatusView.Loading
Rectangle{
anchors.fill: parent
color:FluTheme.primaryColor.dark
}
}'
}
}

View File

@ -1,12 +1,19 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import FluentUI 1.0 import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
title:"TabView" title:"TabView"
leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
property var colors : [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
Component{ Component{
id:com_page id:com_page
@ -16,26 +23,115 @@ FluScrollablePage{
} }
} }
function newTab(){
tab_view.appendTab("qrc:/res/image/favicon.ico","Document "+tab_view.count(),com_page,colors[Math.floor(Math.random() * 8)].dark)
}
Component.onCompleted: { Component.onCompleted: {
var colors = [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green] newTab()
for(var i =0;i<colors.length;i++){ newTab()
tab_view.appendTab("","Document "+i,com_page,colors[i].dark) newTab()
}
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
height: 50
paddings: 10
RowLayout{
spacing: 14
FluDropDownButton{
id:btn_tab_width_behavior
Layout.preferredWidth: 140
text:"Equal"
items:[
FluMenuItem{
text:"Equal"
onClicked: {
btn_tab_width_behavior.text = text
tab_view.tabWidthBehavior = FluTabView.Equal
}
},
FluMenuItem{
text:"SizeToContent"
onClicked: {
btn_tab_width_behavior.text = text
tab_view.tabWidthBehavior = FluTabView.SizeToContent
}
},
FluMenuItem{
text:"Compact"
onClicked: {
btn_tab_width_behavior.text = text
tab_view.tabWidthBehavior = FluTabView.Compact
}
}
]
}
FluDropDownButton{
id:btn_close_button_visibility
text:"Always"
Layout.preferredWidth: 120
items:[
FluMenuItem{
text:"Nerver"
onClicked: {
btn_close_button_visibility.text = text
tab_view.closeButtonVisibility = FluTabView.Nerver
}
},
FluMenuItem{
text:"Always"
onClicked: {
btn_close_button_visibility.text = text
tab_view.closeButtonVisibility = FluTabView.Always
}
},
FluMenuItem{
text:"OnHover"
onClicked: {
btn_close_button_visibility.text = text
tab_view.closeButtonVisibility = FluTabView.OnHover
}
}
]
}
} }
} }
FluArea{ FluArea{
width: parent.width Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 15
height: 400 height: 400
paddings: 10 paddings: 10
FluTabView{ FluTabView{
id:tab_view id:tab_view
onNewPressed:{
newTab()
}
} }
}
CodeExpander{
Layout.fillWidth: true
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:/res/image/favicon.ico","Document 1",com_page,argument)
}
}
'
} }
} }

160
example/T_TableView.qml Normal file
View File

@ -0,0 +1,160 @@
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:3
rightPadding:3
onClicked:{
console.debug(dataModel.index)
showSuccess(JSON.stringify(dataObject))
}
}
FluFilledButton{
text:"删除"
topPadding:3
bottomPadding:3
leftPadding:3
rightPadding:3
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
width:parent.width
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
}
}'
}
}

View File

@ -1,39 +1,132 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"TextBox" title:"TextBox"
leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
FluTextBox{ FluArea{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20 Layout.topMargin: 20
placeholderText: "单行输入框"
Layout.preferredWidth: 300 FluTextBox{
disabled:toggle_switch.selected 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"
}
}
} }
FluMultiLineTextBox{ CodeExpander{
Layout.topMargin: 20 Layout.fillWidth: true
Layout.preferredWidth: 300 code:'FluTextBox{
placeholderText: "多行输入框" placeholderText:"单行输入框"
disabled:toggle_switch.selected }'
}
FluAutoSuggestBox{
Layout.topMargin: 20
values:generateRandomNames(100)
placeholderText: "AutoSuggestBox"
Layout.preferredWidth: 300
disabled:toggle_switch.selected
} }
FluToggleSwitch{
id:toggle_switch FluArea{
text:"Disabled" Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluMultilineTextBox{
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
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
code:'FluAutoSuggestBox{
placeholderText:"AutoSuggestBox"
}'
}
function generateRandomNames(numNames) { function generateRandomNames(numNames) {
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
@ -49,7 +142,7 @@ FluScrollablePage{
} }
for (let i = 0; i < numNames; i++) { for (let i = 0; i < numNames; i++) {
const name = generateRandomName(); const name = generateRandomName();
names.push(name); names.push({title:name});
} }
return names; return names;
} }

View File

@ -1,69 +1,88 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"Theme" title:"Theme"
leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
RowLayout{ FluArea{
Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
Repeater{ height: 210
model: [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green] paddings: 10
delegate: FluRectangle{ ColumnLayout{
width: 42 spacing:0
height: 42 anchors{
radius: [4,4,4,4] left: parent.left
color: mouse_item.containsMouse ? Qt.lighter(modelData.normal,1.1) : modelData.normal }
FluIcon { RowLayout{
anchors.centerIn: parent Layout.topMargin: 10
iconSource: FluentIcons.AcceptMedium Repeater{
iconSize: 15 model: [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
visible: modelData === FluTheme.primaryColor delegate: FluRectangle{
color: FluTheme.isDark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1) width: 42
} height: 42
MouseArea{ radius: [4,4,4,4]
id:mouse_item color: mouse_item.containsMouse ? Qt.lighter(modelData.normal,1.1) : modelData.normal
anchors.fill: parent FluIcon {
hoverEnabled: true anchors.centerIn: parent
onClicked: { iconSource: FluentIcons.AcceptMedium
FluTheme.primaryColor = modelData 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(){
FluTheme.dark = !FluTheme.dark
}
}
FluText{
text:"native文本渲染"
Layout.topMargin: 20
}
FluToggleSwitch{
Layout.topMargin: 5
selected: FluTheme.nativeText
clickFunc:function(){
FluTheme.nativeText = !FluTheme.nativeText
}
}
} }
} }
FluText{ CodeExpander{
text:"夜间模式" Layout.fillWidth: true
Layout.topMargin: 20 code:'FluTheme.primaryColor = FluColors.Orange
}
FluToggleSwitch{ FluTheme.dark = true
selected: FluTheme.isDark
clickFunc:function(){ FluTheme.nativeText = true
FluTheme.isDark = !FluTheme.isDark '
}
}
FluText{
text:"无边框"
Layout.topMargin: 20
}
FluToggleSwitch{
selected: FluTheme.isFrameless
clickFunc:function(){
FluTheme.isFrameless = !FluTheme.isFrameless
}
}
FluText{
text:"native文本渲染"
Layout.topMargin: 20
}
FluToggleSwitch{
selected: FluTheme.isNativeText
clickFunc:function(){
FluTheme.isNativeText = !FluTheme.isNativeText
}
} }
} }

View File

@ -1,16 +1,20 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import FluentUI 1.0 import FluentUI
import "./component"
FluScrollablePage{ FluScrollablePage{
title:"TimePicker" title:"TimePicker"
leftPadding:10
rightPadding:10
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
@ -31,10 +35,15 @@ FluScrollablePage{
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluTimePicker{
}'
}
FluArea{ FluArea{
width: parent.width Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 80 height: 80
paddings: 10 paddings: 10
@ -47,15 +56,20 @@ FluScrollablePage{
} }
FluText{ FluText{
text:"hourFormat=FluTimePicker.HH" text:"hourFormat=FluTimePicker.H"
} }
FluTimePicker{ FluTimePicker{
hourFormat:FluTimePicker.HH hourFormat:FluTimePicker.HH
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluTimePicker{
hourFormat:FluTimePicker.HH
}'
}
} }

View File

@ -1,19 +1,39 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"ToggleSwitch" title:"ToggleSwitch"
leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
FluToggleSwitch{ FluArea{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20 Layout.topMargin: 20
Row{
spacing: 30
anchors.verticalCenter: parent.verticalCenter
FluToggleSwitch{
}
FluToggleSwitch{
text:"Text"
}
}
} }
FluToggleSwitch{ CodeExpander{
Layout.topMargin: 20 Layout.fillWidth: true
text:"Disabled" code:'FluToggleSwitch{
text:"Text"
}'
} }
} }

View File

@ -1,22 +1,25 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtGraphicalEffects 1.15 import FluentUI
import FluentUI 1.0 import "./component"
FluScrollablePage{ FluScrollablePage{
title:"Tooltip" title:"Tooltip"
leftPadding:10
rightPadding:10
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
@ -40,9 +43,21 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
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
@ -70,6 +85,22 @@ FluScrollablePage{
} }
} }
} }
CodeExpander{
Layout.fillWidth: true
code:'FluButton{
id:button_1
text:"删除"
FluTooltip{
visible: button_1.hovered
text:button_1.text
delay: 1000
}
onClicked:{
showSuccess("点击一个Button")
}
}
'
}
} }

View File

@ -1,12 +1,17 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import FluentUI 1.0 import FluentUI
import "./component"
FluContentPage { FluScrollablePage {
title:"TreeView" title:"TreeView"
leftPadding:10
rightPadding:10
bottomPadding:20
spacing: 0
function randomName() { function randomName() {
var names = ["张三", "李四", "王五", "赵六", "钱七", "孙八", "周九", "吴十"] var names = ["张三", "李四", "王五", "赵六", "钱七", "孙八", "周九", "吴十"]
@ -47,95 +52,110 @@ FluContentPage {
return [tree_view.createItem(randomCompany(), true, subtrees)].concat(createOrg(numLevels - 1, numSubtrees, numEmployees)) return [tree_view.createItem(randomCompany(), true, subtrees)].concat(createOrg(numLevels - 1, numSubtrees, numEmployees))
} }
FluArea{
FluTreeView{ id:layout_actions
id:tree_view Layout.fillWidth: true
width:240 Layout.topMargin: 20
anchors{ height: 50
top:parent.top paddings: 10
left:parent.left RowLayout{
bottom:parent.bottom spacing: 14
} FluDropDownButton{
onItemClicked: id:btn_selection_model
(model)=>{ Layout.preferredWidth: 140
showSuccess(model.text) 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(","))
}
}
} }
Component.onCompleted: {
var org = createOrg(3, 3, 3)
updateData(org)
} }
}
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{
ColumnLayout{ Layout.fillWidth: true
anchors{ code:'FluTreeView{
left: tree_view.right id:tree_view
right: parent.right width:240
top: parent.top height:600
} Component.onCompleted: {
var datas = []
FluText{ datas.push(createItem("Node1",false))
text:{ datas.push(createItem("Node2",false))
if(tree_view.selectionMode === FluTreeView.None){ datas.push(createItem("Node2",true,[createItem("Node2-1",false),createItem("Node2-2",false)]))
return "selectionMode->FluTreeView.None" updateData(datas)
}
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(","))
}
}
}
} }
} }
'
}
}

View File

@ -1,26 +1,33 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Controls 2.15 import QtQuick.Controls
import FluentUI 1.0 import FluentUI
FluContentPage { FluContentPage {
title: "Typography" title: "Typography"
property int textSize: 13 property int textSize: FluTheme.textSize
leftPadding:10
rightPadding:10
bottomPadding:20
Component.onCompleted: { Component.onCompleted: {
slider.seek(31) 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
@ -41,13 +48,7 @@ FluContentPage {
text:"Subtitle" text:"Subtitle"
padding: 0 padding: 0
pixelSize: textSize pixelSize: textSize
fontStyle: FluText.Subtitle fontStyle: FluText.SubTitle
}
FluText{
text:"Body Large"
padding: 0
pixelSize: textSize
fontStyle: FluText.BodyLarge
} }
FluText{ FluText{
text:"Body Strong" text:"Body Strong"
@ -68,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
orientation:FluSlider.Vertical
anchors{
right: parent.right
rightMargin: 45
top: parent.top
topMargin: 30
}
onValueChanged:{
textSize = value/100*16+8
}
}
} }

View File

@ -0,0 +1,130 @@
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",
"FluControl",
"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"
];
code = code.replace(/\n/g, "<br>");
code = code.replace(/ /g, "&nbsp;");
return code.replace(RegExp("\\b(" + qmlKeywords.join("|") + ")\\b", "g"), "<span style='color: #c23a80'>$1</span>");
}
}

View File

@ -1,5 +1,5 @@
QT += quick concurrent network multimedia QT += quick quickcontrols2 concurrent network multimedia
CONFIG += c++11 CONFIG += c++17
DEFINES += QT_DEPRECATED_WARNINGS QT_NO_WARNING_OUTPUT DEFINES += QT_DEPRECATED_WARNINGS QT_NO_WARNING_OUTPUT
HEADERS += \ HEADERS += \
@ -23,21 +23,15 @@ CONFIG(debug,debug|release) {
} }
win32 { win32 {
contains(QT_ARCH, i386) {
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/Win_x86/*.dll) $$DESTDIR contains(QMAKE_CC, cl) {
contains(QMAKE_CC, cl) { COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/msvc/*.dll) $$DESTDIR
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, \\) QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, $$QMAKE_DIR_SEP)
} else {
QMAKE_PRE_LINK += $$QMAKE_COPY $$COPYDLL
}
} else { } else {
COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/Win_x64/*.dll) $$DESTDIR COPYDLL = $$absolute_path($${_PRO_FILE_PWD_}/../third/mingw/*.dll) $$DESTDIR
contains(QMAKE_CC, cl) { QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, $$QMAKE_DIR_SEP)
QMAKE_PRE_LINK += $$QMAKE_COPY $$replace(COPYDLL, /, \\)
} else {
QMAKE_PRE_LINK += $$QMAKE_COPY $$COPYDLL
}
} }
} }
qnx: target.path = /tmp/$${TARGET}/bin qnx: target.path = /tmp/$${TARGET}/bin

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 KiB

After

Width:  |  Height:  |  Size: 116 KiB

View File

@ -0,0 +1,21 @@
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")
}
}
}

View File

@ -0,0 +1,321 @@
pragma Singleton
import QtQuick
import FluentUI
FluObject{
property var navigationView
FluPaneItem{
title:"Home"
icon:FluentIcons.Home
onTap:{
navigationView.push("qrc:/T_Home.qml")
}
}
FluPaneItemExpander{
title:"Basic input"
icon:FluentIcons.CheckboxComposite
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")
}
}
}
FluPaneItemExpander{
title:"Form"
icon:FluentIcons.GridView
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")
}
}
}
FluPaneItemExpander{
title:"Surface"
icon:FluentIcons.SurfaceHub
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:"StatusView"
onTap:{
navigationView.push("qrc:/T_StatusView.qml")
}
}
FluPaneItem{
title:"Carousel"
onTap:{
navigationView.push("qrc:/T_Carousel.qml")
}
}
FluPaneItem{
title:"Expander"
onTap:{
navigationView.push("qrc:/T_Expander.qml")
}
}
}
FluPaneItemExpander{
title:"Popus"
icon:FluentIcons.ButtonMenu
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")
}
}
}
FluPaneItemExpander{
title:"Navigation"
icon:FluentIcons.AllApps
FluPaneItem{
title:"Pivot"
image:"qrc:/res/image/control/Pivot.png"
recentlyAdded:true
order:3
desc:"Presents information from different sources in atabbed view."
onTap:{
navigationView.push("qrc:/T_Pivot.qml")
}
}
FluPaneItem{
title:"TabView"
image:"qrc:/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:/T_TabView.qml")
}
}
FluPaneItem{
title:"TreeView"
onTap:{
navigationView.push("qrc:/T_TreeView.qml")
}
}
FluPaneItem{
title:"TableView"
image:"qrc:/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:/T_TableView.qml")
}
}
FluPaneItem{
title:"MultiWindow"
onTap:{
navigationView.push("qrc:/T_MultiWindow.qml")
}
}
FluPaneItem{
title:"FlipView"
image:"qrc:/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:/T_FlipView.qml")
}
}
}
FluPaneItemExpander{
title:"Theming"
icon:FluentIcons.Brightness
FluPaneItem{
title:"Theme"
onTap:{
navigationView.push("qrc:/T_Theme.qml")
}
}
FluPaneItem{
title:"Typography"
onTap:{
navigationView.push("qrc:/T_Typography.qml")
}
}
FluPaneItem{
title:"Awesome"
onTap:{
navigationView.push("qrc:/T_Awesome.qml")
}
}
}
FluPaneItemExpander{
title:"Media"
icon:FluentIcons.Media
FluPaneItem{
title:"MediaPlayer"
image:"qrc:/res/image/control/MediaPlayerElement.png"
recentlyAdded:true
order:0
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)
}
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){
var items = navigationView.getItems();
for(var i=0;i<items.length;i++){
var item = items[i]
if(item.key === data.key){
if(navigationView.getCurrentIndex() === i){
return
}
item.tap()
navigationView.setCurrentIndex(i)
if(item.parent){
item.parent.isExpand = true
}
return
}
}
}
}

2
example/global/qmldir Normal file
View File

@ -0,0 +1,2 @@
singleton ItemsOriginal 1.0 ItemsOriginal.qml
singleton ItemsFooter 1.0 ItemsFooter.qml

View File

@ -3,12 +3,13 @@
#include <QQmlContext> #include <QQmlContext>
#include <QDir> #include <QDir>
#include <QQuickWindow> #include <QQuickWindow>
#include <QQuickStyle>
#include <QProcess> #include <QProcess>
#include "ChatController.h" #include "ChatController.h"
QMap<QString, QVariant> properties(){ QMap<QString, QVariant> properties(){
QMap<QString, QVariant> map; QMap<QString, QVariant> map;
// map["installHelper"] = QVariant::fromValue(QVariant::fromValue(InstallHelper::getInstance())); // map["installHelper"] = QVariant::fromValue(QVariant::fromValue(InstallHelper::getInstance()));
return map; return map;
} }
@ -17,8 +18,7 @@ int main(int argc, char *argv[])
QCoreApplication::setOrganizationName("ZhuZiChu"); QCoreApplication::setOrganizationName("ZhuZiChu");
QCoreApplication::setOrganizationDomain("https://zhuzichu520.github.io"); QCoreApplication::setOrganizationDomain("https://zhuzichu520.github.io");
QCoreApplication::setApplicationName("FluentUI"); QCoreApplication::setApplicationName("FluentUI");
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QQuickStyle::setStyle("Basic");
// QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
QQmlApplicationEngine engine; QQmlApplicationEngine engine;

View File

@ -1,7 +1,7 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import FluentUI 1.0 import FluentUI
FluWindow { FluWindow {
@ -17,6 +17,7 @@ FluWindow {
FluAppBar{ FluAppBar{
id:appbar id:appbar
title:"关于" title:"关于"
width:parent.width
} }
ColumnLayout{ ColumnLayout{
@ -35,7 +36,7 @@ FluWindow {
fontStyle: FluText.Title fontStyle: FluText.Title
} }
FluText{ FluText{
text:"v1.1.4" text:"v1.2.2"
fontStyle: FluText.Body fontStyle: FluText.Body
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
} }

View File

@ -1,9 +1,9 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtQuick.Controls 2.15 import QtQuick.Controls
import FluentUI 1.0 import FluentUI
import Controller 1.0 import Controller
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs
FluWindow { FluWindow {
@ -43,6 +43,7 @@ FluWindow {
FluAppBar{ FluAppBar{
id:appbar id:appbar
title:"ChatGPT" title:"ChatGPT"
width:parent.width
} }
Component{ Component{
@ -57,7 +58,7 @@ FluWindow {
selectedTextColor: Qt.rgba(51,153,255,1) selectedTextColor: Qt.rgba(51,153,255,1)
color:FluColors.Black color:FluColors.Black
selectionColor: { selectionColor: {
if(FluTheme.isDark){ if(FluTheme.dark){
return FluTheme.primaryColor.lighter return FluTheme.primaryColor.lighter
}else{ }else{
return FluTheme.primaryColor.dark return FluTheme.primaryColor.dark
@ -82,7 +83,7 @@ FluWindow {
bottom: layout_bottom.top bottom: layout_bottom.top
margins: 10 margins: 10
} }
color: FluTheme.isDark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(245/255,245/255,245/255,1) color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(245/255,245/255,245/255,1)
ListView{ ListView{
id:list_message id:list_message
anchors.fill: parent anchors.fill: parent
@ -182,7 +183,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: "请输入消息"

View File

@ -1,6 +1,7 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import FluentUI 1.0 import QtQuick.Controls
import FluentUI
FluWindow { FluWindow {
@ -17,13 +18,14 @@ FluWindow {
onInitArgument: onInitArgument:
(argument)=>{ (argument)=>{
textbox_uesrname.text = argument.username textbox_uesrname.updateText(argument.username)
textbox_password.focus = true textbox_password.focus = true
} }
FluAppBar{ FluAppBar{
id:appbar id:appbar
title:"登录" title:"登录"
width:parent.width
} }
ColumnLayout{ ColumnLayout{
@ -33,10 +35,9 @@ FluWindow {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
FluAutoSuggestBox{ FluAutoSuggestBox{
id:textbox_uesrname id:textbox_uesrname
values:["Admin","User"] items:[{title:"Admin"},{title:"User"}]
placeholderText: "请输入账号" placeholderText: "请输入账号"
Layout.preferredWidth: 260 Layout.preferredWidth: 260
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter

View File

@ -1,290 +1,49 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Window 2.15 import QtQuick.Window
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts
import QtGraphicalEffects 1.15 import "qrc:///global/"
import FluentUI
import FluentUI 1.0
FluWindow { FluWindow {
id:rootwindow id:rootwindow
width: 860 width: 1000
height: 600 height: 640
title: "FluentUI" title: "FluentUI"
minimumWidth: 520 minimumWidth: 520
minimumHeight: 400 minimumHeight: 460
FluAppBar{ FluAppBar{
id:appbar id:appbar
title: "FluentUI" z:10
showDark: true
width:parent.width
} }
FluObject{
id:original_items
FluPaneItemHeader{
title:"Inputs"
}
FluPaneItem{
title:"Buttons"
onTap:{
nav_view.push("qrc:/T_Buttons.qml")
}
}
FluPaneItem{
title:"Slider"
onTap:{
nav_view.push("qrc:/T_Slider.qml")
}
}
FluPaneItem{
title:"ToggleSwitch"
onTap:{
nav_view.push("qrc:/T_ToggleSwitch.qml")
}
}
FluPaneItemHeader{
title:"Form"
}
FluPaneItem{
title:"TextBox"
onTap:{
nav_view.push("qrc:/T_TextBox.qml")
}
}
FluPaneItem{
title:"TimePicker"
onTap:{
nav_view.push("qrc:/T_TimePicker.qml")
}
}
FluPaneItem{
title:"DatePicker"
onTap:{
nav_view.push("qrc:/T_DatePicker.qml")
}
}
FluPaneItem{
title:"CalendarPicker"
onTap:{
nav_view.push("qrc:/T_CalendarPicker.qml")
}
}
FluPaneItem{
title:"ColorPicker"
onTap:{
nav_view.push("qrc:/T_ColorPicker.qml")
}
}
FluPaneItemHeader{
title:"Surface"
}
FluPaneItem{
title:"InfoBar"
onTap:{
nav_view.push("qrc:/T_InfoBar.qml")
}
}
FluPaneItem{
title:"Progress"
onTap:{
nav_view.push("qrc:/T_Progress.qml")
}
}
FluPaneItem{
title:"Badge"
onTap:{
nav_view.push("qrc:/T_Badge.qml")
}
}
FluPaneItem{
title:"Rectangle"
onTap:{
nav_view.push("qrc:/T_Rectangle.qml")
}
}
FluPaneItem{
title:"Carousel"
onTap:{
nav_view.push("qrc:/T_Carousel.qml")
}
}
FluPaneItem{
title:"Expander"
onTap:{
nav_view.push("qrc:/T_Expander.qml")
}
}
FluPaneItemHeader{
title:"Popus"
}
FluPaneItem{
title:"Dialog"
onTap:{
nav_view.push("qrc:/T_Dialog.qml")
}
}
FluPaneItem{
title:"Tooltip"
onTap:{
nav_view.push("qrc:/T_Tooltip.qml")
}
}
FluPaneItem{
title:"Menu"
onTap:{
nav_view.push("qrc:/T_Menu.qml")
}
}
FluPaneItemHeader{
title:"Navigation"
}
FluPaneItem{
title:"TabView"
onTap:{
nav_view.push("qrc:/T_TabView.qml")
}
}
FluPaneItem{
title:"TreeView"
onTap:{
nav_view.push("qrc:/T_TreeView.qml")
}
}
FluPaneItem{
title:"MultiWindow"
onTap:{
nav_view.push("qrc:/T_MultiWindow.qml")
}
}
FluPaneItemHeader{
title:"Theming"
}
FluPaneItem{
title:"Theme"
onTap:{
nav_view.push("qrc:/T_Theme.qml")
}
}
FluPaneItem{
title:"Awesome"
onTap:{
nav_view.push("qrc:/T_Awesome.qml")
}
}
FluPaneItem{
title:"Typography"
onTap:{
nav_view.push("qrc:/T_Typography.qml")
}
}
FluPaneItemHeader{
title:"Media"
}
FluPaneItem{
title:"MediaPlayer"
onTap:{
nav_view.push("qrc:/T_MediaPlayer.qml")
}
}
}
FluObject{
id:footer_items
FluPaneItemSeparator{}
FluPaneItem{
title:"意见反馈"
onTap:{
Qt.openUrlExternally("https://github.com/zhuzichu520/FluentUI/issues/new")
}
}
FluPaneItem{
title:"关于"
onTap:{
FluApp.navigate("/about")
}
}
}
FluNavigationView{ FluNavigationView{
id:nav_view id:nav_view
anchors{ anchors.fill: parent
top: appbar.bottom items: ItemsOriginal
left: parent.left footerItems:ItemsFooter
right: parent.right logo: "qrc:/res/image/favicon.ico"
bottom: parent.bottom z: 11
title:"FluentUI"
autoSuggestBox:FluAutoSuggestBox{
width: 280
anchors.centerIn: parent
iconSource: FluentIcons.Zoom
items: ItemsOriginal.getSearchData()
placeholderText: "查找"
onItemClicked:
(data)=>{
ItemsOriginal.startPageByItem(data)
}
} }
items:original_items
footerItems:footer_items
actions:[
Image {
width: 30
height: 30
Layout.preferredWidth: 30
Layout.preferredHeight: 30
sourceSize: Qt.size(60,60)
source: "qrc:/res/image/logo_openai.png"
Layout.rightMargin: 5
MouseArea{
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
FluApp.navigate("/chat")
}
}
},
FluText{
text:"夜间模式"
fontStyle: FluText.Body
},
FluToggleSwitch{
selected: FluTheme.isDark
clickFunc:function(){
FluTheme.isDark = !FluTheme.isDark
}
}
]
Component.onCompleted: { Component.onCompleted: {
nav_view.setCurrentIndex(1) ItemsOriginal.navigationView = nav_view
nav_view.push("qrc:/T_Buttons.qml") nav_view.setCurrentIndex(0)
nav_view.push("qrc:/T_Home.qml")
} }
} }
} }

View File

@ -0,0 +1,37 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import FluentUI
FluWindow {
width: 640
height: 480
minimumWidth: 640
minimumHeight: 480
title:"视频播放器"
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
}
}
}

View File

@ -46,5 +46,117 @@
<file>T_Carousel.qml</file> <file>T_Carousel.qml</file>
<file>T_MediaPlayer.qml</file> <file>T_MediaPlayer.qml</file>
<file>T_TabView.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>
<file>page/MediaPage.qml</file>
<file>T_FlipView.qml</file>
<file>T_Pivot.qml</file>
<file>component/CodeExpander.qml</file>
<file>T_TableView.qml</file>
<file>T_StatusView.qml</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Some files were not shown because too many files have changed in this diff Show More