Compare commits

..

125 Commits

Author SHA1 Message Date
4997b991db update 2024-05-10 19:23:30 +08:00
cd3abc01e9 fix bug 2024-05-10 19:20:01 +08:00
e6c4b79298 Merge branch 'main' into 1.7.6-dev
# Conflicts:
#	src/Qt5/imports/FluentUI/Controls/FluRadioButtons.qml
#	src/Qt6/imports/FluentUI/Controls/FluRadioButtons.qml
2024-05-10 12:26:14 +08:00
f830d5a9bf Merge branch 'main' of https://github.com/zhuzichu520/FluentUI 2024-05-09 19:41:15 +08:00
ed49e3f6af Merge pull request #499 from gao-xiangyang/main
info提示语支持主动调用函数关闭,支持关闭所有info框的函数
2024-05-09 17:10:34 +05:30
9aa6615189 FluRadioButtons 组件支持 disabled、manuallyDisabled选项
disabled: true // 禁用所有FluRadioButton子组件
        manuallyDisabled: true // 是否指定每个FluRadioButton上的disabled选项
2024-05-08 21:10:00 +08:00
c36515f19c info提示语支持主动调用函数关闭,支持关闭所有info框的函数 2024-05-08 20:35:31 +08:00
402579f32a update 2024-05-08 18:58:22 +08:00
655eff4f62 update 2024-05-07 22:16:42 +08:00
b916221d9f update 2024-05-07 21:47:40 +08:00
4cca680029 update 2024-05-05 22:05:18 +08:00
fe2543ab4d fix bug 2024-05-05 22:03:41 +08:00
394a42cb94 update 2024-05-05 21:33:47 +08:00
ac253a3de5 fix bug 2024-05-05 20:32:48 +08:00
0d61e33ef1 update 2024-05-05 15:52:46 +08:00
132ab12c32 update 2024-05-05 00:06:01 +08:00
af270951da update 2024-05-04 23:56:20 +08:00
18685b17ec update 2024-05-03 16:56:40 +08:00
0eb4d9f346 update 2024-05-03 01:54:38 +08:00
8015dcc2f1 update 2024-05-02 23:52:30 +08:00
0b1755e9eb update 2024-05-01 01:11:25 +08:00
e471d5a230 update 2024-04-30 19:38:05 +08:00
f922978338 update 2024-04-30 19:27:57 +08:00
91bda2a22c update 2024-04-30 13:07:46 +08:00
6638fe2e06 update 2024-04-30 13:06:27 +08:00
bf001d99d2 update 2024-04-30 12:59:09 +08:00
30531079b5 update 2024-04-29 10:12:34 +08:00
a746bc2684 update 2024-04-28 21:05:43 +08:00
96a6d0e7fa update 2024-04-28 20:22:05 +08:00
c733f3c60e update 2024-04-28 18:38:37 +08:00
effd9f3058 update 2024-04-28 18:19:21 +08:00
d93aac3518 update 2024-04-28 15:56:37 +08:00
5f6745b630 udpate 2024-04-28 13:03:20 +08:00
4f202831b8 Merge branch 'main' of https://github.com/zhuzichu520/FluentUI 2024-04-28 10:51:29 +08:00
29cee84edd update 2024-04-28 10:51:13 +08:00
2d4e61445e Merge pull request #488 from yanhuacuo/path-for-insertRow
Add the functionality to insert new rows into the table
2024-04-28 10:47:28 +08:00
cc79854191 Merge pull request #489 from w-jt/main
FluPagination.qml 添加自定义控件,通过header和footer属性添加控件
2024-04-28 10:46:47 +08:00
500efa6298 添加自定义控件,通过header和footer属性添加控件
添加自定义控件,通过header和footer属性添加控件
2024-04-27 11:54:42 +08:00
355332da96 添加自定义控件,通过header和footer属性添加控件
添加自定义控件,通过header和footer属性添加控件
2024-04-27 11:53:57 +08:00
a0d662a8a5 添加自定义控件,通过header和footer属性添加控件
添加自定义控件,通过header和footer属性添加控件
2024-04-27 11:49:29 +08:00
aecc3fe3b4 添加自定义控件,通过header和footer属性添加控件
添加自定义控件,通过header和footer属性添加控件
2024-04-27 11:48:19 +08:00
3554fb99cd Add the functionality to insert new rows into the table 2024-04-27 09:40:37 +08:00
24fdff7e35 fix bug 2024-04-25 00:08:18 +08:00
d2fdd08604 update 2024-04-24 17:24:31 +08:00
1f5d6ce1aa update 2024-04-24 17:12:00 +08:00
5fd7c7d10e update 2024-04-24 10:37:15 +08:00
83507a6ed5 update 2024-04-24 09:57:28 +08:00
789d9164a1 Merge branch '1.7.5-dev' 2024-04-24 09:53:59 +08:00
cb44759978 update 2024-04-23 22:38:39 +08:00
04c52b1b25 fix bug 2024-04-23 21:19:32 +08:00
b8ef9169b9 update 2024-04-23 19:33:05 +08:00
c7de653ba2 update 2024-04-23 13:41:26 +08:00
2ddb7e3290 update 2024-04-23 00:32:15 +08:00
e8d79e3c7b update 2024-04-23 00:31:20 +08:00
bc4510077f update 2024-04-19 01:04:13 +08:00
179bc8b21f update 2024-04-19 00:42:35 +08:00
8fe4e3b047 update 2024-04-17 22:05:49 +08:00
a443f3a9ba update 2024-04-17 21:39:55 +08:00
1a0f2afee0 update 2024-04-17 15:11:14 +08:00
c9c737f2fc update 2024-04-16 12:36:41 +08:00
f0f00b9eba Merge pull request #483 from mariuszmaximus/main
fix for msys2
2024-04-15 12:39:47 +08:00
956f2e0ad0 fix for msys2 2024-04-14 19:38:52 +02:00
ecd13a9cca update 2024-04-15 00:11:41 +08:00
17bfff2346 update 2024-04-14 23:58:15 +08:00
295dcf02c4 update 2024-04-14 23:09:41 +08:00
f701f97756 update 2024-04-14 11:43:32 +08:00
2c4cf82f63 update 2024-04-13 22:00:15 +08:00
e8c47e0fd8 update 2024-04-13 21:30:23 +08:00
9296b18606 update 2024-04-13 10:51:24 +08:00
481e19c8cc update 2024-04-13 10:50:27 +08:00
44f7948df3 update 2024-04-12 16:50:49 +08:00
0ab315e258 update 2024-04-12 16:26:32 +08:00
44acdbcf7f update 2024-04-11 20:29:59 +08:00
3997daaa11 update 2024-04-11 19:18:37 +08:00
531f659e59 update 2024-04-11 15:27:15 +08:00
3f6ef13cd0 update 2024-04-11 15:09:47 +08:00
96fef84c2d update 2024-04-11 14:56:22 +08:00
a3f375c9ef update 2024-04-11 14:51:43 +08:00
6a31e86505 update 2024-04-09 20:53:52 +08:00
6ebd659e13 update 2024-04-04 22:47:07 +08:00
bd8c80feb8 update 2024-04-04 17:43:58 +08:00
6b617d10d5 update 2024-04-04 17:08:45 +08:00
cf163f5e3b update 2024-04-04 16:53:31 +08:00
b4329fdd0a update 2024-04-04 12:11:08 +08:00
84b2045b5f update 2024-04-04 02:48:26 +08:00
18193a18be update 2024-04-04 02:01:52 +08:00
fe08b08c1f update 2024-04-04 01:10:14 +08:00
ef96618151 update 2024-04-03 21:52:26 +08:00
be34220652 update 2024-04-03 19:31:01 +08:00
5cf0812562 update 2024-04-03 19:30:15 +08:00
c2b845658d update 2024-04-03 13:24:30 +08:00
eb4ec242b1 update 2024-04-03 11:28:18 +08:00
a95916ab03 update 2024-04-03 11:19:35 +08:00
bf5bedc9ed update 2024-04-03 11:09:35 +08:00
7d1666597f update 2024-04-02 00:32:06 +08:00
da9f63eb24 update 2024-03-31 21:56:11 +08:00
68015776ab update 2024-03-31 21:52:06 +08:00
d222cb640c update 2024-03-31 11:17:05 +08:00
0ab7f811e3 update 2024-03-31 10:59:15 +08:00
6a5f9d04a9 update 2024-03-29 16:56:09 +08:00
cb33af8836 update 2024-03-29 16:23:16 +08:00
5fd934b5f5 update 2024-03-29 00:51:55 +08:00
b7fde5f79c update 2024-03-29 00:48:58 +08:00
41cbeef3fd update 2024-03-28 19:18:56 +08:00
f616a2da6a update 2024-03-27 14:13:36 +08:00
b6c3f0eda9 update 2024-03-27 10:52:47 +08:00
06aa16c0eb update 2024-03-27 10:25:58 +08:00
c52439ac39 update 2024-03-27 09:45:56 +08:00
e81a2cc849 update 2024-03-27 00:36:56 +08:00
485bcc8acc update 2024-03-25 22:17:05 +08:00
07fedb43a8 update 2024-03-25 21:01:47 +08:00
d6c0492665 update 2024-03-25 14:43:23 +08:00
9d06c6d1e9 update 2024-03-24 22:12:20 +08:00
0ca486dfa1 fix bug 2024-03-24 12:45:34 +08:00
3257f59c68 update 2024-03-24 10:50:01 +08:00
ff68491baf update 2024-03-24 10:27:16 +08:00
247b8db7c4 update 2024-03-24 10:20:50 +08:00
07a43825d1 update 2024-03-24 10:17:20 +08:00
e0254f2f80 fix bug 2024-03-23 22:28:14 +08:00
37101c97c5 update 2024-03-23 22:17:03 +08:00
7e1490f8f4 update 2024-03-22 12:59:39 +08:00
98770cb907 update 2024-03-21 13:33:35 +08:00
bd942659df update 2024-03-21 11:30:17 +08:00
796be2a8f2 update FluWindowDialog 2024-03-21 11:29:49 +08:00
d655dc0141 update 2024-03-20 23:35:15 +08:00
407 changed files with 14494 additions and 47610 deletions

View File

@ -91,14 +91,14 @@ jobs:
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: zhuzichu520/inno-setup-action@v1.0.1 uses: zhuzichu520/inno-setup-action@v1.0.1
with: with:
filepath: ./action-cli/InstallerScript.iss filepath: ./package/InstallerScript.iss
- name: uploadRelease - name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./action-cli/installer.exe file: ./package/installer.exe
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe
tag: ${{ github.ref }} tag: ${{ github.ref }}
overwrite: true overwrite: true

View File

@ -78,14 +78,14 @@ jobs:
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: zhuzichu520/inno-setup-action@v1.0.1 uses: zhuzichu520/inno-setup-action@v1.0.1
with: with:
filepath: ./action-cli/InstallerScript.iss filepath: ./package/InstallerScript.iss
- name: uploadRelease - name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./action-cli/installer.exe file: ./package/installer.exe
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe
tag: ${{ github.ref }} tag: ${{ github.ref }}
overwrite: true overwrite: true

View File

@ -85,14 +85,14 @@ jobs:
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: zhuzichu520/inno-setup-action@v1.0.1 uses: zhuzichu520/inno-setup-action@v1.0.1
with: with:
filepath: ./action-cli/InstallerScript.iss filepath: ./package/InstallerScript.iss
- name: uploadRelease - name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/') if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./action-cli/installer.exe file: ./package/installer.exe
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe
tag: ${{ github.ref }} tag: ${{ github.ref }}
overwrite: true overwrite: true

4
.gitignore vendored
View File

@ -36,10 +36,8 @@ bin
build build
cmake-build-* cmake-build-*
.idea .idea
package
example/Version.h example/Version.h
action-cli
dist dist
*.qm *.qm

View File

@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 3.20)
project(FluentUI VERSION 1.0) project(FluentUI VERSION 1.0)
if(MSVC) if (MSVC)
#让Release也生成pdb文件 #让Release也生成pdb文件
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF") set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
endif() endif ()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/.cmake/) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/.cmake/)
include(GetGitRevisionDescription) include(GetGitRevisionDescription)
@ -22,8 +22,8 @@ add_subdirectory(src)
#Release也支持日志打印代码位置 #Release也支持日志打印代码位置
target_compile_definitions(fluentuiplugin target_compile_definitions(fluentuiplugin
PRIVATE PRIVATE
QT_MESSAGELOGCONTEXT QT_MESSAGELOGCONTEXT
) )
if (FLUENTUI_BUILD_EXAMPLES) if (FLUENTUI_BUILD_EXAMPLES)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20) cmake_minimum_required(VERSION 3.20)
project(example VERSION 1.0 LANGUAGES CXX) project(example VERSION 1.0)
#配置通用编译 #配置通用编译
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
@ -10,68 +10,68 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
#判断FluentUI库类型 #判断FluentUI库类型
if(FLUENTUI_BUILD_STATIC_LIB) if (FLUENTUI_BUILD_STATIC_LIB)
add_definitions(-DFLUENTUI_BUILD_STATIC_LIB) add_definitions(-DFLUENTUI_BUILD_STATIC_LIB)
endif() endif ()
#设置可执行文件输出目录 #设置可执行文件输出目录
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
if(APPLE) if (APPLE)
set(APPLICATION_DIR_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/MacOS) set(APPLICATION_DIR_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/MacOS)
else() else ()
set(APPLICATION_DIR_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) set(APPLICATION_DIR_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif() endif ()
#导入Qt相关依赖包 #导入Qt相关依赖包
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Quick Svg Network) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Quick Svg Network)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick Svg Network) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick Svg Network)
#添加国际化脚本 #添加国际化脚本
find_program(QT_LUPDATE NAMES lupdate) find_program(QT_LUPDATE NAMES lupdate lupdate-qt6)
find_program(QT_LRELEASE NAMES lrelease) find_program(QT_LRELEASE NAMES lrelease lrelease-qt6)
file(GLOB TS_FILE_PATHS ${CMAKE_CURRENT_LIST_DIR}/ *.ts) file(GLOB TS_FILE_PATHS ${CMAKE_CURRENT_LIST_DIR}/ *.ts)
add_custom_target(Script-UpdateTranslations add_custom_target(Script-UpdateTranslations
COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts ${PROJECT_NAME}_en_US.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts ${PROJECT_NAME}_en_US.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts ${PROJECT_NAME}_zh_CN.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} COMMAND ${QT_LUPDATE} ${CMAKE_CURRENT_LIST_DIR} -ts ${PROJECT_NAME}_zh_CN.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMAND ${QT_LRELEASE} ${PROJECT_NAME}_en_US.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} COMMAND ${QT_LRELEASE} ${PROJECT_NAME}_en_US.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMAND ${QT_LRELEASE} ${PROJECT_NAME}_zh_CN.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} COMMAND ${QT_LRELEASE} ${PROJECT_NAME}_zh_CN.ts WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${APPLICATION_DIR_PATH}/i18n COMMAND ${CMAKE_COMMAND} -E make_directory ${APPLICATION_DIR_PATH}/i18n
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_NAME}_en_US.qm ${PROJECT_NAME}_zh_CN.qm ${APPLICATION_DIR_PATH}/i18n COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_NAME}_en_US.qm ${PROJECT_NAME}_zh_CN.qm ${APPLICATION_DIR_PATH}/i18n
SOURCES ${TS_FILE_PATHS} SOURCES ${TS_FILE_PATHS}
) )
##生成版本信息头文件 ##生成版本信息头文件
set(HEADER_FILE_VERSION_PATH ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/Version.h) set(HEADER_FILE_VERSION_PATH ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/Version.h)
configure_file( configure_file(
${CMAKE_SOURCE_DIR}/.cmake/Version.h.in ${CMAKE_SOURCE_DIR}/.cmake/Version.h.in
${HEADER_FILE_VERSION_PATH} ${HEADER_FILE_VERSION_PATH}
) )
#遍历所有Cpp文件 #遍历所有Cpp文件
file(GLOB_RECURSE CPP_FILES *.cpp *.h) file(GLOB_RECURSE CPP_FILES *.cpp *.h)
foreach(filepath ${CPP_FILES}) foreach (filepath ${CPP_FILES})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND sources_files ${filename}) list(APPEND sources_files ${filename})
endforeach(filepath) endforeach (filepath)
if(WIN32) if (WIN32)
list(APPEND sources_files "src/app_dmp.h") list(APPEND sources_files "src/app_dmp.h")
endif() endif ()
#如果是Windows平台则生成rc文件还有inno setup脚本文件 #如果是Windows平台则生成rc文件还有inno setup脚本文件
set(EXAMPLE_VERSION_RC_PATH "") set(EXAMPLE_VERSION_RC_PATH "")
if(WIN32) if (WIN32)
set(EXAMPLE_VERSION_RC_PATH ${CMAKE_CURRENT_BINARY_DIR}/version_${PROJECT_NAME}.rc) set(EXAMPLE_VERSION_RC_PATH ${CMAKE_CURRENT_BINARY_DIR}/version_${PROJECT_NAME}.rc)
configure_file( configure_file(
${CMAKE_SOURCE_DIR}/.cmake/version_exe.rc.in ${CMAKE_SOURCE_DIR}/.cmake/version_exe.rc.in
${EXAMPLE_VERSION_RC_PATH} ${EXAMPLE_VERSION_RC_PATH}
) )
configure_file( configure_file(
${CMAKE_SOURCE_DIR}/.cmake/InstallerScript.iss.in ${CMAKE_SOURCE_DIR}/.cmake/InstallerScript.iss.in
${CMAKE_SOURCE_DIR}/action-cli/InstallerScript.iss ${CMAKE_SOURCE_DIR}/package/InstallerScript.iss
) )
endif() endif ()
#加快qrc编译 #加快qrc编译
qt_add_big_resources(QRC_RESOURCES ${PROJECT_NAME}.qrc) qt_add_big_resources(QRC_RESOURCES ${PROJECT_NAME}.qrc)
@ -80,34 +80,34 @@ set_property(SOURCE ${PROJECT_NAME}.qrc PROPERTY SKIP_AUTORCC ON)
list(APPEND sources_files ${QRC_RESOURCES}) list(APPEND sources_files ${QRC_RESOURCES})
#添加可执行文件 #添加可执行文件
if(WIN32) if (WIN32)
list(APPEND sources_files ${EXAMPLE_VERSION_RC_PATH}) list(APPEND sources_files ${EXAMPLE_VERSION_RC_PATH})
endif() endif ()
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) if (${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(${PROJECT_NAME} qt_add_executable(${PROJECT_NAME}
MANUAL_FINALIZATION MANUAL_FINALIZATION
${sources_files} ${sources_files}
) )
else() else ()
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}
${sources_files} ${sources_files}
) )
endif() endif ()
add_dependencies(${PROJECT_NAME} Script-UpdateTranslations) add_dependencies(${PROJECT_NAME} Script-UpdateTranslations)
#复制程序运行所需要的动态库 #复制程序运行所需要的动态库
if(WIN32) if (WIN32)
if(MSVC) if (MSVC)
if(CMAKE_SIZEOF_VOID_P EQUAL 4) if (CMAKE_SIZEOF_VOID_P EQUAL 4)
file(GLOB_RECURSE 3RDPARTY_DLL_DIR ${CMAKE_SOURCE_DIR}/3rdparty/msvc/x86/*.dll) file(GLOB_RECURSE 3RDPARTY_DLL_DIR ${CMAKE_SOURCE_DIR}/3rdparty/msvc/x86/*.dll)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
file(GLOB_RECURSE 3RDPARTY_DLL_DIR ${CMAKE_SOURCE_DIR}/3rdparty/msvc/x64/*.dll) file(GLOB_RECURSE 3RDPARTY_DLL_DIR ${CMAKE_SOURCE_DIR}/3rdparty/msvc/x64/*.dll)
endif() endif ()
elseif(MINGW) elseif (MINGW)
file(GLOB_RECURSE 3RDPARTY_DLL_DIR ${CMAKE_SOURCE_DIR}/3rdparty/mingw/*.dll) file(GLOB_RECURSE 3RDPARTY_DLL_DIR ${CMAKE_SOURCE_DIR}/3rdparty/mingw/*.dll)
endif() endif ()
file(COPY ${3RDPARTY_DLL_DIR} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) file(COPY ${3RDPARTY_DLL_DIR} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif() endif ()
#复制FluentUI源码到运行目录下用于脚手架生成 #复制FluentUI源码到运行目录下用于脚手架生成
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/source/) file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/source/)
@ -115,37 +115,37 @@ file(COPY ${CMAKE_SOURCE_DIR}/src/ DESTINATION ${APPLICATION_DIR_PATH}/source/)
#导入component头文件,不然通过QML_NAMED_ELEMENT生成的c++类会找不到头文件报错 #导入component头文件,不然通过QML_NAMED_ELEMENT生成的c++类会找不到头文件报错
target_include_directories(${PROJECT_NAME} PRIVATE target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/component ${CMAKE_CURRENT_SOURCE_DIR}/src/component
) )
#如果是静态库则需要手动注册插件导入FluentUI.h头文件 #如果是静态库则需要手动注册插件导入FluentUI.h头文件
if(FLUENTUI_BUILD_STATIC_LIB) if (FLUENTUI_BUILD_STATIC_LIB)
target_include_directories(${PROJECT_NAME} PRIVATE target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src
) )
endif() endif ()
#设置属性 #设置属性
set_target_properties(${PROJECT_NAME} PROPERTIES set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.${PROJECT_NAME}.com MACOSX_BUNDLE_GUI_IDENTIFIER my.${PROJECT_NAME}.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE WIN32_EXECUTABLE TRUE
) )
#Release也支持日志打印代码位置 #Release也支持日志打印代码位置
target_compile_definitions(${PROJECT_NAME} target_compile_definitions(${PROJECT_NAME}
PRIVATE PRIVATE
QT_MESSAGELOGCONTEXT QT_MESSAGELOGCONTEXT
) )
#目标文件链接库 #目标文件链接库
target_link_libraries(${PROJECT_NAME} PRIVATE target_link_libraries(${PROJECT_NAME} PRIVATE
Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Svg
Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Network
fluentuiplugin fluentuiplugin
) )
#添加部署脚本 #添加部署脚本
@ -153,23 +153,23 @@ if (CMAKE_BUILD_TYPE MATCHES "Release")
if (APPLE) if (APPLE)
find_program(QT_DEPLOY_QT NAMES macdeployqt) find_program(QT_DEPLOY_QT NAMES macdeployqt)
add_custom_target(Script-DeployRelease add_custom_target(Script-DeployRelease
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/dist COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/dist
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}/dist COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}/dist
COMMAND ${QT_DEPLOY_QT} ${CMAKE_SOURCE_DIR}/dist/${PROJECT_NAME}.app -qmldir=${CMAKE_CURRENT_LIST_DIR} COMMAND ${QT_DEPLOY_QT} ${CMAKE_SOURCE_DIR}/dist/${PROJECT_NAME}.app -qmldir=${CMAKE_CURRENT_LIST_DIR}
COMMENT "MacOs Deploying Qt Dependencies After Build........." COMMENT "MacOs Deploying Qt Dependencies After Build........."
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
) )
endif() endif ()
if(WIN32) if (WIN32)
find_program(QT_DEPLOY_QT NAMES windeployqt) find_program(QT_DEPLOY_QT NAMES windeployqt)
add_custom_target(Script-DeployRelease add_custom_target(Script-DeployRelease
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/dist COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/dist
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}/dist COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}/dist
COMMAND ${QT_DEPLOY_QT} ${CMAKE_SOURCE_DIR}/dist/${PROJECT_NAME}.exe -qmldir=${CMAKE_CURRENT_LIST_DIR} COMMAND ${QT_DEPLOY_QT} --qmldir=${CMAKE_CURRENT_LIST_DIR} --plugindir ${CMAKE_SOURCE_DIR}/dist/plugins --no-translations --compiler-runtime ${CMAKE_SOURCE_DIR}/dist/${PROJECT_NAME}.exe
COMMENT "Windows Deploying Qt Dependencies After Build........." COMMENT "Windows Deploying Qt Dependencies After Build........."
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
) )
endif() endif ()
endif() endif ()

View File

@ -127,7 +127,6 @@
<file>qml/global/ItemsOriginal.qml</file> <file>qml/global/ItemsOriginal.qml</file>
<file>qml/global/qmldir</file> <file>qml/global/qmldir</file>
<file>qml/page/T_Acrylic.qml</file> <file>qml/page/T_Acrylic.qml</file>
<file>qml/page/T_Awesome.qml</file>
<file>qml/page/T_Badge.qml</file> <file>qml/page/T_Badge.qml</file>
<file>qml/page/T_BreadcrumbBar.qml</file> <file>qml/page/T_BreadcrumbBar.qml</file>
<file>qml/page/T_Buttons.qml</file> <file>qml/page/T_Buttons.qml</file>
@ -177,14 +176,10 @@
<file>qml/window/SingleInstanceWindow.qml</file> <file>qml/window/SingleInstanceWindow.qml</file>
<file>qml/window/SingleTaskWindow.qml</file> <file>qml/window/SingleTaskWindow.qml</file>
<file>qml/window/StandardWindow.qml</file> <file>qml/window/StandardWindow.qml</file>
<file>res/image/bg_scenic.png</file>
<file>res/image/image_1.jpg</file> <file>res/image/image_1.jpg</file>
<file>qml/window/PageWindow.qml</file> <file>qml/window/PageWindow.qml</file>
<file>qml/page/T_StaggeredLayout.qml</file> <file>qml/page/T_StaggeredLayout.qml</file>
<file>qml/viewmodel/SettingsViewModel.qml</file>
<file>qml/viewmodel/TextBoxViewModel.qml</file>
<file>qml/page/T_Clip.qml</file> <file>qml/page/T_Clip.qml</file>
<file>qml/page/T_3D.qml</file>
<file>qml/page/T_Network.qml</file> <file>qml/page/T_Network.qml</file>
<file>qml/page/T_ShortcutPicker.qml</file> <file>qml/page/T_ShortcutPicker.qml</file>
<file>qml/chart/T_BarChart.qml</file> <file>qml/chart/T_BarChart.qml</file>
@ -197,7 +192,6 @@
<file>res/image/ic_crash.png</file> <file>res/image/ic_crash.png</file>
<file>qml/window/CrashWindow.qml</file> <file>qml/window/CrashWindow.qml</file>
<file>qml/page/T_SplitLayout.qml</file> <file>qml/page/T_SplitLayout.qml</file>
<file>qml/window/FluentInitalizrWindow.qml</file>
<file>res/template/CMakeLists.txt.in</file> <file>res/template/CMakeLists.txt.in</file>
<file>res/template/src/App.qml.in</file> <file>res/template/src/App.qml.in</file>
<file>res/template/src/CMakeLists.txt.in</file> <file>res/template/src/CMakeLists.txt.in</file>
@ -208,5 +202,13 @@
<file>res/template/src/qml.qrc.in</file> <file>res/template/src/qml.qrc.in</file>
<file>res/template/src/zh_CN.ts.in</file> <file>res/template/src/zh_CN.ts.in</file>
<file>res/template/src/README.md.in</file> <file>res/template/src/README.md.in</file>
<file>qml/global/GlobalModel.qml</file>
<file>qml/page/T_Sheet.qml</file>
<file>qml/page/T_GroupBox.qml</file>
<file>res/image/bg_scenic.jpg</file>
<file>qml/window/FluentInitializrWindow.qml</file>
<file>qml/page/T_OpenGL.qml</file>
<file>qml/page/T_Icons.qml</file>
</qresource> </qresource>
<qresource prefix="/"/>
</RCC> </RCC>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4,41 +4,37 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import FluentUI 1.0 import FluentUI 1.0
Item { FluLauncher {
id: app id: app
Connections{ Connections{
target: FluTheme target: FluTheme
function onDarkModeChanged(){ function onDarkModeChanged(){
SettingsHelper.saveDarkMode(FluTheme.darkMode) SettingsHelper.saveDarkMode(FluTheme.darkMode)
} }
} }
Connections{ Connections{
target: FluApp target: FluApp
function onUseSystemAppBarChanged(){ function onUseSystemAppBarChanged(){
SettingsHelper.saveUseSystemAppBar(FluApp.useSystemAppBar) SettingsHelper.saveUseSystemAppBar(FluApp.useSystemAppBar)
} }
} }
Connections{ Connections{
target: TranslateHelper target: TranslateHelper
function onCurrentChanged(){ function onCurrentChanged(){
SettingsHelper.saveLanguage(TranslateHelper.current) SettingsHelper.saveLanguage(TranslateHelper.current)
} }
} }
Component.onCompleted: { Component.onCompleted: {
FluNetwork.openLog = false Network.openLog = false
FluNetwork.setInterceptor(function(param){ Network.setInterceptor(function(param){
param.addHeader("Token","000000000000000000000") param.addHeader("Token","000000000000000000000")
}) })
FluApp.init(app,Qt.locale(TranslateHelper.current)) FluApp.init(app,Qt.locale(TranslateHelper.current))
FluApp.windowIcon = "qrc:/example/res/image/favicon.ico" FluApp.windowIcon = "qrc:/example/res/image/favicon.ico"
FluApp.useSystemAppBar = SettingsHelper.getUseSystemAppBar() FluApp.useSystemAppBar = SettingsHelper.getUseSystemAppBar()
FluTheme.darkMode = SettingsHelper.getDarkMode() FluTheme.darkMode = SettingsHelper.getDarkMode()
FluTheme.enableAnimation = true FluTheme.animationEnabled = true
FluApp.routes = { FluRouter.routes = {
"/":"qrc:/example/qml/window/MainWindow.qml", "/":"qrc:/example/qml/window/MainWindow.qml",
"/about":"qrc:/example/qml/window/AboutWindow.qml", "/about":"qrc:/example/qml/window/AboutWindow.qml",
"/login":"qrc:/example/qml/window/LoginWindow.qml", "/login":"qrc:/example/qml/window/LoginWindow.qml",
@ -51,9 +47,9 @@ Item {
} }
var args = Qt.application.arguments var args = Qt.application.arguments
if(args.length>=2 && args[1].startsWith("-crashed=")){ if(args.length>=2 && args[1].startsWith("-crashed=")){
FluApp.navigate("/crash",{crashFilePath:args[1].replace("-crashed=","")}) FluRouter.navigate("/crash",{crashFilePath:args[1].replace("-crashed=","")})
}else{ }else{
FluApp.navigate("/") FluRouter.navigate("/")
} }
} }
} }

View File

@ -9,10 +9,10 @@ FluScrollablePage{
title: qsTr("Bar Chart") title: qsTr("Bar Chart")
FluArea{ FluFrame{
width: 500 Layout.preferredWidth: 500
height: 370 Layout.preferredHeight: 370
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluChart{ FluChart{
anchors.fill: parent anchors.fill: parent
@ -69,10 +69,10 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
width: 500 Layout.preferredWidth: 500
height: 370 Layout.preferredHeight: 370
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluChart{ FluChart{
anchors.fill: parent anchors.fill: parent

View File

@ -13,10 +13,10 @@ FluScrollablePage{
return Math.random().toFixed(1); return Math.random().toFixed(1);
} }
FluArea{ FluFrame{
height: 370 Layout.preferredWidth: 500
width: 500 Layout.preferredHeight: 370
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluChart{ FluChart{
anchors.fill: parent anchors.fill: parent

View File

@ -7,21 +7,24 @@ import "../component"
FluScrollablePage{ FluScrollablePage{
id: root
title: qsTr("Line Chart") title: qsTr("Line Chart")
property var data : []
FluArea{ FluFrame{
width: 500 Layout.preferredWidth: 500
height: 370 Layout.preferredHeight: 370
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluChart{ FluChart{
id: chart
anchors.fill: parent anchors.fill: parent
chartType: 'line' chartType: 'line'
chartData: { return { chartData: { return {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{ datasets: [{
label: 'My First Dataset', label: 'My First Dataset',
data: [65, 59, 80, 81, 56, 55, 40], data: root.data,
fill: false, fill: false,
borderColor: 'rgb(75, 192, 192)', borderColor: 'rgb(75, 192, 192)',
tension: 0.1 tension: 0.1
@ -41,5 +44,20 @@ FluScrollablePage{
} }
} }
} }
Timer{
id: timer
interval: 300
repeat: true
onTriggered: {
root.data.push(Math.random()*100)
if(root.data.length>7){
root.data.shift()
}
chart.animateToNewData()
}
}
Component.onCompleted: {
timer.restart()
}
} }
} }

View File

@ -9,10 +9,10 @@ FluScrollablePage{
title: qsTr("Pie Chart") title: qsTr("Pie Chart")
FluArea{ FluFrame{
width: 500 Layout.preferredWidth: 500
height: 370 Layout.preferredHeight: 370
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluChart{ FluChart{
anchors.fill: parent anchors.fill: parent
@ -50,10 +50,10 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
width: 500 Layout.preferredWidth: 500
height: 370 Layout.preferredHeight: 370
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluChart{ FluChart{
anchors.fill: parent anchors.fill: parent

View File

@ -9,10 +9,10 @@ FluScrollablePage{
title: qsTr("Polar Area Chart") title: qsTr("Polar Area Chart")
FluArea{ FluFrame{
width: 500 Layout.preferredWidth: 500
height: 370 Layout.preferredHeight: 370
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluChart{ FluChart{
anchors.fill: parent anchors.fill: parent

View File

@ -9,10 +9,10 @@ FluScrollablePage{
title: qsTr("Radar Chart") title: qsTr("Radar Chart")
FluArea{ FluFrame{
width: 500 Layout.preferredWidth: 500
height: 370 Layout.preferredHeight: 370
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluChart{ FluChart{
anchors.fill: parent anchors.fill: parent

View File

@ -13,10 +13,10 @@ FluScrollablePage{
return Math.random().toFixed(1); return Math.random().toFixed(1);
} }
FluArea{ FluFrame{
height: 370 Layout.preferredWidth: 500
width: 500 Layout.preferredHeight: 370
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluChart{ FluChart{
anchors.fill: parent anchors.fill: parent
@ -119,5 +119,4 @@ FluScrollablePage{
} }
} }
} }
} }

View File

@ -135,7 +135,11 @@ FluExpander{
"FluLoadingButton", "FluLoadingButton",
"FluClip", "FluClip",
"FluNetwork", "FluNetwork",
"FluShortcutPicker" "FluShortcutPicker",
"FluWindowResultLauncher",
"FluRouter",
"FluGroupBox",
"FluSheet",
]; ];
code = code.replace(/\n/g, "<br>"); code = code.replace(/\n/g, "<br>");
code = code.replace(/ /g, "&nbsp;"); code = code.replace(/ /g, "&nbsp;");

View File

@ -0,0 +1,10 @@
pragma Singleton
import QtQuick 2.15
import FluentUI 1.0
QtObject{
property int displayMode: FluNavigationViewType.Auto
}

View File

@ -16,7 +16,7 @@ FluObject{
title:qsTr("About") title:qsTr("About")
icon:FluentIcons.Contact icon:FluentIcons.Contact
onTapListener:function(){ onTapListener:function(){
FluApp.navigate("/about") FluRouter.navigate("/about")
} }
} }

View File

@ -104,6 +104,12 @@ FluObject{
url: "qrc:/example/qml/page/T_ToggleSwitch.qml" url: "qrc:/example/qml/page/T_ToggleSwitch.qml"
onTap: { navigationView.push(url) } onTap: { navigationView.push(url) }
} }
FluPaneItem{
title: qsTr("GroupBox")
menuDelegate: paneItemMenu
url: "qrc:/example/qml/page/T_GroupBox.qml"
onTap: { navigationView.push(url) }
}
FluPaneItem{ FluPaneItem{
title: qsTr("PaneItem Disabled") title: qsTr("PaneItem Disabled")
disabled: true disabled: true
@ -271,6 +277,12 @@ FluObject{
url: "qrc:/example/qml/page/T_Menu.qml" url: "qrc:/example/qml/page/T_Menu.qml"
onTap: { navigationView.push(url) } onTap: { navigationView.push(url) }
} }
FluPaneItem{
title: qsTr("Sheet")
menuDelegate: paneItemMenu
url: "qrc:/example/qml/page/T_Sheet.qml"
onTap: { navigationView.push(url) }
}
} }
FluPaneItemExpander{ FluPaneItemExpander{
@ -352,9 +364,9 @@ FluObject{
onTap: { navigationView.push(url) } onTap: { navigationView.push(url) }
} }
FluPaneItem{ FluPaneItem{
title: qsTr("Awesome") title: qsTr("Icons")
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
url: "qrc:/example/qml/page/T_Awesome.qml" url: "qrc:/example/qml/page/T_Icons.qml"
onTap: { navigationView.push(url) } onTap: { navigationView.push(url) }
} }
} }
@ -414,6 +426,12 @@ FluObject{
FluPaneItemExpander{ FluPaneItemExpander{
title: qsTr("Other") title: qsTr("Other")
icon: FluentIcons.Shop icon: FluentIcons.Shop
FluPaneItem{
title: qsTr("OpenGL")
menuDelegate: paneItemMenu
url: "qrc:/example/qml/page/T_OpenGL.qml"
onTap: { navigationView.push(url) }
}
FluPaneItem{ FluPaneItem{
title: qsTr("QRCode") title: qsTr("QRCode")
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
@ -462,21 +480,17 @@ FluObject{
FluPaneItem{ FluPaneItem{
title: qsTr("Hot Loader") title: qsTr("Hot Loader")
onTapListener: function(){ onTapListener: function(){
FluApp.navigate("/hotload") FluRouter.navigate("/hotload")
} }
} }
FluPaneItem{
title: qsTr("3D")
menuDelegate: paneItemMenu
url: "qrc:/example/qml/page/T_3D.qml"
onTap: { navigationView.push(url) }
}
FluPaneItem{ FluPaneItem{
title: qsTr("Test Crash") title: qsTr("Test Crash")
visible: FluTools.isWin()
onTapListener: function(){ onTapListener: function(){
AppInfo.testCrash() AppInfo.testCrash()
} }
Component.onCompleted: {
visible = FluTools.isWin()
}
} }
} }

View File

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

View File

@ -1,116 +0,0 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import Qt3D.Core 2.15
import Qt3D.Render 2.15
import Qt3D.Input 2.12
import Qt3D.Extras 2.15
import QtQuick.Scene3D 2.15
import Qt.labs.platform 1.1
import FluentUI 1.0
import "../component"
FluContentPage{
id:root
title:"3D"
Scene3D{
id:scene_3d
anchors.fill: parent
focus: true
aspects: ["input", "logic"]
cameraAspectRatioMode: Scene3D.AutomaticAspectRatio
Entity {
Camera {
id: camera
projectionType: CameraLens.PerspectiveProjection
fieldOfView: 22.5
aspectRatio: scene_3d.width / scene_3d.height
nearPlane: 1
farPlane: 1000.0
viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
position: Qt.vector3d( 0.0, 0.0, 15.0 )
}
FirstPersonCameraController {
linearSpeed: 100
lookSpeed: 50
camera: camera
}
components: [
RenderSettings{
activeFrameGraph: ForwardRenderer{
clearColor: Qt.rgba(0,0,0,0);
camera: camera
}
},
InputSettings{}
]
Mesh {
id: mesh
source: "https://zhu-zichu.gitee.io/test.obj"
}
PhongMaterial {
id: material
ambient: color_picker.current
}
Transform{
id:transform
scale: 1.0
translation: Qt.vector3d(0, 0, 0)
rotation: fromEulerAngles(0, 0, 0)
property real hAngle:0.0
NumberAnimation on hAngle{
from:0
to:360.0
duration: 5000
loops: Animation.Infinite
}
matrix:{
var m=Qt.matrix4x4();
m.rotate(hAngle,Qt.vector3d(0,1,0));
m.translate(Qt.vector3d(0,0,0));
return m;
}
}
Entity {
id: entity
components: [mesh, material,transform]
}
}
}
ColumnLayout{
RowLayout{
spacing: 10
Layout.topMargin: 20
FluText{
text:"tintColor:"
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
id:color_picker
current: "gray"
}
}
FluButton{
text:"选择obj资源"
onClicked: {
file_dialog.open()
}
}
}
FileDialog {
id: file_dialog
nameFilters: ["Obj files (*.obj)"]
folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
onAccepted: {
var fileUrl = file_dialog.currentFile
mesh.source = fileUrl
}
}
}

View File

@ -11,7 +11,6 @@ FluScrollablePage{
RowLayout{ RowLayout{
spacing: 10 spacing: 10
Layout.topMargin: 20
FluText{ FluText{
text:"tintColor:" text:"tintColor:"
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@ -42,10 +41,10 @@ FluScrollablePage{
value: 32 value: 32
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 1200/4+20 Layout.preferredHeight: 1200/4+20
paddings: 10 padding: 10
Layout.topMargin: 10 Layout.topMargin: 10
FluClip{ FluClip{
width: 1920/4 width: 1920/4
@ -54,7 +53,7 @@ FluScrollablePage{
Image { Image {
id:image id:image
asynchronous: true asynchronous: true
source: "qrc:/example/res/image/bg_scenic.png" source: "qrc:/example/res/image/bg_scenic.jpg"
anchors.fill: parent anchors.fill: parent
sourceSize: Qt.size(2*width,2*height) sourceSize: Qt.size(2*width,2*height)
} }
@ -72,7 +71,7 @@ FluScrollablePage{
anchors.centerIn: parent anchors.centerIn: parent
text: "Acrylic" text: "Acrylic"
color: "#FFFFFF" color: "#FFFFFF"
font.bold: true font: FluTextStyle.Subtitle
} }
MouseArea { MouseArea {
property point clickPos: Qt.point(0,0) property point clickPos: Qt.point(0,0)
@ -95,7 +94,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'Image{ code:'Image{
id:image id:image
width: 800 width: 800

View File

@ -1,71 +0,0 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
FluContentPage {
title: qsTr("Awesome")
FluTextBox{
id:text_box
placeholderText: qsTr("Please enter a keyword")
anchors{
topMargin: 20
top:parent.top
}
}
FluFilledButton{
text: qsTr("Search")
anchors{
left: text_box.right
verticalCenter: text_box.verticalCenter
leftMargin: 14
}
onClicked: {
grid_view.model = FluTheme.awesomeList(text_box.text)
}
}
GridView{
id:grid_view
cellWidth: 80
cellHeight: 80
clip: true
boundsBehavior: GridView.StopAtBounds
model:FluTheme.awesomeList()
ScrollBar.vertical: FluScrollBar {}
anchors{
topMargin: 10
top:text_box.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}
delegate: Item {
width: 68
height: 80
FluIconButton{
id:item_icon
iconSource:modelData.icon
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
var text ="FluentIcons."+modelData.name;
FluTools.clipText(text)
showSuccess(qsTr("You Copied ")+text)
}
}
FluText {
id:item_name
font.pixelSize: 10
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: item_icon.bottom
width:parent.width
wrapMode: Text.WrapAnywhere
text: modelData.name
horizontalAlignment: Text.AlignHCenter
}
}
}
}

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Badge") title: qsTr("Badge")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20
height: 120 height: 120
paddings: 10 padding: 10
Column{ Column{
spacing: 15 spacing: 15
@ -114,7 +113,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'Rectangle{ code:'Rectangle{
width: 40 width: 40
height: 40 height: 40

View File

@ -18,11 +18,10 @@ FluScrollablePage{
breadcrumb_2.items = items breadcrumb_2.items = items
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Layout.topMargin: 20
FluBreadcrumbBar{ FluBreadcrumbBar{
id:breadcrumb_1 id:breadcrumb_1
@ -36,10 +35,10 @@ FluScrollablePage{
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 100 Layout.preferredHeight: 100
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
ColumnLayout{ ColumnLayout{
@ -77,7 +76,7 @@ FluScrollablePage{
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluBreadcrumbBar{ code:'FluBreadcrumbBar{
width:parent.width width:parent.width
separator:">" separator:">"

View File

@ -10,15 +10,14 @@ FluScrollablePage{
title: qsTr("Buttons") title: qsTr("Buttons")
FluText{ FluText{
Layout.topMargin: 20
text: qsTr("Support the Tab key to switch focus, and the Space key to perform click events") text: qsTr("Support the Tab key to switch focus, and the Space key to perform click events")
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 Layout.topMargin: 10
Layout.topMargin: 20 padding: 10
FluTextButton{ FluTextButton{
disabled: text_button_switch.checked disabled: text_button_switch.checked
@ -42,7 +41,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluTextButton{ code:'FluTextButton{
text:"Text Button" text:"Text Button"
onClicked: { onClicked: {
@ -51,10 +50,10 @@ FluScrollablePage{
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluButton{ FluButton{
@ -79,7 +78,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluButton{ code:'FluButton{
text:"Standard Button" text:"Standard Button"
onClicked: { onClicked: {
@ -88,11 +87,11 @@ FluScrollablePage{
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
Layout.topMargin: 20 Layout.topMargin: 20
paddings: 10 padding: 10
FluFilledButton{ FluFilledButton{
disabled: filled_button_switch.checked disabled: filled_button_switch.checked
@ -116,7 +115,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluFilledButton{ code:'FluFilledButton{
text:"Filled Button" text:"Filled Button"
onClicked: { onClicked: {
@ -125,11 +124,11 @@ FluScrollablePage{
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
Layout.topMargin: 20 Layout.topMargin: 20
paddings: 10 padding: 10
FluToggleButton{ FluToggleButton{
disabled:toggle_button_switch.checked disabled:toggle_button_switch.checked
@ -150,7 +149,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluToggleButton{ code:'FluToggleButton{
text:"Toggle Button" text:"Toggle Button"
onClicked: { onClicked: {
@ -172,11 +171,11 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
Layout.topMargin: 20 Layout.topMargin: 20
paddings: 10 padding: 10
FluProgressButton{ FluProgressButton{
id: btn_progress id: btn_progress
@ -202,7 +201,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluProgressButton{ code:'FluProgressButton{
text:"Progress Button" text:"Progress Button"
onClicked: { onClicked: {
@ -211,11 +210,11 @@ FluScrollablePage{
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
Layout.topMargin: 20 Layout.topMargin: 20
paddings: 10 padding: 10
FluLoadingButton{ FluLoadingButton{
id: btn_loading id: btn_loading
@ -241,7 +240,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluLoadingButton{ code:'FluLoadingButton{
text:"Loading Button" text:"Loading Button"
onClicked: { onClicked: {
@ -251,10 +250,10 @@ FluScrollablePage{
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: layout_icon_button.height + 30 Layout.preferredHeight: layout_icon_button.height + 30
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
Flow{ Flow{
id: layout_icon_button id: layout_icon_button
@ -323,7 +322,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluIconButton{ code:'FluIconButton{
iconSource:FluentIcons.ChromeCloseContrast iconSource:FluentIcons.ChromeCloseContrast
onClicked: { onClicked: {
@ -332,10 +331,10 @@ FluScrollablePage{
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluDropDownButton{ FluDropDownButton{
disabled: drop_down_button_switch.checked disabled: drop_down_button_switch.checked
@ -371,7 +370,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluDropDownButton{ code:'FluDropDownButton{
text:"DropDownButton" text:"DropDownButton"
FluMenuItem{ FluMenuItem{
@ -389,10 +388,10 @@ FluScrollablePage{
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 100 Layout.preferredHeight: 100
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluRadioButtons{ FluRadioButtons{
spacing: 8 spacing: 8
@ -424,7 +423,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluRadioButton{ code:'FluRadioButton{
checked:true checked:true
text:"Text Button" text:"Text Button"

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("CalendarPicker") title: qsTr("CalendarPicker")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 80
height: 80 padding: 10
paddings: 10
ColumnLayout{ ColumnLayout{
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
@ -28,7 +27,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluCalendarPicker{ code:'FluCalendarPicker{
}' }'

View File

@ -11,7 +11,6 @@ FluScrollablePage{
FluCaptcha{ FluCaptcha{
id: captcha id: captcha
Layout.topMargin: 20
ignoreCase:switch_case.checked ignoreCase:switch_case.checked
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent

View File

@ -22,11 +22,10 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 370 height: 370
paddings: 10 padding: 10
Layout.topMargin: 20
Column{ Column{
spacing: 15 spacing: 15
anchors{ anchors{
@ -62,10 +61,10 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 340 height: 340
paddings: 10 padding: 10
Layout.topMargin: 10 Layout.topMargin: 10
Column{ Column{
spacing: 15 spacing: 15
@ -104,7 +103,6 @@ FluScrollablePage{
horizontalAlignment: Qt.AlignHCenter horizontalAlignment: Qt.AlignHCenter
text:model.title text:model.title
color: FluColors.Grey10 color: FluColors.Grey10
font.pixelSize: 15
} }
} }
} }
@ -126,7 +124,7 @@ FluScrollablePage{
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluCarousel{ code:'FluCarousel{
id:carousel id:carousel
width: 400 width: 400

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("CheckBox") title: qsTr("CheckBox")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 72 Layout.preferredHeight: 72
paddings: 10 padding: 10
Layout.topMargin: 20
FluText{ FluText{
text: qsTr("A 2-state CheckBox") text: qsTr("A 2-state CheckBox")
@ -49,16 +48,16 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluCheckBox{ code:'FluCheckBox{
text:"Text" text:"Text"
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 72 Layout.preferredHeight: 72
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluText{ FluText{
@ -104,7 +103,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluCheckBox{ code:'FluCheckBox{
text:"Text" text:"Text"
indeterminate:true indeterminate:true

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Clip") title: qsTr("Clip")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 380
height: 380 padding: 10
paddings: 10
Column{ Column{
spacing: 15 spacing: 15
@ -88,7 +87,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluClip{ code:'FluClip{
radius: [25,25,25,25] radius: [25,25,25,25]
width: 50 width: 50

View File

@ -9,31 +9,21 @@ FluScrollablePage{
title: qsTr("ColorPicker") title: qsTr("ColorPicker")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 60
height: 60 padding: 10
paddings: 10
RowLayout{ RowLayout{
FluText{ FluText{
text: qsTr("Click to Select a Color - >") text: qsTr("Click to Select a Color - >")
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }
FluColorPicker{ FluColorPicker{}
cancelText: qsTr("Cancel")
okText: qsTr("OK")
titleText: qsTr("Color Picker")
editText: qsTr("Edit Color")
redText: qsTr("Red")
greenText: qsTr("Green")
blueText: qsTr("Blue")
opacityText: qsTr("Opacity")
}
} }
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluColorPicker{ code:'FluColorPicker{
}' }'

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("ComboBox") title: qsTr("ComboBox")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 80 Layout.preferredHeight: 80
paddings: 5 padding: 5
Layout.topMargin: 20
Column{ Column{
spacing: 5 spacing: 5
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -32,10 +31,10 @@ FluScrollablePage{
} }
} }
FluArea { FluFrame {
Layout.fillWidth: true Layout.fillWidth: true
height: 80 Layout.preferredHeight: 80
paddings: 5 padding: 5
Layout.topMargin: 20 Layout.topMargin: 20
Column{ Column{
spacing: 5 spacing: 5
@ -56,10 +55,10 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 80 height: 80
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
Column{ Column{
spacing: 5 spacing: 5
@ -85,7 +84,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluComboBox{ code:'FluComboBox{
editable: true editable: true
model: ListModel { model: ListModel {

View File

@ -7,13 +7,12 @@ import "../component"
FluScrollablePage{ FluScrollablePage{
title: qsTr("TimePicker") title: qsTr("DatePicker")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 80
height: 80 padding: 10
paddings: 10
ColumnLayout{ ColumnLayout{
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
@ -32,17 +31,17 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluDatePicker{ code:'FluDatePicker{
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 80 Layout.preferredHeight: 80
paddings: 10 padding: 10
ColumnLayout{ ColumnLayout{
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
@ -61,7 +60,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluDatePicker{ code:'FluDatePicker{
showYear:false showYear:false
}' }'

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Dialog") title: qsTr("Dialog")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Layout.topMargin: 20
FluButton{ FluButton{
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: qsTr("Show Double Button Dialog") text: qsTr("Show Double Button Dialog")
@ -24,7 +23,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluContentDialog{ code:'FluContentDialog{
id:dialog id:dialog
title: qsTr("Friendly Reminder") title: qsTr("Friendly Reminder")
@ -57,10 +56,10 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluButton{ FluButton{
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -72,7 +71,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluContentDialog{ code:'FluContentDialog{
id: dialog id: dialog
title: qsTr("Friendly Reminder") title: qsTr("Friendly Reminder")
@ -114,10 +113,10 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 100 Layout.preferredHeight: 100
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluButton{ FluButton{
anchors.top: parent.top anchors.top: parent.top
@ -138,7 +137,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluContentDialog{ code:'FluContentDialog{
id: dialog id: dialog
title: qsTr("Friendly Reminder") title: qsTr("Friendly Reminder")

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Expander") title: qsTr("Expander")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: layout_column.height+20 height: layout_column.height+20
paddings: 10 padding: 10
Layout.topMargin: 20
Column{ Column{
id:layout_column id:layout_column
spacing: 15 spacing: 15
@ -83,7 +82,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluExpander{ code:'FluExpander{
headerText: qsTr("Open a radio box") headerText: qsTr("Open a radio box")
Item{ Item{

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("FlipView") title: qsTr("FlipView")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 340 Layout.preferredHeight: 340
paddings: 10 padding: 10
Layout.topMargin: 20
ColumnLayout{ ColumnLayout{
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
FluText{ FluText{
@ -40,7 +39,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluFlipView{ code:'FluFlipView{
Image{ Image{
source: "qrc:/example/res/image/banner_1.jpg" source: "qrc:/example/res/image/banner_1.jpg"
@ -61,10 +60,10 @@ FluScrollablePage{
' '
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 340 height: 340
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
ColumnLayout{ ColumnLayout{
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -93,7 +92,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluFlipView{ code:'FluFlipView{
vertical:true vertical:true
Image{ Image{

View File

@ -0,0 +1,80 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "../component"
FluScrollablePage{
title: qsTr("GroupBox")
FluGroupBox {
title: qsTr("CheckBox Group")
ColumnLayout {
spacing: 10
anchors.fill: parent
FluCheckBox { text: qsTr("E-mail") }
FluCheckBox { text: qsTr("Calendar") }
FluCheckBox { text: qsTr("Contacts") }
}
}
FluGroupBox {
title: qsTr("RadioButton Group")
Layout.fillWidth: true
Layout.preferredHeight: 150
Layout.topMargin: 20
FluRadioButtons {
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
spacing: 10
disabled: radio_button_switch.checked
FluRadioButton { text: qsTr("E-mail") }
FluRadioButton { text: qsTr("Calendar") }
FluRadioButton { text: qsTr("Contacts") }
}
FluToggleSwitch{
id: radio_button_switch
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text: qsTr("Disabled")
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: 4
code:`
FluGroupBox {
title: qsTr("CheckBox Group")
ColumnLayout {
spacing: 10
anchors.fill: parent
FluCheckBox { text: qsTr("E-mail") }
FluCheckBox { text: qsTr("Calendar") }
FluCheckBox { text: qsTr("Contacts") }
}
}
FluGroupBox {
title: qsTr("RadioButton Group")
FluRadioButtons {
spacing: 10
disabled: true // 禁用所有FluRadioButton子组件
manuallyDisabled: true // 是否指定每个FluRadioButton上的disabled选项
FluRadioButton { text: qsTr("E-mail") }
FluRadioButton { text: qsTr("Calendar") }
FluRadioButton { text: qsTr("Contacts") }
}
}
`
}
}

View File

@ -9,11 +9,8 @@ import "../global"
FluScrollablePage{ FluScrollablePage{
launchMode: FluPageType.SingleTask launchMode: FluPageType.SingleTask
animDisabled: true animationEnabled: false
header: Item{}
FluentInitalizrWindow{
id:fluent_initalizr
}
ListModel{ ListModel{
id: model_header id: model_header
@ -28,11 +25,11 @@ FluScrollablePage{
} }
ListElement{ ListElement{
icon: "qrc:/example/res/image/favicon.ico" icon: "qrc:/example/res/image/favicon.ico"
title: qsTr("FluentUI Initalizr") title: qsTr("FluentUI Initializr")
desc: qsTr("FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options.") desc: qsTr("FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options.")
url: "https://github.com/zhuzichu520/FluentUI" url: "https://github.com/zhuzichu520/FluentUI"
clicked: function(model){ clicked: function(model){
fluent_initalizr.showDialog() fluent_Initializr.showDialog()
} }
} }
} }
@ -121,6 +118,7 @@ FluScrollablePage{
Layout.leftMargin: 20 Layout.leftMargin: 20
color: FluColors.Grey120 color: FluColors.Grey120
font.pixelSize: 12 font.pixelSize: 12
font.family: FluTextStyle.family
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
} }
} }
@ -177,7 +175,7 @@ FluScrollablePage{
property string desc: modelData.extra.desc property string desc: modelData.extra.desc
width: 320 width: 320
height: 120 height: 120
FluArea{ FluFrame{
radius: 8 radius: 8
width: 300 width: 300
height: 100 height: 100

View File

@ -0,0 +1,64 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
FluContentPage {
title: qsTr("Icons")
FluTextBox{
id: text_box
placeholderText: qsTr("Please enter a keyword")
anchors{
top: parent.top
}
onTextChanged: {
grid_view.model = FluApp.iconData(text_box.text)
}
}
GridView{
id: grid_view
cellWidth: 110
cellHeight: 110
clip: true
boundsBehavior: GridView.StopAtBounds
model: FluApp.iconData()
ScrollBar.vertical: FluScrollBar {}
anchors{
topMargin: 10
top: text_box.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}
delegate: Item {
width: 100
height: 100
FluIconButton{
id:item_icon
iconSource: modelData.icon
iconSize: 30
padding: 0
verticalPadding: 0
horizontalPadding: 0
bottomPadding: 30
anchors.fill: parent
onClicked: {
var text ="FluentIcons."+modelData.name;
FluTools.clipText(text)
showSuccess(qsTr("You Copied ")+text)
}
FluText{
width: parent.width
horizontalAlignment: Qt.AlignHCenter
wrapMode: Text.WrapAnywhere
text: modelData.name
anchors.top: parent.top
anchors.topMargin: 60
}
}
}
}
}

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Image") title: qsTr("Image")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 260 Layout.preferredHeight: 260
paddings: 10 padding: 10
Layout.topMargin: 20
Column{ Column{
spacing: 15 spacing: 15
anchors{ anchors{
@ -37,7 +36,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluImage{ code:'FluImage{
width: 400 width: 400
height: 300 height: 300

View File

@ -9,11 +9,14 @@ FluScrollablePage{
title: qsTr("InfoBar") title: qsTr("InfoBar")
FluArea{ property var info1
property var info2
property var info3
FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 350
height: 270 padding: 10
paddings: 10
ColumnLayout{ ColumnLayout{
spacing: 14 spacing: 14
anchors{ anchors{
@ -50,6 +53,51 @@ FluScrollablePage{
showInfo(qsTr("This is an InfoBar in the Info Style"),0,qsTr("Manual shutdown is supported")) showInfo(qsTr("This is an InfoBar in the Info Style"),0,qsTr("Manual shutdown is supported"))
} }
} }
FluText{
wrapMode: Text.WrapAnywhere
width: parent.width
text: qsTr("Manually close the info message box")
}
Row{
spacing: 5
FluButton{
text: (info1 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info1")
onClicked: {
if(info1) {
info1.close()
return
}
info1 = showInfo(qsTr("This is an '%1'").arg("info1"), 0)
}
}
FluButton{
text: (info2 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info2")
onClicked: {
if(info2) {
info2.close()
return
}
info2 = showInfo(qsTr("This is an '%1'").arg("info2"), 0)
}
}
FluButton{
text: (info3 ? qsTr("close '%1'") : qsTr("show '%1")).arg("info3")
onClicked: {
if(info3) {
info3.close()
return
}
info3 = showInfo(qsTr("This is an '%1'").arg("info3"), 0)
}
}
FluButton{
text: qsTr("clear all info")
onClicked: {
clearAllInfo()
}
}
}
FluButton{ FluButton{
text:"Loading" text:"Loading"
onClicked: { onClicked: {
@ -60,13 +108,18 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'showInfo(qsTr("This is an InfoBar in the Info Style")) code:`
showInfo(qsTr("This is an InfoBar in the Info Style"))
showWarning(qsTr("This is an InfoBar in the Warning Style")) showWarning(qsTr("This is an InfoBar in the Warning Style"))
showError(qsTr("This is an InfoBar in the Error Style")) showError(qsTr("This is an InfoBar in the Error Style"))
showSuccess(qsTr("This is an InfoBar in the Success Style"))' showSuccess(qsTr("This is an InfoBar in the Success Style"))
var info1 = showInfo(qsTr("This is an 'Info1'"), 0)
info1.close()
`
} }
} }

View File

@ -47,11 +47,10 @@ FluScrollablePage{
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 100 Layout.preferredHeight: 100
paddings: 10 padding: 10
Layout.topMargin: 20
Column{ Column{
id: layout_column id: layout_column
spacing: 15 spacing: 15
@ -78,7 +77,7 @@ FluScrollablePage{
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluMenu{ code:'FluMenu{
id:menu id:menu
FluMenuItem:{ FluMenuItem:{
@ -99,10 +98,10 @@ menu.popup()
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 100 Layout.preferredHeight: 100
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
Column{ Column{
spacing: 15 spacing: 15
@ -151,7 +150,7 @@ menu.popup()
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluMenuBar{ code:'FluMenuBar{
id:menu id:menu
FluMenu:{ FluMenu:{

View File

@ -8,23 +8,23 @@ import "../component"
FluScrollablePage{ FluScrollablePage{
property string password: "" property string password: ""
property var loginPageRegister: registerForWindowResult("/login")
title: qsTr("MultiWindow") title: qsTr("MultiWindow")
Connections{ FluWindowResultLauncher{
target: loginPageRegister id:loginResultLauncher
function onResult(data) path: "/login"
{ onResult:
password = data.password (data)=>{
} password = data.password
}
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 86 Layout.preferredHeight: 86
paddings: 10 padding: 10
Layout.topMargin: 20
Column{ Column{
spacing: 15 spacing: 15
anchors{ anchors{
@ -37,16 +37,16 @@ FluScrollablePage{
FluButton{ FluButton{
text: qsTr("Create Window") text: qsTr("Create Window")
onClicked: { onClicked: {
FluApp.navigate("/standardWindow") FluRouter.navigate("/standardWindow")
} }
} }
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 86 Layout.preferredHeight: 86
paddings: 10 padding: 10
Layout.topMargin: 10 Layout.topMargin: 10
Column{ Column{
spacing: 15 spacing: 15
@ -61,16 +61,16 @@ FluScrollablePage{
FluButton{ FluButton{
text: qsTr("Create Window") text: qsTr("Create Window")
onClicked: { onClicked: {
FluApp.navigate("/singleTaskWindow") FluRouter.navigate("/singleTaskWindow")
} }
} }
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 86 Layout.preferredHeight: 86
paddings: 10 padding: 10
Layout.topMargin: 10 Layout.topMargin: 10
Column{ Column{
spacing: 15 spacing: 15
@ -84,14 +84,14 @@ FluScrollablePage{
FluButton{ FluButton{
text: qsTr("Create Window") text: qsTr("Create Window")
onClicked: { onClicked: {
FluApp.navigate("/singleInstanceWindow") FluRouter.navigate("/singleInstanceWindow")
} }
} }
} }
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluWindow{ code:'FluWindow{
//launchMode: FluWindowType.Standard //launchMode: FluWindowType.Standard
//launchMode: FluWindowType.SingleTask //launchMode: FluWindowType.SingleTask
@ -101,10 +101,10 @@ FluScrollablePage{
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 100 Layout.preferredHeight: 100
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
Column{ Column{
spacing: 15 spacing: 15
@ -118,27 +118,27 @@ FluScrollablePage{
FluButton{ FluButton{
text: qsTr("Create Window") text: qsTr("Create Window")
onClicked: { onClicked: {
FluApp.navigate("/about") FluRouter.navigate("/about")
} }
} }
} }
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluButton{ code:'FluButton{
text: qsTr("Create Window") text: qsTr("Create Window")
onClicked: { onClicked: {
FluApp.navigate("/about") FluRouter.navigate("/about")
} }
} }
' '
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 130 Layout.preferredHeight: 130
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
Column{ Column{
@ -153,7 +153,7 @@ FluScrollablePage{
FluButton{ FluButton{
text: qsTr("Create Window") text: qsTr("Create Window")
onClicked: { onClicked: {
loginPageRegister.launch({username:"zhuzichu"}) loginResultLauncher.launch({username:"zhuzichu"})
} }
} }
FluText{ FluText{
@ -163,21 +163,20 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'property var loginPageRegister: registerForWindowResult("/login") code:'FluWindowResultLauncher{
id:loginResultLauncher
Connections{ path: "/login"
target: loginPageRegister onResult:
function onResult(data) (data)=>{
{ password = data.password
password = data.password }
}
} }
FluButton{ FluButton{
text: qsTr("Create Window") text: qsTr("Create Window")
onClicked: { onClicked: {
loginPageRegister.launch({username:"zhuzichu"}) loginResultLauncher.launch({username:"zhuzichu"})
} }
} }
' '

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import FluentUI 1.0 import FluentUI 1.0
import Qt.labs.platform 1.0 import Qt.labs.platform 1.0
import example 1.0
import "../component" import "../component"
FluContentPage{ FluContentPage{
@ -11,7 +12,7 @@ FluContentPage{
id:root id:root
title: qsTr("Network") title: qsTr("Network")
FluNetworkCallable{ NetworkCallable{
id:callable id:callable
onStart: { onStart: {
showLoading() showLoading()
@ -39,7 +40,6 @@ FluContentPage{
clip: true clip: true
anchors{ anchors{
top: parent.top top: parent.top
topMargin: 20
bottom: parent.bottom bottom: parent.bottom
left: parent.left left: parent.left
} }
@ -56,7 +56,7 @@ FluContentPage{
text: "Get" text: "Get"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.get("https://httpbingo.org/get") Network.get("https://httpbingo.org/get")
.addQuery("name","孙悟空") .addQuery("name","孙悟空")
.addQuery("age",500) .addQuery("age",500)
.addQuery("address","花果山水帘洞") .addQuery("address","花果山水帘洞")
@ -70,7 +70,7 @@ FluContentPage{
text: "Head" text: "Head"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.head("https://httpbingo.org/head") Network.head("https://httpbingo.org/head")
.addQuery("name","孙悟空") .addQuery("name","孙悟空")
.addQuery("age",500) .addQuery("age",500)
.addQuery("address","花果山水帘洞") .addQuery("address","花果山水帘洞")
@ -84,7 +84,7 @@ FluContentPage{
text: "Post Body" text: "Post Body"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.postBody("https://httpbingo.org/post") Network.postBody("https://httpbingo.org/post")
.setBody("花果山水帘洞美猴王齐天大圣孙悟空") .setBody("花果山水帘洞美猴王齐天大圣孙悟空")
.bind(root) .bind(root)
.go(callable) .go(callable)
@ -96,7 +96,7 @@ FluContentPage{
text: "Post Form" text: "Post Form"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.postForm("https://httpbingo.org/post") Network.postForm("https://httpbingo.org/post")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -110,7 +110,7 @@ FluContentPage{
text: "Post JSON" text: "Post JSON"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.postJson("https://httpbingo.org/post") Network.postJson("https://httpbingo.org/post")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -124,7 +124,7 @@ FluContentPage{
text: "Post JSON Array" text: "Post JSON Array"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.postJsonArray("https://httpbingo.org/post") Network.postJsonArray("https://httpbingo.org/post")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -138,7 +138,7 @@ FluContentPage{
text: "Put Body" text: "Put Body"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.putBody("https://httpbingo.org/put") Network.putBody("https://httpbingo.org/put")
.setBody("花果山水帘洞美猴王齐天大圣孙悟空") .setBody("花果山水帘洞美猴王齐天大圣孙悟空")
.bind(root) .bind(root)
.go(callable) .go(callable)
@ -150,7 +150,7 @@ FluContentPage{
text: "Put Form" text: "Put Form"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.putForm("https://httpbingo.org/put") Network.putForm("https://httpbingo.org/put")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -164,7 +164,7 @@ FluContentPage{
text: "Put JSON" text: "Put JSON"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.putJson("https://httpbingo.org/put") Network.putJson("https://httpbingo.org/put")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -178,7 +178,7 @@ FluContentPage{
text: "Put JSON Array" text: "Put JSON Array"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.putJsonArray("https://httpbingo.org/put") Network.putJsonArray("https://httpbingo.org/put")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -192,7 +192,7 @@ FluContentPage{
text: "Patch Body" text: "Patch Body"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.patchBody("https://httpbingo.org/patch") Network.patchBody("https://httpbingo.org/patch")
.setBody("花果山水帘洞美猴王齐天大圣孙悟空") .setBody("花果山水帘洞美猴王齐天大圣孙悟空")
.bind(root) .bind(root)
.go(callable) .go(callable)
@ -204,7 +204,7 @@ FluContentPage{
text: "Patch Form" text: "Patch Form"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.patchForm("https://httpbingo.org/patch") Network.patchForm("https://httpbingo.org/patch")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -218,7 +218,7 @@ FluContentPage{
text: "Patch JSON" text: "Patch JSON"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.patchJson("https://httpbingo.org/patch") Network.patchJson("https://httpbingo.org/patch")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -232,7 +232,7 @@ FluContentPage{
text: "Patch JSON Array" text: "Patch JSON Array"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.patchJsonArray("https://httpbingo.org/patch") Network.patchJsonArray("https://httpbingo.org/patch")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -246,7 +246,7 @@ FluContentPage{
text: "Delete Body" text: "Delete Body"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.deleteBody("https://httpbingo.org/delete") Network.deleteBody("https://httpbingo.org/delete")
.setBody("花果山水帘洞美猴王齐天大圣孙悟空") .setBody("花果山水帘洞美猴王齐天大圣孙悟空")
.bind(root) .bind(root)
.go(callable) .go(callable)
@ -258,7 +258,7 @@ FluContentPage{
text: "Delete Form" text: "Delete Form"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.deleteForm("https://httpbingo.org/delete") Network.deleteForm("https://httpbingo.org/delete")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -272,7 +272,7 @@ FluContentPage{
text: "Delete JSON" text: "Delete JSON"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.deleteJson("https://httpbingo.org/delete") Network.deleteJson("https://httpbingo.org/delete")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -286,7 +286,7 @@ FluContentPage{
text: "Delete JSON Array" text: "Delete JSON Array"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.deleteJsonArray("https://httpbingo.org/delete") Network.deleteJsonArray("https://httpbingo.org/delete")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -300,7 +300,7 @@ FluContentPage{
text: "Open Log" text: "Open Log"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.postJson("https://httpbingo.org/post") Network.postJson("https://httpbingo.org/post")
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -315,7 +315,7 @@ FluContentPage{
text: "Custom Header" text: "Custom Header"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.postJson("https://httpbingo.org/post") Network.postJson("https://httpbingo.org/post")
.addHeader("os","PC") .addHeader("os","PC")
.addHeader("version","1.0.0") .addHeader("version","1.0.0")
.add("name","孙悟空") .add("name","孙悟空")
@ -331,8 +331,8 @@ FluContentPage{
text: "RequestFailedReadCache" text: "RequestFailedReadCache"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.postJson("https://httpbingo.org/post") Network.postJson("https://httpbingo.org/post")
.setCacheMode(FluNetworkType.RequestFailedReadCache) .setCacheMode(NetworkType.RequestFailedReadCache)
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -347,8 +347,8 @@ FluContentPage{
text: "IfNoneCacheRequest" text: "IfNoneCacheRequest"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.postJson("https://httpbingo.org/post") Network.postJson("https://httpbingo.org/post")
.setCacheMode(FluNetworkType.IfNoneCacheRequest) .setCacheMode(NetworkType.IfNoneCacheRequest)
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -363,8 +363,8 @@ FluContentPage{
text: "FirstCacheThenRequest" text: "FirstCacheThenRequest"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.postJson("https://httpbingo.org/post") Network.postJson("https://httpbingo.org/post")
.setCacheMode(FluNetworkType.FirstCacheThenRequest) .setCacheMode(NetworkType.FirstCacheThenRequest)
.add("name","孙悟空") .add("name","孙悟空")
.add("age",500) .add("age",500)
.add("address","花果山水帘洞") .add("address","花果山水帘洞")
@ -379,7 +379,7 @@ FluContentPage{
text: "Timeout And Retry" text: "Timeout And Retry"
onClicked: { onClicked: {
text_info.text = "" text_info.text = ""
FluNetwork.postJson("https://httpbingo.org/post") Network.postJson("https://httpbingo.org/post")
.setTimeout(5000) .setTimeout(5000)
.setRetry(3) .setRetry(3)
.add("name","孙悟空") .add("name","孙悟空")
@ -407,7 +407,7 @@ FluContentPage{
text: "Download File" text: "Download File"
onClicked: { onClicked: {
folder_dialog.showDialog(function(path){ folder_dialog.showDialog(function(path){
FluNetwork.get("http://vjs.zencdn.net/v/oceans.mp4") Network.get("http://vjs.zencdn.net/v/oceans.mp4")
.toDownload(path) .toDownload(path)
.bind(root) .bind(root)
.go(callable_download_file) .go(callable_download_file)
@ -421,7 +421,7 @@ FluContentPage{
text: "Breakpoint Download File" text: "Breakpoint Download File"
onClicked: { onClicked: {
folder_dialog.showDialog(function(path){ folder_dialog.showDialog(function(path){
FluNetwork.get("http://vjs.zencdn.net/v/oceans.mp4") Network.get("http://vjs.zencdn.net/v/oceans.mp4")
.toDownload(path,true) .toDownload(path,true)
.bind(root) .bind(root)
.go(callable_breakpoint_download_file) .go(callable_breakpoint_download_file)
@ -431,7 +431,7 @@ FluContentPage{
} }
} }
FluNetworkCallable{ NetworkCallable{
id:callable_upload_file id:callable_upload_file
onStart: { onStart: {
btn_upload.disabled = true btn_upload.disabled = true
@ -455,7 +455,7 @@ FluContentPage{
} }
} }
FluNetworkCallable{ NetworkCallable{
id:callable_download_file id:callable_download_file
onStart: { onStart: {
btn_download.progress = 0 btn_download.progress = 0
@ -480,7 +480,7 @@ FluContentPage{
} }
} }
FluNetworkCallable{ NetworkCallable{
id:callable_breakpoint_download_file id:callable_breakpoint_download_file
onStart: { onStart: {
btn_download_breakpoint.progress = 0 btn_download_breakpoint.progress = 0
@ -508,7 +508,7 @@ FluContentPage{
FileDialog { FileDialog {
id: file_dialog id: file_dialog
onAccepted: { onAccepted: {
FluNetwork.postForm("https://httpbingo.org/post") Network.postForm("https://httpbingo.org/post")
.setRetry(1)//只请求一次 .setRetry(1)//只请求一次
.add("accessToken","12345678") .add("accessToken","12345678")
.addFile("file",FluTools.toLocalPath(file_dialog.currentFile)) .addFile("file",FluTools.toLocalPath(file_dialog.currentFile))
@ -532,7 +532,7 @@ FluContentPage{
} }
} }
FluArea{ FluFrame{
anchors{ anchors{
top: layout_flick.top top: layout_flick.top
bottom: layout_flick.bottom bottom: layout_flick.bottom

View File

@ -0,0 +1,26 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import example 1.0
import "../component"
FluContentPage{
title: qsTr("OpenGL")
FluFrame{
anchors.fill: parent
OpenGLItem{
anchors.fill: parent
SequentialAnimation on t {
NumberAnimation { to: 1; duration: 2500; easing.type: Easing.InQuad }
NumberAnimation { to: 0; duration: 2500; easing.type: Easing.OutQuad }
loops: Animation.Infinite
running: true
}
}
}
}

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Pagination") title: qsTr("Pagination")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 200 Layout.preferredHeight: 200
paddings: 10 padding: 10
Layout.topMargin: 20
ColumnLayout{ ColumnLayout{
spacing: 20 spacing: 20
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -37,7 +36,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluPagination{ code:'FluPagination{
pageCurrent: 1 pageCurrent: 1
itemCount: 1000 itemCount: 1000

View File

@ -9,13 +9,10 @@ FluScrollablePage{
title: qsTr("Pivot") title: qsTr("Pivot")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 400
height: 400 padding: 10
paddings: 10
FluPivot{ FluPivot{
anchors.fill: parent anchors.fill: parent
@ -49,7 +46,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluPivot{ code:'FluPivot{
anchors.fill: parent anchors.fill: parent
FluPivotItem:{ FluPivotItem:{

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Progress") title: qsTr("Progress")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 130
height: 130 padding: 10
paddings: 10
ColumnLayout{ ColumnLayout{
spacing: 10 spacing: 10
@ -32,7 +31,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluProgressBar{ code:'FluProgressBar{
} }
@ -42,11 +41,11 @@ FluProgressRing{
' '
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 286 Layout.preferredHeight: 286
paddings: 10 padding: 10
ColumnLayout{ ColumnLayout{
spacing: 10 spacing: 10
@ -88,7 +87,7 @@ FluProgressRing{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluProgressBar{ code:'FluProgressBar{
indeterminate: false indeterminate: false
} }

View File

@ -11,7 +11,6 @@ FluScrollablePage{
FluQRCode{ FluQRCode{
id:qrcode id:qrcode
Layout.topMargin: 20
size:slider_size.value size:slider_size.value
text:text_box.text text:text_box.text
color:color_picker.current color:color_picker.current

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("RadioButton") title: qsTr("RadioButton")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Layout.topMargin: 20
Row{ Row{
spacing: 30 spacing: 30
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -41,34 +40,33 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluRadioButton{ code:'FluRadioButton{
text:"Text" text:"Text"
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 100 Layout.preferredHeight: 100
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluRadioButtons{ FluRadioButtons{
spacing: 8 spacing: 8
disabled: radio_button_switch2.checked
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left: parent.left left: parent.left
} }
currentIndex: 1
FluRadioButton{ FluRadioButton{
disabled: radio_button_switch2.checked
text: qsTr("Radio Button_1") text: qsTr("Radio Button_1")
} }
FluRadioButton{ FluRadioButton{
disabled: radio_button_switch2.checked
text: qsTr("Radio Button_2") text: qsTr("Radio Button_2")
} }
FluRadioButton{ FluRadioButton{
disabled: radio_button_switch2.checked
text: qsTr("Radio Button_3") text: qsTr("Radio Button_3")
} }
} }
@ -83,7 +81,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluRadioButtons{ code:'FluRadioButtons{
spacing: 8 spacing: 8
FluRadioButton{ FluRadioButton{
@ -98,4 +96,106 @@ FluScrollablePage{
}' }'
} }
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 60
padding: 10
Layout.topMargin: 20
FluRadioButtons{
spacing: 8
anchors.verticalCenter: parent.verticalCenter
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
disabled: radio_button_switch3.checked
orientation: Qt.Horizontal
currentIndex: 1
FluRadioButton{
text: qsTr("Radio Button_1")
}
FluRadioButton{
text: qsTr("Radio Button_2")
}
FluRadioButton{
text: qsTr("Radio Button_3")
}
}
FluToggleSwitch{
id: radio_button_switch3
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text: qsTr("Disabled")
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -6
code:'FluRadioButtons{
spacing: 8
orientation: Qt.Horizontal
FluRadioButton{
text:"Radio Button_1"
}
FluRadioButton{
text:"Radio Button_2"
}
FluRadioButton{
text:"Radio Button_3"
}
}'
}
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 100
padding: 10
Layout.topMargin: 20
FluRadioButtons{
spacing: 8
anchors.verticalCenter: parent.verticalCenter
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
disabled: radio_button_switch4.checked
currentIndex: -1
FluCheckBox{
text: qsTr("Radio Button_1")
}
FluCheckBox{
text: qsTr("Radio Button_2")
}
FluCheckBox{
text: qsTr("Radio Button_3")
}
}
FluToggleSwitch{
id: radio_button_switch4
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text: qsTr("Disabled")
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -6
code:'FluRadioButtons{
spacing: 8
FluCheckBox{
text:"Radio Button_1"
}
FluCheckBox{
text:"Radio Button_2"
}
FluCheckBox{
text:"Radio Button_3"
}
}'
}
} }

View File

@ -9,11 +9,10 @@ FluScrollablePage {
title: qsTr("RatingControl") title: qsTr("RatingControl")
FluArea { FluFrame {
Layout.fillWidth: true Layout.fillWidth: true
height: 100 Layout.preferredHeight: 100
paddings: 10 padding: 10
Layout.topMargin: 20
Column { Column {
spacing: 10 spacing: 10
@ -27,7 +26,7 @@ FluScrollablePage {
CodeExpander { CodeExpander {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code: 'FluRatingControl{ code: 'FluRatingControl{
}' }'

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Rectangle") title: qsTr("Rectangle")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 80
height: 80 padding: 10
paddings: 10
Column{ Column{
spacing: 15 spacing: 15
@ -64,7 +63,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluRectangle{ code:'FluRectangle{
radius: [25,25,25,25] radius: [25,25,25,25]
width: 50 width: 50

View File

@ -9,6 +9,6 @@ FluPage{
launchMode: FluPageType.SingleTop launchMode: FluPageType.SingleTop
FluRemoteLoader{ FluRemoteLoader{
anchors.fill: parent anchors.fill: parent
source: "https://zhu-zichu.gitee.io/Qt5_T_RemoteLoader.qml" source: "https://zhu-zichu.gitee.io/Qt_174_RemoteLoader.qml"
} }
} }

View File

@ -4,38 +4,24 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import FluentUI 1.0 import FluentUI 1.0
import "../component" import "../component"
import "../viewmodel"
import "../global" import "../global"
FluScrollablePage{ FluScrollablePage{
title: qsTr("Settings") title: qsTr("Settings")
SettingsViewModel{
id:viewmodel_settings
}
FluEvent{ FluEvent{
id:event_checkupdate_finish
name: "checkUpdateFinish" name: "checkUpdateFinish"
onTriggered: { onTriggered: {
btn_checkupdate.loading = false btn_checkupdate.loading = false
} }
} }
Component.onCompleted: { FluFrame{
FluEventBus.registerEvent(event_checkupdate_finish)
}
Component.onDestruction: {
FluEventBus.unRegisterEvent(event_checkupdate_finish)
}
FluArea{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 60 Layout.preferredHeight: 60
paddings: 10 padding: 10
Row{ Row{
spacing: 20 spacing: 20
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -56,11 +42,11 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 50 height: 50
paddings: 10 padding: 10
FluCheckBox{ FluCheckBox{
text: qsTr("Use System AppBar") text: qsTr("Use System AppBar")
checked: FluApp.useSystemAppBar checked: FluApp.useSystemAppBar
@ -72,11 +58,11 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 50 height: 50
paddings: 10 padding: 10
FluCheckBox{ FluCheckBox{
text:qsTr("Fits AppBar Windows") text:qsTr("Fits AppBar Windows")
checked: window.fitsAppBarWindows checked: window.fitsAppBarWindows
@ -95,15 +81,15 @@ FluScrollablePage{
negativeText: qsTr("Cancel") negativeText: qsTr("Cancel")
positiveText: qsTr("OK") positiveText: qsTr("OK")
onPositiveClicked: { onPositiveClicked: {
FluApp.exit(931) FluRouter.exit(931)
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 128 height: 128
paddings: 10 padding: 10
ColumnLayout{ ColumnLayout{
spacing: 5 spacing: 5
@ -129,11 +115,11 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 160 height: 160
paddings: 10 padding: 10
ColumnLayout{ ColumnLayout{
spacing: 5 spacing: 5
@ -149,10 +135,10 @@ FluScrollablePage{
Repeater{ Repeater{
model: [{title:qsTr("Open"),mode:FluNavigationViewType.Open},{title:qsTr("Compact"),mode:FluNavigationViewType.Compact},{title:qsTr("Minimal"),mode:FluNavigationViewType.Minimal},{title:qsTr("Auto"),mode:FluNavigationViewType.Auto}] model: [{title:qsTr("Open"),mode:FluNavigationViewType.Open},{title:qsTr("Compact"),mode:FluNavigationViewType.Compact},{title:qsTr("Minimal"),mode:FluNavigationViewType.Minimal},{title:qsTr("Auto"),mode:FluNavigationViewType.Auto}]
delegate: FluRadioButton{ delegate: FluRadioButton{
checked : viewmodel_settings.displayMode===modelData.mode text: modelData.title
text:modelData.title checked: GlobalModel.displayMode === modelData.mode
clickListener:function(){ clickListener:function(){
viewmodel_settings.displayMode = modelData.mode GlobalModel.displayMode = modelData.mode
} }
} }
} }
@ -169,11 +155,11 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 80 height: 80
paddings: 10 padding: 10
ColumnLayout{ ColumnLayout{
spacing: 10 spacing: 10

View File

@ -0,0 +1,90 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "../component"
FluScrollablePage{
title: qsTr("Sheet")
FluSheet{
id:sheet
title: qsTr("Title")
FluText{
text: qsTr("Some contents...\nSome contents...\nSome contents...")
anchors{
left: parent.left
leftMargin: 10
}
}
}
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 280
padding: 10
Column{
anchors.centerIn: parent
spacing: 10
Row{
spacing: 10
FluButton{
width: 80
height: 30
text: qsTr("top")
onClicked: {
sheet.open(FluSheetType.Top)
}
}
FluButton{
width: 80
height: 30
text: qsTr("right")
onClicked: {
sheet.open(FluSheetType.Right)
}
}
}
Row{
spacing: 10
FluButton{
width: 80
height: 30
text: qsTr("bottom")
onClicked: {
sheet.open(FluSheetType.Bottom)
}
}
FluButton{
width: 80
height: 30
text: qsTr("left")
onClicked: {
sheet.open(FluSheetType.Left)
}
}
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -6
code:'FluSheet{
id:sheet
title: qsTr("Title")
FluText{
text: qsTr("Some contents...")
anchors{
left: parent.left
leftMargin: 10
}
}
}
sheet.open(FluSheetType.Bottom)
'
}
}

View File

@ -9,18 +9,17 @@ FluScrollablePage{
title: qsTr("ShortcutPicker") title: qsTr("ShortcutPicker")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 100
height: 100 padding: 10
paddings: 10
FluShortcutPicker{ FluShortcutPicker{
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluShortcutPicker{ code:'FluShortcutPicker{
}' }'

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Slider") title: qsTr("Slider")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 200 Layout.preferredHeight: 200
Layout.topMargin: 20 padding: 10
paddings: 10
Row{ Row{
spacing: 30 spacing: 30
@ -27,18 +26,18 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluSlider{ code:'FluSlider{
value:50 value:50
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 200 Layout.preferredHeight: 200
Layout.topMargin: 20 Layout.topMargin: 20
paddings: 10 padding: 10
Row{ Row{
spacing: 30 spacing: 30
FluRangeSlider{ FluRangeSlider{
@ -51,7 +50,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluRangeSlider{ code:'FluRangeSlider{
orientation: Qt.Vertical orientation: Qt.Vertical
}' }'

View File

@ -13,7 +13,6 @@ FluContentPage{
id:layout_dropdown id:layout_dropdown
anchors{ anchors{
top: parent.top top: parent.top
topMargin: 20
} }
FluText{ FluText{
text:"orientation:" text:"orientation:"

View File

@ -27,7 +27,6 @@ FluContentPage{
Flickable{ Flickable{
id: scroll id: scroll
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 20
boundsBehavior:Flickable.StopAtBounds boundsBehavior:Flickable.StopAtBounds
contentHeight: staggered_view.implicitHeight contentHeight: staggered_view.implicitHeight
clip: true clip: true
@ -43,8 +42,7 @@ FluContentPage{
FluText{ FluText{
color:"#FFFFFF" color:"#FFFFFF"
text:model.index text:model.index
font.bold: true font: FluTextStyle.Title
font.pixelSize: 18
anchors.centerIn: parent anchors.centerIn: parent
} }
} }

View File

@ -9,12 +9,11 @@ FluScrollablePage{
title: qsTr("StatusLayout") title: qsTr("StatusLayout")
FluArea{ FluFrame{
id:layout_actions id:layout_actions
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 50
height: 50 padding: 10
paddings: 10
RowLayout{ RowLayout{
spacing: 14 spacing: 14
FluDropDownButton{ FluDropDownButton{
@ -53,20 +52,16 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 10 Layout.topMargin: 10
height: 380 Layout.preferredHeight: 380
paddings: 10 padding: 10
FluStatusLayout{ FluStatusLayout{
id:status_view id:status_view
anchors.fill: parent anchors.fill: parent
loadingText: qsTr("Loading...")
emptyText: qsTr("Empty")
errorText: qsTr("The page went wrong...")
errorButtonText: qsTr("Reload")
onErrorClicked:{ onErrorClicked:{
showError("Click Reload") status_view.statusMode = FluStatusLayoutType.Loading
} }
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
@ -76,7 +71,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluStatusLayout{ code:'FluStatusLayout{
anchors.fill: parent anchors.fill: parent
statusMode: FluStatusLayoutType.Loading statusMode: FluStatusLayoutType.Loading

View File

@ -29,11 +29,10 @@ FluScrollablePage{
newTab() newTab()
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 50
height: 50 padding: 10
paddings: 10
RowLayout{ RowLayout{
spacing: 14 spacing: 14
FluDropDownButton{ FluDropDownButton{
@ -91,11 +90,11 @@ FluScrollablePage{
} }
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 15 Layout.topMargin: 15
height: 400 Layout.preferredHeight: 400
paddings: 10 padding: 10
FluTabView{ FluTabView{
id:tab_view id:tab_view
onNewPressed:{ onNewPressed:{
@ -105,7 +104,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluTabView{ code:'FluTabView{
anchors.fill: parent anchors.fill: parent
Component.onCompleted: { Component.onCompleted: {

View File

@ -13,7 +13,7 @@ FluContentPage{
property var dataSource : [] property var dataSource : []
property int sortType: 0 property int sortType: 0
property bool seletedAll: true property bool selectedAll: true
property string nameKeyword: "" property string nameKeyword: ""
onNameKeywordChanged: { onNameKeywordChanged: {
@ -32,11 +32,11 @@ FluContentPage{
onCheckBoxChanged: { onCheckBoxChanged: {
for(var i =0;i< table_view.rows ;i++){ for(var i =0;i< table_view.rows ;i++){
if(false === table_view.getRow(i).checkbox.options.checked){ if(false === table_view.getRow(i).checkbox.options.checked){
root.seletedAll = false root.selectedAll = false
return return
} }
} }
root.seletedAll = true root.selectedAll = true
} }
onSortTypeChanged: { onSortTypeChanged: {
@ -159,7 +159,7 @@ FluContentPage{
FluCheckBox{ FluCheckBox{
anchors.centerIn: parent anchors.centerIn: parent
checked: true === options.checked checked: true === options.checked
enableAnimation: false animationEnabled: false
clickListener: function(){ clickListener: function(){
var obj = table_view.getRow(row) var obj = table_view.getRow(row)
obj.checkbox = table_view.customItem(com_checbox,{checked:!options.checked}) obj.checkbox = table_view.customItem(com_checbox,{checked:!options.checked})
@ -238,13 +238,15 @@ FluContentPage{
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }
FluCheckBox{ FluCheckBox{
checked: true === root.seletedAll checked: true === root.selectedAll
enableAnimation: false animationEnabled: false
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
clickListener: function(){ clickListener: function(){
root.seletedAll = !root.seletedAll root.selectedAll = !root.selectedAll
var checked = root.seletedAll var checked = root.selectedAll
itemModel.display = table_view.customItem(com_column_checbox,{"checked":checked}) var columnModel = model.display
columnModel.title = table_view.customItem(com_column_checbox,{"checked":checked})
model.display = columnModel
for(var i =0;i< table_view.rows ;i++){ for(var i =0;i< table_view.rows ;i++){
var rowData = table_view.getRow(i) var rowData = table_view.getRow(i)
rowData.checkbox = table_view.customItem(com_checbox,{"checked":checked}) rowData.checkbox = table_view.customItem(com_checbox,{"checked":checked})
@ -271,7 +273,8 @@ FluContentPage{
} }
Component.onCompleted: { Component.onCompleted: {
currentIndex=["100","300","500","1000"].findIndex((element) => element === display) currentIndex=["100","300","500","1000"].findIndex((element) => element === display)
selectAll() textBox.forceActiveFocus()
textBox.selectAll()
} }
onCommit: { onCommit: {
editTextChaged(editText) editTextChaged(editText)
@ -280,6 +283,29 @@ FluContentPage{
} }
} }
Component{
id:com_auto_suggestbox
FluAutoSuggestBox {
id: textbox
anchors.fill: parent
focus: true
Component.onCompleted: {
var data = ["傲来国界花果山水帘洞","傲来国界坎源山脏水洞","大唐国界黑风山黑风洞","大唐国界黄风岭黄风洞","大唐国界骷髅山白骨洞","宝象国界碗子山波月洞","宝象国界平顶山莲花洞","宝象国界压龙山压龙洞","乌鸡国界号山枯松涧火云洞","乌鸡国界衡阳峪黑水河河神府"]
var result = data.map(function(item) {
return {title: item};
});
items = result
textbox.text= String(display)
forceActiveFocus()
selectAll()
}
onCommit: {
editTextChaged(textbox.text)
tableView.closeEditor()
}
}
}
Component{ Component{
id:com_avatar id:com_avatar
Item{ Item{
@ -323,7 +349,9 @@ FluContentPage{
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
custom_update_dialog.showDialog(options.title,function(text){ custom_update_dialog.showDialog(options.title,function(text){
itemModel.display = table_view.customItem(com_column_update_title,{"title":text}) var columnModel = model.display
columnModel.title = table_view.customItem(com_column_update_title,{"title":text})
model.display = columnModel
}) })
} }
} }
@ -390,7 +418,7 @@ FluContentPage{
} }
} }
FluArea{ FluFrame{
id:layout_controls id:layout_controls
anchors{ anchors{
left: parent.left left: parent.left
@ -421,15 +449,15 @@ FluContentPage{
var data = [] var data = []
var rows = [] var rows = []
for (var i = 0; i < table_view.rows; i++) { for (var i = 0; i < table_view.rows; i++) {
var item = table_view.getRow(i); var item = table_view.getRow(i)
rows.push(item) rows.push(item)
if (!item.checkbox.options.checked) { if (!item.checkbox.options.checked) {
data.push(item); data.push(item);
} }
} }
var sourceModel = table_view.sourceModel; var sourceModel = table_view.sourceModel
for (i = 0; i < sourceModel.rowCount; i++) { for (i = 0; i < sourceModel.rowCount; i++) {
var sourceItem = sourceModel.getRow(i); var sourceItem = sourceModel.getRow(i)
const foundItem = rows.find(item=> item._key === sourceItem._key) const foundItem = rows.find(item=> item._key === sourceItem._key)
if (!foundItem) { if (!foundItem) {
data.push(sourceItem); data.push(sourceItem);
@ -438,14 +466,24 @@ FluContentPage{
table_view.dataSource = data table_view.dataSource = data
} }
} }
FluButton{ FluButton{
text: qsTr("Add a row of Data") text: qsTr("Add a row of Data")
onClicked: { onClicked: {
table_view.appendRow(genTestObject()) table_view.appendRow(genTestObject())
} }
} }
FluButton{
text: qsTr("Insert a Row")
onClicked: {
var index = table_view.currentIndex()
if(index !== -1){
var testObj = genTestObject()
table_view.insertRow(index,testObj)
}else{
showWarning(qsTr("Focus not acquired: Please click any item in the form as the target for insertion!"))
}
}
}
} }
} }
@ -465,20 +503,19 @@ FluContentPage{
{ {
title: table_view.customItem(com_column_checbox,{checked:true}), title: table_view.customItem(com_column_checbox,{checked:true}),
dataIndex: 'checkbox', dataIndex: 'checkbox',
width:100, frozen: true
minimumWidth:100,
maximumWidth:100
},
{
title: table_view.customItem(com_column_update_title,{title:qsTr("Avatar")}),
dataIndex: 'avatar',
width:100
}, },
{ {
title: table_view.customItem(com_column_filter_name,{title:qsTr("Name")}), title: table_view.customItem(com_column_filter_name,{title:qsTr("Name")}),
dataIndex: 'name', dataIndex: 'name',
readOnly:true readOnly:true
}, },
{
title: table_view.customItem(com_column_update_title,{title:qsTr("Avatar")}),
dataIndex: 'avatar',
width:100,
frozen:true
},
{ {
title: table_view.customItem(com_column_sort_age,{sort:0}), title: table_view.customItem(com_column_sort_age,{sort:0}),
dataIndex: 'age', dataIndex: 'age',
@ -490,6 +527,7 @@ FluContentPage{
{ {
title: qsTr("Address"), title: qsTr("Address"),
dataIndex: 'address', dataIndex: 'address',
editDelegate: com_auto_suggestbox,
width:200, width:200,
minimumWidth:100, minimumWidth:100,
maximumWidth:250 maximumWidth:250
@ -513,8 +551,7 @@ FluContentPage{
title: qsTr("Options"), title: qsTr("Options"),
dataIndex: 'action', dataIndex: 'action',
width:160, width:160,
minimumWidth:160, frozen:true
maximumWidth:160
} }
] ]
} }
@ -566,7 +603,7 @@ FluContentPage{
return avatars[randomIndex]; return avatars[randomIndex];
} }
return { return {
checkbox: table_view.customItem(com_checbox,{checked:root.seletedAll}), checkbox: table_view.customItem(com_checbox,{checked:root.selectedAll}),
avatar:table_view.customItem(com_avatar,{avatar:getAvatar()}), avatar:table_view.customItem(com_avatar,{avatar:getAvatar()}),
name: getRandomName(), name: getRandomName(),
age:getRandomAge(), age:getRandomAge(),
@ -579,7 +616,7 @@ FluContentPage{
} }
} }
function loadData(page,count){ function loadData(page,count){
root.seletedAll = true root.selectedAll = true
const dataSource = [] const dataSource = []
for(var i=0;i<count;i++){ for(var i=0;i<count;i++){
dataSource.push(genTestObject()) dataSource.push(genTestObject())

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("Text") title: qsTr("Text")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 60
height: 60 padding: 10
paddings: 10
FluCopyableText{ FluCopyableText{
text: qsTr("This is a text that can be copied") text: qsTr("This is a text that can be copied")
@ -23,7 +22,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluCopyableText{ code:'FluCopyableText{
text: qsTr("This is a text that can be copied") text: qsTr("This is a text that can be copied")
}' }'

View File

@ -4,30 +4,20 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15 import QtQuick.Window 2.15
import FluentUI 1.0 import FluentUI 1.0
import "../component" import "../component"
import "../viewmodel"
FluScrollablePage{ FluScrollablePage{
title: qsTr("TextBox") title: qsTr("TextBox")
TextBoxViewModel{ FluFrame{
id:viewModel
}
FluArea{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Layout.topMargin: 20
FluTextBox{ FluTextBox{
placeholderText: qsTr("Single-line Input Box") placeholderText: qsTr("Single-line Input Box")
disabled: text_box_switch.checked disabled: text_box_switch.checked
cleanEnabled: true cleanEnabled: true
text: viewModel.text1
onTextChanged: {
viewModel.text1 = text
}
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left: parent.left left: parent.left
@ -45,16 +35,16 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluTextBox{ code:'FluTextBox{
placeholderText: qsTr("Single-line Input Box") placeholderText: qsTr("Single-line Input Box")
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluPasswordBox{ FluPasswordBox{
@ -76,26 +66,21 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluPasswordBox{ code:'FluPasswordBox{
placeholderText: qsTr("Please enter your password") placeholderText: qsTr("Please enter your password")
}' }'
} }
FluFrame{
FluArea{
Layout.fillWidth: true Layout.fillWidth: true
height: 36+multiine_textbox.height Layout.preferredHeight: 36+multiine_textbox.height
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluMultilineTextBox{ FluMultilineTextBox{
id: multiine_textbox id: multiine_textbox
placeholderText: qsTr("Multi-line Input Box") placeholderText: qsTr("Multi-line Input Box")
text:viewModel.text2
onTextChanged: {
viewModel.text2 = text
}
disabled: text_box_multi_switch.checked disabled: text_box_multi_switch.checked
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
@ -114,16 +99,16 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluMultilineTextBox{ code:'FluMultilineTextBox{
placeholderText: qsTr("Multi-line Input Box") placeholderText: qsTr("Multi-line Input Box")
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluAutoSuggestBox{ FluAutoSuggestBox{
placeholderText: qsTr("AutoSuggestBox") placeholderText: qsTr("AutoSuggestBox")
@ -145,16 +130,16 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluAutoSuggestBox{ code:'FluAutoSuggestBox{
placeholderText: qsTr("AutoSuggestBox") placeholderText: qsTr("AutoSuggestBox")
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Layout.topMargin: 20 Layout.topMargin: 20
FluSpinBox{ FluSpinBox{
disabled: spin_box_switch.checked disabled: spin_box_switch.checked
@ -174,7 +159,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluSpinBox{ code:'FluSpinBox{
}' }'

View File

@ -11,11 +11,10 @@ FluScrollablePage{
id: root id: root
title: qsTr("Theme") title: qsTr("Theme")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 408
Layout.preferredHeight: 340 padding: 10
paddings: 10
ColumnLayout{ ColumnLayout{
spacing:0 spacing:0
@ -115,16 +114,27 @@ FluScrollablePage{
} }
FluToggleSwitch{ FluToggleSwitch{
Layout.topMargin: 5 Layout.topMargin: 5
checked: FluTheme.enableAnimation checked: FluTheme.animationEnabled
onClicked: { onClicked: {
FluTheme.enableAnimation = !FluTheme.enableAnimation FluTheme.animationEnabled = !FluTheme.animationEnabled
}
}
FluText{
text: qsTr("Open Blur Window")
Layout.topMargin: 20
}
FluToggleSwitch{
Layout.topMargin: 5
checked: FluTheme.blurBehindWindowEnabled
onClicked: {
FluTheme.blurBehindWindowEnabled = !FluTheme.blurBehindWindowEnabled
} }
} }
} }
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluTheme.accentColor = FluColors.Orange code:'FluTheme.accentColor = FluColors.Orange
FluTheme.dark = true FluTheme.dark = true

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("TimePicker") title: qsTr("TimePicker")
launchMode: FluPageType.SingleInstance launchMode: FluPageType.SingleInstance
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.preferredHeight: 80
height: 80 padding: 10
paddings: 10
ColumnLayout{ ColumnLayout{
@ -43,17 +42,17 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluTimePicker{ code:'FluTimePicker{
}' }'
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 80 Layout.preferredHeight: 80
paddings: 10 padding: 10
ColumnLayout{ ColumnLayout{
@ -83,7 +82,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluTimePicker{ code:'FluTimePicker{
hourFormat:FluTimePickerType.HH hourFormat:FluTimePickerType.HH
}' }'

View File

@ -44,7 +44,6 @@ FluScrollablePage{
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text text: modelData.text
font.bold: true
linkColor: FluTheme.dark ? FluColors.Teal.lighter : FluColors.Teal.dark linkColor: FluTheme.dark ? FluColors.Teal.lighter : FluColors.Teal.dark
onLinkActivated: onLinkActivated:
(link)=> { (link)=> {
@ -106,7 +105,6 @@ FluScrollablePage{
RowLayout{ RowLayout{
spacing: 20 spacing: 20
Layout.topMargin: 20
FluTextBox{ FluTextBox{
id: text_box id: text_box
text: "Technical testing 2015-09-01" text: "Technical testing 2015-09-01"

View File

@ -9,11 +9,10 @@ FluScrollablePage{
title: qsTr("ToggleSwitch") title: qsTr("ToggleSwitch")
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Layout.topMargin: 20
Row{ Row{
spacing: 30 spacing: 30
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -41,7 +40,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluToggleSwitch{ code:'FluToggleSwitch{
text:"Text" text:"Text"
}' }'

View File

@ -10,15 +10,14 @@ FluScrollablePage{
title: qsTr("Tooltip") title: qsTr("Tooltip")
FluText{ FluText{
Layout.topMargin: 20
text: qsTr("Hover over Tultip and it pops up") text: qsTr("Hover over Tultip and it pops up")
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Column{ Column{
spacing: 5 spacing: 5
@ -41,7 +40,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluIconButton{ code:'FluIconButton{
iconSource:FluentIcons.ChromeCloseContrast iconSource:FluentIcons.ChromeCloseContrast
iconSize: 15 iconSize: 15
@ -53,11 +52,11 @@ FluScrollablePage{
' '
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
height: 68 Layout.preferredHeight: 68
paddings: 10 padding: 10
Column{ Column{
spacing: 5 spacing: 5
@ -84,7 +83,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluButton{ code:'FluButton{
id: button_1 id: button_1
text: qsTr("Delete") text: qsTr("Delete")

View File

@ -18,11 +18,10 @@ FluScrollablePage{
] ]
} }
FluArea{ FluFrame{
Layout.fillWidth: true Layout.fillWidth: true
height: 130 Layout.preferredHeight: 130
paddings: 10 padding: 10
Layout.topMargin: 20
FluFilledButton{ FluFilledButton{
anchors{ anchors{
@ -66,7 +65,7 @@ FluScrollablePage{
} }
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -6
code:'FluTour{ code:'FluTour{
id:tour id:tour
steps:[ steps:[

View File

@ -9,14 +9,33 @@ FluContentPage {
title: qsTr("TreeView") title: qsTr("TreeView")
function treeData(){ function treeData(){
const dig = (path = '0', level = 4) => { const names = ["孙悟空", "猪八戒", "沙和尚", "唐僧","白骨夫人","金角大王","熊山君","黄风怪","银角大王"]
function getRandomName(){
var randomIndex = Math.floor(Math.random() * names.length)
return names[randomIndex]
}
const addresses = ["傲来国界花果山水帘洞","傲来国界坎源山脏水洞","大唐国界黑风山黑风洞","大唐国界黄风岭黄风洞","大唐国界骷髅山白骨洞","宝象国界碗子山波月洞","宝象国界平顶山莲花洞","宝象国界压龙山压龙洞","乌鸡国界号山枯松涧火云洞","乌鸡国界衡阳峪黑水河河神府"]
function getRandomAddresses(){
var randomIndex = Math.floor(Math.random() * addresses.length)
return addresses[randomIndex]
}
const avatars = ["qrc:/example/res/svg/avatar_1.svg", "qrc:/example/res/svg/avatar_2.svg", "qrc:/example/res/svg/avatar_3.svg", "qrc:/example/res/svg/avatar_4.svg","qrc:/example/res/svg/avatar_5.svg","qrc:/example/res/svg/avatar_6.svg","qrc:/example/res/svg/avatar_7.svg","qrc:/example/res/svg/avatar_8.svg","qrc:/example/res/svg/avatar_9.svg","qrc:/example/res/svg/avatar_10.svg","qrc:/example/res/svg/avatar_11.svg","qrc:/example/res/svg/avatar_12.svg"]
function getRandomAvatar(){
var randomIndex = Math.floor(Math.random() * avatars.length);
return avatars[randomIndex];
}
const dig = (path = '0', level = 5) => {
const list = []; const list = [];
for (let i = 0; i < 6; i += 1) { for (let i = 0; i < 4; i += 1) {
const key = `${path}-${i}`; const key = `${path}-${i}`;
const treeNode = { const treeNode = {
title: key, title: key,
key, _key: key,
name: getRandomName(),
avatar:tree_view.customItem(com_avatar,{avatar:getRandomAvatar()}),
address: getRandomAddresses()
}; };
if (level > 0) { if (level > 0) {
treeNode.children = dig(key, level - 1); treeNode.children = dig(key, level - 1);
@ -28,104 +47,159 @@ FluContentPage {
return dig(); return dig();
} }
Column{ Component{
id: layout_column id:com_avatar
spacing: 12 Item{
width: 300 FluClip{
anchors{ anchors.centerIn: parent
topMargin: 20 width: height
top:parent.top height: parent.height/3*2
left: parent.left radius: [height/2,height/2,height/2,height/2]
leftMargin: 10 Image{
bottom:parent.bottom anchors.fill: parent
bottomMargin: 20 source: {
} if(options && options.avatar){
return options.avatar
FluText{ }
text: qsTr("Total %1 data, %2 data currently displayed").arg(tree_view.count()).arg(tree_view.visibleCount()) return ""
} }
sourceSize: Qt.size(80,80)
FluText{ }
text: qsTr("A total of %1 data items are selected").arg(tree_view.selectionModel().length)
}
RowLayout{
spacing: 10
FluText{
text: "cellHeight:"
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
id: slider_cell_height
value: 30
from: 30
to:100
}
}
RowLayout{
spacing: 10
FluText{
text: "depthPadding:"
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
id: slider_depth_padding
value: 30
from: 30
to:100
}
}
FluToggleSwitch{
id: switch_showline
text:"showLine"
checked: false
}
FluToggleSwitch{
id: switch_draggable
text:"draggable"
checked: false
}
FluToggleSwitch{
id: switch_checkable
text:"checkable"
checked: false
}
FluButton{
text: "all expand"
onClicked: {
tree_view.allExpand()
}
}
FluButton{
text: "all collapse"
onClicked: {
tree_view.allCollapse()
} }
} }
} }
FluArea{ FluFrame{
id:layout_controls
anchors{ anchors{
left: layout_column.right left: parent.left
right: parent.right
top: parent.top top: parent.top
topMargin: 10
}
height: 80
clip: true
Row{
spacing: 12
anchors{
left: parent.left
leftMargin: 10
verticalCenter: parent.verticalCenter
}
Column{
anchors.verticalCenter: parent.verticalCenter
RowLayout{
spacing: 10
FluText{
text: "cellHeight:"
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
id: slider_cell_height
value: 38
from: 38
to:100
}
}
RowLayout{
spacing: 10
FluText{
text: "depthPadding:"
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
id: slider_depth_padding
value: 15
from: 15
to:100
}
}
}
Column{
spacing: 8
anchors.verticalCenter: parent.verticalCenter
FluToggleSwitch{
id: switch_showline
text:"showLine"
checked: false
}
FluToggleSwitch{
id: switch_checkable
text:"checkable"
checked: false
}
}
Column{
spacing: 8
anchors.verticalCenter: parent.verticalCenter
FluButton{
text: "all expand"
onClicked: {
tree_view.allExpand()
}
}
FluButton{
text: "all collapse"
onClicked: {
tree_view.allCollapse()
}
}
}
FluButton{
text: "print selection model"
onClicked: {
var printData = []
var data = tree_view.selectionModel();
console.debug(data.length)
for(var i = 0; i <= data.length-1 ; i++){
const newObj = Object.assign({}, data[i].data);
delete newObj["__parent"];
delete newObj["children"];
printData.push(newObj)
}
console.debug(JSON.stringify(printData))
}
}
}
}
FluTreeView{
id:tree_view
anchors{
left: parent.left
top: layout_controls.bottom
topMargin: 10
bottom: parent.bottom bottom: parent.bottom
right: parent.right right: parent.right
rightMargin: 5
topMargin: 5
bottomMargin: 5
} }
FluShadow{} cellHeight: slider_cell_height.value
FluTreeView{ showLine: switch_showline.checked
id:tree_view checkable:switch_checkable.checked
anchors.fill: parent depthPadding: slider_depth_padding.value
cellHeight: slider_cell_height.value onCurrentChanged: {
draggable:switch_draggable.checked showInfo(current.data.title)
showLine: switch_showline.checked }
checkable:switch_checkable.checked columnSource:[
depthPadding: slider_depth_padding.value {
Component.onCompleted: { title: qsTr("Title"),
var data = treeData() dataIndex: 'title',
dataSource = data width: 300
} },{
title: qsTr("Name"),
dataIndex: 'name',
width: 100
},{
title: qsTr("Avatar"),
dataIndex: 'avatar',
width: 100
},{
title: qsTr("Address"),
dataIndex: 'address',
width: 200
},
]
Component.onCompleted: {
var data = treeData()
dataSource = data
} }
} }
} }

View File

@ -10,15 +10,14 @@ FluContentPage {
title: qsTr("Typography") title: qsTr("Typography")
rightPadding: 10 rightPadding: 10
FluArea{ FluFrame{
anchors{ anchors{
top:parent.top top:parent.top
left: parent.left left: parent.left
right: parent.right right: parent.right
bottom: parent.bottom bottom: parent.bottom
topMargin: 20
} }
paddings: 10 padding: 10
ColumnLayout{ ColumnLayout{
spacing: 0 spacing: 0
scale: textScale scale: textScale

View File

@ -9,9 +9,8 @@ FluContentPage{
title: qsTr("Watermark") title: qsTr("Watermark")
FluArea{ FluFrame{
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 20
ColumnLayout{ ColumnLayout{
anchors{ anchors{

View File

@ -1,14 +0,0 @@
import QtQuick 2.15
import FluentUI 1.0
FluViewModel{
objectName: "SettingsViewModel"
scope: FluViewModelType.Application
property int displayMode
onInitData: {
displayMode = FluNavigationViewType.Auto
}
}

View File

@ -1,8 +0,0 @@
import QtQuick 2.15
import FluentUI 1.0
FluViewModel {
objectName: "TextBoxView"
property string text1
property string text2
}

View File

@ -31,7 +31,7 @@ FluWindow {
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
FluApp.navigate("/") FluRouter.navigate("/")
} }
} }
} }

View File

@ -71,7 +71,7 @@ FluWindow {
FluFilledButton{ FluFilledButton{
text: qsTr("Restart Program") text: qsTr("Restart Program")
onClicked: { onClicked: {
FluApp.exit(931) FluRouter.exit(931)
} }
} }
} }

View File

@ -8,26 +8,26 @@ import "../component"
FluWindowDialog { FluWindowDialog {
id:window id:window
title:qsTr("FluentUI Initalizr") title:qsTr("FluentUI Initializr")
width: 600 width: 600
height: 400 height: 400
contentDelegate:Component{ contentDelegate:Component{
Item{ Item{
Connections{ Connections{
target: InitalizrHelper target: InitializrHelper
function onError(message){ function onError(message){
showError(message) showError(message)
} }
function onSuccess(path){ function onSuccess(path){
FluTools.showFileInFolder(path+"/CMakeLists.txt") FluTools.showFileInFolder(path)
window.close() window.close()
} }
} }
FluText{ FluText{
id:text_title id:text_title
text:qsTr("FluentUI Initalizr") text:qsTr("FluentUI Initializr")
font: FluTextStyle.Title font: FluTextStyle.Title
anchors{ anchors{
left: parent.left left: parent.left
@ -102,7 +102,7 @@ FluWindowDialog {
width: 120 width: 120
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
InitalizrHelper.generate(text_box_name.text,text_box_path.text) InitializrHelper.generate(text_box_name.text,text_box_path.text)
} }
} }
} }

View File

@ -20,7 +20,7 @@ FluWindow {
loader.reload() loader.reload()
} }
} }
FluArea{ FluFrame{
anchors.fill: parent anchors.fill: parent
FluRemoteLoader{ FluRemoteLoader{
id:loader id:loader
@ -41,7 +41,7 @@ FluWindow {
} }
FluText{ FluText{
text: qsTr("Drag in a qml file") text: qsTr("Drag in a qml file")
font.pixelSize: 26 font: FluTextStyle.Title
anchors.centerIn: parent anchors.centerIn: parent
visible: !loader.itemLodaer().item && loader.statusMode === FluStatusLayoutType.Success visible: !loader.itemLodaer().item && loader.statusMode === FluStatusLayoutType.Success
} }

View File

@ -51,7 +51,7 @@ FluWindow {
showError(qsTr("Please feel free to enter a password")) showError(qsTr("Please feel free to enter a password"))
return return
} }
onResult({password:textbox_password.text}) setResult({password:textbox_password.text})
window.close() window.close()
} }
} }

View File

@ -7,7 +7,6 @@ import Qt.labs.platform 1.1
import FluentUI 1.0 import FluentUI 1.0
import example 1.0 import example 1.0
import "../component" import "../component"
import "../viewmodel"
import "../global" import "../global"
FluWindow { FluWindow {
@ -16,7 +15,7 @@ FluWindow {
title: "FluentUI" title: "FluentUI"
width: 1000 width: 1000
height: 680 height: 680
minimumWidth: 520 minimumWidth: 800
minimumHeight: 200 minimumHeight: 200
launchMode: FluWindowType.SingleTask launchMode: FluWindowType.SingleTask
fitsAppBarWindows: true fitsAppBarWindows: true
@ -29,37 +28,27 @@ FluWindow {
z:7 z:7
} }
SettingsViewModel{ FluentInitializrWindow{
id:viewmodel_settings id:fluent_Initializr
} }
FluEvent{ FluEvent{
id:event_checkupdate
name: "checkUpdate" name: "checkUpdate"
onTriggered: { onTriggered: {
checkUpdate(false) checkUpdate(false)
} }
} }
onFirstVisible: { onLazyLoad: {
timer_tour_delay.restart() tour.open()
}
Timer{
id:timer_tour_delay
interval: 200
onTriggered: {
tour.open()
}
} }
Component.onCompleted: { Component.onCompleted: {
checkUpdate(true) checkUpdate(true)
FluEventBus.registerEvent(event_checkupdate)
} }
Component.onDestruction: { Component.onDestruction: {
FluEventBus.unRegisterEvent(event_checkupdate) FluRouter.exit()
} }
SystemTrayIcon { SystemTrayIcon {
@ -71,7 +60,7 @@ FluWindow {
MenuItem { MenuItem {
text: "退出" text: "退出"
onTriggered: { onTriggered: {
FluApp.exit() FluRouter.exit()
} }
} }
} }
@ -106,7 +95,7 @@ FluWindow {
positiveText: qsTr("Quit") positiveText: qsTr("Quit")
neutralText: qsTr("Cancel") neutralText: qsTr("Cancel")
onPositiveClicked:{ onPositiveClicked:{
FluApp.exit(0) FluRouter.exit(0)
} }
} }
@ -116,9 +105,9 @@ FluWindow {
width: 186 width: 186
FluMenuItem{ FluMenuItem{
text: qsTr("Open in Separate Window") text: qsTr("Open in Separate Window")
font.pixelSize: 12 font: FluTextStyle.Caption
onClicked: { onClicked: {
FluApp.navigate("/pageWindow",{title:modelData.title,url:modelData.url}) FluRouter.navigate("/pageWindow",{title:modelData.title,url:modelData.url})
} }
} }
} }
@ -175,14 +164,14 @@ FluWindow {
} }
} }
Component.onCompleted: { Component.onCompleted: {
appBar.setHitTestVisible(layout_back_buttons) window.setHitTestVisible(layout_back_buttons)
} }
} }
FluRemoteLoader{ FluRemoteLoader{
id:loader id:loader
lazy: true lazy: true
anchors.fill: parent anchors.fill: parent
source: "https://zhu-zichu.gitee.io/Qt_168_LieflatPage.qml" source: "https://zhu-zichu.gitee.io/Qt_174_LieflatPage.qml"
} }
} }
front: Item{ front: Item{
@ -197,7 +186,7 @@ FluWindow {
z:999 z:999
//Stack模式每次切换都会将页面压入栈中随着栈的页面增多消耗的内存也越多内存消耗多就会卡顿这时候就需要按返回将页面pop掉释放内存。该模式可以配合FluPage中的launchMode属性设置页面的启动模式 //Stack模式每次切换都会将页面压入栈中随着栈的页面增多消耗的内存也越多内存消耗多就会卡顿这时候就需要按返回将页面pop掉释放内存。该模式可以配合FluPage中的launchMode属性设置页面的启动模式
// pageMode: FluNavigationViewType.Stack // pageMode: FluNavigationViewType.Stack
//NoStack模式每次切换都会销毁之前的页面然后创建一个新的页面只需消耗少量内存可以配合FluViewModel保存页面数据推荐 //NoStack模式每次切换都会销毁之前的页面然后创建一个新的页面只需消耗少量内存
pageMode: FluNavigationViewType.NoStack pageMode: FluNavigationViewType.NoStack
items: ItemsOriginal items: ItemsOriginal
footerItems:ItemsFooter footerItems:ItemsFooter
@ -207,7 +196,7 @@ FluWindow {
} }
return FluTools.isMacos() ? 20 : 0 return FluTools.isMacos() ? 20 : 0
} }
displayMode:viewmodel_settings.displayMode displayMode: GlobalModel.displayMode
logo: "qrc:/example/res/image/favicon.ico" logo: "qrc:/example/res/image/favicon.ico"
title:"FluentUI" title:"FluentUI"
onLogoClicked:{ onLogoClicked:{
@ -233,9 +222,9 @@ FluWindow {
ItemsOriginal.paneItemMenu = nav_item_right_menu ItemsOriginal.paneItemMenu = nav_item_right_menu
ItemsFooter.navigationView = nav_view ItemsFooter.navigationView = nav_view
ItemsFooter.paneItemMenu = nav_item_right_menu ItemsFooter.paneItemMenu = nav_item_right_menu
appBar.setHitTestVisible(nav_view.buttonMenu) window.setHitTestVisible(nav_view.buttonMenu)
appBar.setHitTestVisible(nav_view.buttonBack) window.setHitTestVisible(nav_view.buttonBack)
appBar.setHitTestVisible(nav_view.imageLogo) window.setHitTestVisible(nav_view.imageLogo)
setCurrentIndex(0) setCurrentIndex(0)
} }
} }
@ -268,7 +257,7 @@ FluWindow {
} }
function handleDarkChanged(button){ function handleDarkChanged(button){
if(!FluTheme.enableAnimation || window.fitsAppBarWindows === false){ if(!FluTheme.animationEnabled || window.fitsAppBarWindows === false){
changeDark() changeDark()
}else{ }else{
if(loader_reveal.sourceComponent){ if(loader_reveal.sourceComponent){
@ -355,11 +344,11 @@ FluWindow {
} }
} }
FluNetworkCallable{ NetworkCallable{
id:callable id:callable
property bool silent: true property bool silent: true
onStart: { onStart: {
console.debug("satrt check update...") console.debug("start check update...")
} }
onFinish: { onFinish: {
console.debug("check update finish") console.debug("check update finish")
@ -391,7 +380,7 @@ FluWindow {
function checkUpdate(silent){ function checkUpdate(silent){
callable.silent = silent callable.silent = silent
FluNetwork.get("https://api.github.com/repos/zhuzichu520/FluentUI/releases/latest") Network.get("https://api.github.com/repos/zhuzichu520/FluentUI/releases/latest")
.go(callable) .go(callable)
} }
} }

View File

@ -16,7 +16,7 @@ FluWindow {
onInitArgument: onInitArgument:
(arg)=>{ (arg)=>{
window.title = arg.title window.title = arg.title
loader.setSource( arg.url,{animDisabled:true}) loader.setSource(arg.url,{animationEnabled:false})
} }
FluLoader{ FluLoader{
id: loader id: loader

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 MiB

View File

@ -4,14 +4,14 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import FluentUI 1.0 import FluentUI 1.0
Item { FluLauncher {
id: app id: app
Component.onCompleted: { Component.onCompleted: {
FluApp.init(app) FluApp.init(app)
FluApp.windowIcon = "qrc:/logo.ico" FluApp.windowIcon = "qrc:/logo.ico"
FluApp.routes = { FluRouter.routes = {
"/":"qrc:/main.qml", "/":"qrc:/main.qml",
} }
FluApp.navigate("/") FluRouter.navigate("/")
} }
} }

View File

@ -98,7 +98,7 @@ if (CMAKE_BUILD_TYPE MATCHES "Release")
add_custom_target(Script-DeployRelease add_custom_target(Script-DeployRelease
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/dist COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/dist
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}/dist COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}/dist
COMMAND ${QT_DEPLOY_QT} ${CMAKE_SOURCE_DIR}/dist/${PROJECT_NAME}.exe -qmldir=${CMAKE_CURRENT_LIST_DIR} COMMAND ${QT_DEPLOY_QT} --qmldir=${CMAKE_CURRENT_LIST_DIR} --plugindir ${CMAKE_SOURCE_DIR}/dist/plugins --no-translations --compiler-runtime ${CMAKE_SOURCE_DIR}/dist/${PROJECT_NAME}.exe
COMMENT "Windows Deploying Qt Dependencies After Build........." COMMENT "Windows Deploying Qt Dependencies After Build........."
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -1,17 +1,15 @@
#include "AppInfo.h" #include "AppInfo.h"
#include <QQmlContext> #include <QQmlContext>
#include <QDebug>
#include <QGuiApplication> #include <QGuiApplication>
#include "Version.h" #include "Version.h"
AppInfo::AppInfo(QObject *parent) AppInfo::AppInfo(QObject *parent)
: QObject{parent} : QObject{parent} {
{
version(APPLICATION_VERSION); version(APPLICATION_VERSION);
} }
void AppInfo::testCrash(){ [[maybe_unused]] void AppInfo::testCrash() {
auto *crash = reinterpret_cast<volatile int *>(0); auto *crash = reinterpret_cast<volatile int *>(0);
*crash = 0; *crash = 0;
} }

View File

@ -1,20 +1,18 @@
#ifndef APPINFO_H #pragma once
#define APPINFO_H
#include <QObject> #include <QObject>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include "stdafx.h" #include "stdafx.h"
#include "singleton.h" #include "singleton.h"
class AppInfo : public QObject class AppInfo : public QObject {
{ Q_OBJECT
Q_OBJECT Q_PROPERTY_AUTO(QString, version)
Q_PROPERTY_AUTO(QString,version)
private: private:
explicit AppInfo(QObject *parent = nullptr); explicit AppInfo(QObject *parent = nullptr);
public:
SINGLETON(AppInfo)
Q_INVOKABLE void testCrash();
};
#endif // APPINFO_H public:
SINGLETON(AppInfo)
[[maybe_unused]] Q_INVOKABLE void testCrash();
};

View File

@ -1,5 +1,4 @@
#ifndef APP_DUMP_H #pragma once
#define APP_DUMP_H
#include <Windows.h> #include <Windows.h>
#include <DbgHelp.h> #include <DbgHelp.h>
@ -12,71 +11,69 @@
#pragma comment(lib, "Dbghelp.lib") #pragma comment(lib, "Dbghelp.lib")
static void miniDumpWriteDump(HANDLE hProcess,DWORD ProcessId,HANDLE hFile,MINIDUMP_TYPE DumpType,CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam){ static void
typedef HRESULT (WINAPI* MiniDumpWriteDumpPtr)(HANDLE hProcess,DWORD ProcessId,HANDLE hFile,MINIDUMP_TYPE DumpType,CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam); miniDumpWriteDump(HANDLE hProcess, DWORD ProcessId, HANDLE hFile, CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam) {
typedef HRESULT (WINAPI *MiniDumpWriteDumpPtr)(HANDLE hProcess, DWORD ProcessId, HANDLE hFile, MINIDUMP_TYPE DumpType, CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,
CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam);
HMODULE module = LoadLibraryW(L"Dbghelp.dll"); HMODULE module = LoadLibraryW(L"Dbghelp.dll");
if (module) if (module) {
{
MiniDumpWriteDumpPtr mini_dump_write_dump; MiniDumpWriteDumpPtr mini_dump_write_dump;
mini_dump_write_dump= reinterpret_cast<MiniDumpWriteDumpPtr>(GetProcAddress(module, "MiniDumpWriteDump")); mini_dump_write_dump = reinterpret_cast<MiniDumpWriteDumpPtr>(GetProcAddress(module, "MiniDumpWriteDump"));
if (mini_dump_write_dump) if (mini_dump_write_dump) {
{ mini_dump_write_dump(hProcess, ProcessId, hFile, static_cast<MINIDUMP_TYPE>(80), ExceptionParam, nullptr, CallbackParam);
mini_dump_write_dump(hProcess,ProcessId,hFile,DumpType,ExceptionParam,UserStreamParam,CallbackParam);
} }
} }
} }
BOOL CALLBACK MyMiniDumpCallback(PVOID, const PMINIDUMP_CALLBACK_INPUT input, PMINIDUMP_CALLBACK_OUTPUT output) { BOOL CALLBACK MyMiniDumpCallback(PVOID, const PMINIDUMP_CALLBACK_INPUT input, PMINIDUMP_CALLBACK_OUTPUT output) {
if (input == NULL || output == NULL) if (input == nullptr || output == nullptr)
return FALSE; return FALSE;
BOOL ret = FALSE; BOOL ret = FALSE;
switch (input->CallbackType) { switch (input->CallbackType) {
case IncludeModuleCallback: case IncludeModuleCallback:
case IncludeThreadCallback: case IncludeThreadCallback:
case ThreadCallback: case ThreadCallback:
case ThreadExCallback: case ThreadExCallback:
ret = TRUE; ret = TRUE;
break; break;
case ModuleCallback: { case ModuleCallback: {
if (!(output->ModuleWriteFlags & ModuleReferencedByMemory)) { if (!(output->ModuleWriteFlags & ModuleReferencedByMemory)) {
output->ModuleWriteFlags &= ~ModuleWriteModule; output->ModuleWriteFlags &= ~ModuleWriteModule;
}
ret = TRUE;
} }
ret = TRUE; break;
} break; default:
default: break;
break;
} }
return ret; return ret;
} }
void WriteDump(EXCEPTION_POINTERS* exp, const std::wstring& path) { void WriteDump(EXCEPTION_POINTERS *exp, const std::wstring &path) {
HANDLE h = ::CreateFileW(path.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); HANDLE h = ::CreateFileW(path.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
MINIDUMP_EXCEPTION_INFORMATION info; MINIDUMP_EXCEPTION_INFORMATION info;
info.ThreadId = ::GetCurrentThreadId(); info.ThreadId = ::GetCurrentThreadId();
info.ExceptionPointers = exp; info.ExceptionPointers = exp;
info.ClientPointers = FALSE; info.ClientPointers = FALSE;
MINIDUMP_CALLBACK_INFORMATION mci; MINIDUMP_CALLBACK_INFORMATION mci;
mci.CallbackRoutine = (MINIDUMP_CALLBACK_ROUTINE)MyMiniDumpCallback; mci.CallbackRoutine = (MINIDUMP_CALLBACK_ROUTINE) MyMiniDumpCallback;
mci.CallbackParam = 0; mci.CallbackParam = nullptr;
MINIDUMP_TYPE mdt = (MINIDUMP_TYPE)(MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory); miniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), h, &info, &mci);
miniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), h, mdt, &info, NULL, &mci);
::CloseHandle(h); ::CloseHandle(h);
} }
LONG WINAPI MyUnhandledExceptionFilter(EXCEPTION_POINTERS* exp) { LONG WINAPI MyUnhandledExceptionFilter(EXCEPTION_POINTERS *exp) {
const QString dumpFileName = QString("%1_%2.dmp").arg("crash",QDateTime::currentDateTime().toString("yyyyMMdd_hhmmss")); const QString dumpFileName = QString("%1_%2.dmp").arg("crash", QDateTime::currentDateTime().toString("yyyyMMdd_hhmmss"));
const QString dumpDirPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)+"/dmp"; const QString dumpDirPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/dmp";
const QDir dumpDir(dumpDirPath); const QDir dumpDir(dumpDirPath);
if(!dumpDir.exists()){ if (!dumpDir.exists()) {
dumpDir.mkpath(dumpDirPath); dumpDir.mkpath(dumpDirPath);
} }
QString dumpFilePath = dumpDir.filePath(dumpFileName); QString dumpFilePath = dumpDir.filePath(dumpFileName);
WriteDump(exp, dumpFilePath.toStdWString()); WriteDump(exp, dumpFilePath.toStdWString());
QStringList arguments; QStringList arguments;
arguments << "-crashed=" + dumpFilePath; arguments << "-crashed=" + dumpFilePath;
QProcess::startDetached(qApp->applicationFilePath(), arguments); QProcess::startDetached(QGuiApplication::applicationFilePath(), arguments);
return EXCEPTION_EXECUTE_HANDLER; return EXCEPTION_EXECUTE_HANDLER;
} }
#endif // APP_DUMP_H

View File

@ -3,43 +3,43 @@
#include <QQuickItemGrabResult> #include <QQuickItemGrabResult>
#include <QPainterPath> #include <QPainterPath>
CircularReveal::CircularReveal(QQuickItem* parent) : QQuickPaintedItem(parent) CircularReveal::CircularReveal(QQuickItem *parent) : QQuickPaintedItem(parent) {
{ _target = nullptr;
_radius = 0;
_anim = new QPropertyAnimation(this, "radius", this); _anim = new QPropertyAnimation(this, "radius", this);
setVisible(false);
_anim->setDuration(333); _anim->setDuration(333);
_anim->setEasingCurve(QEasingCurve::OutCubic); _anim->setEasingCurve(QEasingCurve::OutCubic);
connect(_anim, &QPropertyAnimation::finished,this,[=](){ setVisible(false);
connect(_anim, &QPropertyAnimation::finished, this, [=]() {
update(); update();
setVisible(false); setVisible(false);
Q_EMIT animationFinished(); Q_EMIT animationFinished();
}); });
connect(this,&CircularReveal::radiusChanged,this,[=](){ connect(this, &CircularReveal::radiusChanged, this, [=]() {
update(); update();
}); });
} }
void CircularReveal::paint(QPainter* painter) void CircularReveal::paint(QPainter *painter) {
{
painter->save(); painter->save();
painter->drawImage(QRect(0, 0, static_cast<int>(width()), static_cast<int>(height())), _source); painter->drawImage(QRect(0, 0, static_cast<int>(width()), static_cast<int>(height())), _source);
QPainterPath path; QPainterPath path;
path.moveTo(_center.x(),_center.y()); path.moveTo(_center.x(), _center.y());
path.addEllipse(QPointF(_center.x(),_center.y()), _radius, _radius); path.addEllipse(QPointF(_center.x(), _center.y()), _radius, _radius);
painter->setCompositionMode(QPainter::CompositionMode_Clear); painter->setCompositionMode(QPainter::CompositionMode_Clear);
painter->fillPath(path, Qt::black); painter->fillPath(path, Qt::black);
painter->restore(); painter->restore();
} }
void CircularReveal::start(int w,int h,const QPoint& center,int radius){ [[maybe_unused]] void CircularReveal::start(int w, int h, const QPoint &center, int radius) {
_anim->setStartValue(0); _anim->setStartValue(0);
_anim->setEndValue(radius); _anim->setEndValue(radius);
_center = center; _center = center;
_grabResult = _target->grabToImage(QSize(w,h)); _grabResult = _target->grabToImage(QSize(w, h));
connect(_grabResult.data(), &QQuickItemGrabResult::ready, this, &CircularReveal::handleGrabResult); connect(_grabResult.data(), &QQuickItemGrabResult::ready, this, &CircularReveal::handleGrabResult);
} }
void CircularReveal::handleGrabResult(){ void CircularReveal::handleGrabResult() {
_grabResult.data()->image().swap(_source); _grabResult.data()->image().swap(_source);
update(); update();
setVisible(true); setVisible(true);

View File

@ -1,5 +1,4 @@
#ifndef CIRCULARREVEAL_H #pragma once
#define CIRCULARREVEAL_H
#include <QQuickItem> #include <QQuickItem>
#include <QQuickPaintedItem> #include <QQuickPaintedItem>
@ -7,23 +6,26 @@
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include "src/stdafx.h" #include "src/stdafx.h"
class CircularReveal : public QQuickPaintedItem class CircularReveal : public QQuickPaintedItem {
{ Q_OBJECT
Q_OBJECT Q_PROPERTY_AUTO_P(QQuickItem*, target)
Q_PROPERTY_AUTO(QQuickItem*,target) Q_PROPERTY_AUTO(int, radius)
Q_PROPERTY_AUTO(int,radius)
public: public:
CircularReveal(QQuickItem* parent = nullptr); explicit CircularReveal(QQuickItem *parent = nullptr);
void paint(QPainter* painter) override;
Q_INVOKABLE void start(int w,int h,const QPoint& center,int radius); void paint(QPainter *painter) override;
[[maybe_unused]] Q_INVOKABLE void start(int w, int h, const QPoint &center, int radius);
Q_SIGNAL void imageChanged(); Q_SIGNAL void imageChanged();
Q_SIGNAL void animationFinished(); Q_SIGNAL void animationFinished();
Q_SLOT void handleGrabResult(); Q_SLOT void handleGrabResult();
private: private:
QPropertyAnimation* _anim = nullptr; QPropertyAnimation *_anim = nullptr;
QImage _source; QImage _source;
QPoint _center; QPoint _center;
QSharedPointer<QQuickItemGrabResult> _grabResult; QSharedPointer<QQuickItemGrabResult> _grabResult;
}; };
#endif // CIRCULARREVEAL_H

View File

@ -1,24 +1,23 @@
#include "FileWatcher.h" #include "FileWatcher.h"
FileWatcher::FileWatcher(QObject *parent) FileWatcher::FileWatcher(QObject *parent) : QObject{parent} {
: QObject{parent} connect(&_watcher, &QFileSystemWatcher::fileChanged, this, [=](const QString &path) {
{
connect(&_watcher, &QFileSystemWatcher::fileChanged, this, [=](const QString &path){
Q_EMIT fileChanged(); Q_EMIT fileChanged();
clean(); clean();
_watcher.addPath(_path); _watcher.addPath(_path);
}); });
connect(this,&FileWatcher::pathChanged,this,[=](){ connect(this, &FileWatcher::pathChanged, this, [=]() {
clean(); clean();
_watcher.addPath(_path.replace("file:///","")); _watcher.addPath(_path.replace("file:///", ""));
}); });
if(!_path.isEmpty()){ if (!_path.isEmpty()) {
_watcher.addPath(_path); _watcher.addPath(_path);
} }
} }
void FileWatcher::clean(){ void FileWatcher::clean() {
foreach (const QString &item, _watcher.files()) { for (int i = 0; i <= _watcher.files().size() - 1; ++i) {
auto item = _watcher.files().at(i);
_watcher.removePath(item); _watcher.removePath(item);
} }
} }

View File

@ -1,22 +1,21 @@
#ifndef FILEWATCHER_H #pragma once
#define FILEWATCHER_H
#include <QObject> #include <QObject>
#include <QFileSystemWatcher> #include <QFileSystemWatcher>
#include <QtQml/qqml.h> #include <QtQml/qqml.h>
#include "src/stdafx.h" #include "src/stdafx.h"
class FileWatcher : public QObject class FileWatcher : public QObject {
{ Q_OBJECT
Q_OBJECT Q_PROPERTY_AUTO(QString, path);
Q_PROPERTY_AUTO(QString,path);
public: public:
explicit FileWatcher(QObject *parent = nullptr); explicit FileWatcher(QObject *parent = nullptr);
Q_SIGNAL void fileChanged(); Q_SIGNAL void fileChanged();
private: private:
void clean(); void clean();
private: private:
QFileSystemWatcher _watcher; QFileSystemWatcher _watcher;
}; };
#endif // FILEWATCHER_H

View File

@ -3,16 +3,16 @@
#include <QTimer> #include <QTimer>
#include <QQuickWindow> #include <QQuickWindow>
FpsItem::FpsItem() FpsItem::FpsItem() {
{ _fps = 0;
QTimer *timer = new QTimer(this); auto *timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, [this]{ connect(timer, &QTimer::timeout, this, [this] {
fps(_frameCount); fps(_frameCount);
_frameCount = 0; _frameCount = 0;
}); });
connect(this, &QQuickItem::windowChanged, this, [this]{ connect(this, &QQuickItem::windowChanged, this, [this] {
if (window()){ if (window()) {
connect(window(), &QQuickWindow::afterRendering, this, [this]{ _frameCount++; }, Qt::DirectConnection); connect(window(), &QQuickWindow::afterRendering, this, [this] { _frameCount++; }, Qt::DirectConnection);
} }
}); });
timer->start(1000); timer->start(1000);

View File

@ -1,13 +1,11 @@
#ifndef FPSITEM_H #pragma once
#define FPSITEM_H
#include <QQuickItem> #include <QQuickItem>
#include "src/stdafx.h" #include "src/stdafx.h"
class FpsItem : public QQuickItem class FpsItem : public QQuickItem {
{ Q_OBJECT
Q_OBJECT Q_PROPERTY_AUTO(int, fps)
Q_PROPERTY_AUTO(int,fps)
public: public:
FpsItem(); FpsItem();
@ -15,5 +13,3 @@ private:
int _frameCount = 0; int _frameCount = 0;
}; };
#endif // FPSITEM_H

View File

@ -0,0 +1,93 @@
#include "OpenGLItem.h"
#include <QOpenGLFramebufferObjectFormat>
#include <QOpenGLShaderProgram>
class FBORenderer : public QQuickFramebufferObject::Renderer, protected QOpenGLFunctions {
public:
explicit FBORenderer(const OpenGLItem *item);
void render() override;
QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) override;
QOpenGLShaderProgram program;
const OpenGLItem *item = nullptr;
};
FBORenderer::FBORenderer(const OpenGLItem *item) {
this->item = item;
initializeOpenGLFunctions();
program.addCacheableShaderFromSourceCode(QOpenGLShader::Vertex,
"attribute highp vec4 vertices;"
"varying highp vec2 coords;"
"void main() {"
" gl_Position = vertices;"
" coords = vertices.xy;"
"}");
program.addCacheableShaderFromSourceCode(QOpenGLShader::Fragment,
"uniform lowp float t;"
"varying highp vec2 coords;"
"void main() {"
" lowp float i = 1. - (pow(abs(coords.x), 4.) + pow(abs(coords.y), 4.));"
" i = smoothstep(t - 0.8, t + 0.8, i);"
" i = floor(i * 20.) / 20.;"
" gl_FragColor = vec4(coords * .5 + .5, i, i);"
"}");
program.bindAttributeLocation("vertices", 0);
program.link();
}
QOpenGLFramebufferObject *FBORenderer::createFramebufferObject(const QSize &size) {
QOpenGLFramebufferObjectFormat format;
format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
format.setSamples(4);
return new QOpenGLFramebufferObject(size, format);
}
void FBORenderer::render() {
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glEnable(GL_DEPTH_TEST);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
program.bind();
program.enableAttributeArray(0);
float values[] = {
-1, -1,
1, -1,
-1, 1,
1, 1
};
glBindBuffer(GL_ARRAY_BUFFER, 0);
program.setAttributeArray(0, GL_FLOAT, values, 2);
program.setUniformValue("t", (float) item->t());
glViewport(0, 0, qRound(item->width()), qRound(item->height()));
glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
program.disableAttributeArray(0);
program.release();
}
OpenGLItem::OpenGLItem(QQuickItem *parent) : QQuickFramebufferObject(parent) {
setMirrorVertically(true);
startTimer(1);
}
void OpenGLItem::timerEvent(QTimerEvent *) {
update();
}
void OpenGLItem::setT(qreal t) {
if (t == m_t)
return;
m_t = t;
emit tChanged();
}
QQuickFramebufferObject::Renderer *OpenGLItem::createRenderer() const {
return new FBORenderer(this);
}

View File

@ -0,0 +1,29 @@
#pragma once
#include <QtQuick/QQuickItem>
#include <QOpenGLFunctions>
#include <QQuickFramebufferObject>
class FBORenderer;
class OpenGLItem : public QQuickFramebufferObject, protected QOpenGLFunctions {
Q_OBJECT
Q_PROPERTY(qreal t READ t WRITE setT NOTIFY tChanged)
public:
explicit OpenGLItem(QQuickItem *parent = nullptr);
[[nodiscard]] QQuickFramebufferObject::Renderer *createRenderer() const override;
void timerEvent(QTimerEvent *) override;
[[nodiscard]] qreal t() const { return m_t; }
void setT(qreal t);
signals:
void tChanged();
private:
qreal m_t{};
};

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