Compare commits

..

48 Commits
1.5.4 ... 1.5.8

Author SHA1 Message Date
af74f35e43 update 2023-09-13 21:24:02 +08:00
3b61985cfe update 2023-09-13 18:12:58 +08:00
eb96cf5b47 update 2023-09-13 17:27:09 +08:00
d48ad16ae3 update 2023-09-13 16:08:54 +08:00
39fb4d1b1a update 2023-09-13 15:43:31 +08:00
674de3f881 update 2023-09-13 15:26:21 +08:00
0c2b3173eb update 2023-09-13 15:21:07 +08:00
b2471bcf0d update 2023-09-13 15:11:22 +08:00
79a7c97fe8 update 2023-09-12 22:55:42 +08:00
fd30819393 update 2023-09-12 18:45:15 +08:00
05040ec4a9 update 2023-09-11 18:10:50 +08:00
0297445218 update 2023-09-10 17:05:36 +08:00
3990c95489 update 2023-09-10 16:58:23 +08:00
618b21854f Compatible with static build 2023-09-09 20:09:20 +08:00
ef40e3b109 update 2023-09-09 10:19:47 +08:00
f2b67af58a update 2023-09-08 23:01:31 +08:00
c0f15060af update 2023-09-08 22:43:52 +08:00
24f3cb1027 update 2023-09-08 22:33:23 +08:00
4b01fcf2b4 update 2023-09-08 19:14:45 +08:00
752fe8cfba update 2023-09-08 17:39:10 +08:00
e1292966c1 update 2023-09-08 13:54:40 +08:00
249c294926 update 2023-09-08 01:12:20 +08:00
573898149a update 2023-09-08 00:21:28 +08:00
c92d807ec1 update 2023-09-07 18:07:23 +08:00
531bffdf1a update 2023-09-06 23:17:33 +08:00
db47a75f6b update 2023-09-06 22:52:48 +08:00
ad79480345 update 2023-09-06 18:07:51 +08:00
ed5956d824 update 2023-09-06 14:05:29 +08:00
ddee70cdca add breakPointDownload property 2023-09-06 00:22:37 +08:00
d6bbe3a5ec update 2023-09-05 18:38:16 +08:00
d93d6b7c26 update 2023-09-05 16:48:04 +08:00
54be482833 update 2023-09-04 22:49:50 +08:00
f60eaec07c Merge branch 'main' of https://github.com/zhuzichu520/FluentUI 2023-09-04 20:45:56 +08:00
f7b7d30a6f update 2023-09-04 18:37:55 +08:00
ba32c92133 update 2023-09-04 11:29:15 +08:00
08c4f78454 update 2023-09-01 18:38:21 +08:00
e29150ca52 update THIRD_PARTY_COPYRIGHT 2023-09-01 09:37:07 +08:00
1be9103412 update 2023-08-31 18:06:05 +08:00
8583427a49 Merge branch 'main' of https://github.com/zhuzichu520/FluentUI 2023-08-30 18:44:13 +08:00
94a96cf75e update 2023-08-30 18:44:07 +08:00
5b3834ed8f add FluStaggeredView 2023-08-30 17:18:49 +08:00
5fc7ae7e89 add FpsItem 2023-08-28 17:14:21 +08:00
82a3f85f10 fix #266 2023-08-27 18:22:52 +08:00
56a62f0b29 fix #264 2023-08-27 12:40:02 +08:00
e30db258ca fix #265 2023-08-27 11:24:48 +08:00
e2879f564c check update 2023-08-27 09:11:44 +08:00
db74f71e82 update 2023-08-26 17:27:52 +08:00
aedb89b34b update 2023-08-26 17:20:30 +08:00
206 changed files with 6514 additions and 2162 deletions

View File

@ -1,5 +1,6 @@
include(CMakeParseArguments)
find_package(Qt5 REQUIRED COMPONENTS Core)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
function(FindQmlPluginDump)
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
@ -35,7 +36,6 @@ function(add_qmlplugin TARGET)
${QMLPLUGIN_SOURCES}
)
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
add_custom_target("${TARGET}-qmlfiles" SOURCES ${QMLPLUGIN_QMLFILES})
if(QMLPLUGIN_NO_AUTORCC)
set_target_properties(${TARGET} PROPERTIES AUTOMOC OFF)

View File

@ -1,12 +1,11 @@
// 应用程序版本信息
// 请勿修改此头文件,因为这个文件是自动生成的
#ifndef VERSION_H
#define VERSION_H
#include <QtGlobal>
#define APPLICATION_VERSION "${GIT_SEMVER}.${GIT_COMMIT_COUNT}"
#define APPLICATION_FULL_VERSION "${GIT_SEMVER}.${GIT_COMMIT_COUNT}"
#define VERSION_COUNTER ${GIT_COMMIT_COUNT}
#define COMMIT_HASH "${GIT_DESCRIBE}"
#define APPLICATION_VERSION "${GIT_SEMVER}"
#endif // VERSION_H

85
.github/workflows/windows-qt5.yml vendored Normal file
View File

@ -0,0 +1,85 @@
name: Windows Qt5.15.2
on:
push:
paths:
- '*.txt'
- 'src/**'
- 'example/**'
- 'scripts/**'
- '.github/workflows/windows_qt5.yml'
pull_request:
paths:
- '*.txt'
- 'example/**'
- 'src/**'
- 'scripts/**'
- '.github/workflows/windows_qt5.yml'
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
include:
- qt_ver: 5.15.2
qt_arch: win32_msvc2019
msvc_arch: x86
qt_arch_install: msvc2019
env:
targetName: example.exe
fileName: example
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
arch: ${{ matrix.qt_arch }}
cache: ${{steps.cache-qt.outputs.cache-hit}}
- name: msvc-build
id: build
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.msvc_arch }}
mkdir build
cd build
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=D:\a\FluentUI\Qt\5.15.2\msvc2019 -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -GNinja ..
cmake --build . --target all --config Release --parallel
echo winSdkDir=%WindowsSdkDir% >> %GITHUB_ENV%
echo winSdkVer=%WindowsSdkVersion% >> %GITHUB_ENV%
echo vcToolsInstallDir=%VCToolsInstallDir% >> %GITHUB_ENV%
echo vcToolsRedistDir=%VCToolsRedistDir% >> %GITHUB_ENV%
- name: package
id: package
env:
archiveName: ${{ env.fileName }}-${{ matrix.qt_arch }}-${{ matrix.qt_ver }}
msvcArch: ${{ matrix.msvc_arch }}
shell: pwsh
run: |
& scripts\windows-publish.ps1 ${env:archiveName} ${env:targetName}
# 记录packageName给后续step
$name = ${env:archiveName}
echo "::set-output name=packageName::$name"
- uses: actions/upload-artifact@v2
with:
name: ${{ steps.package.outputs.packageName }}
path: ${{ steps.package.outputs.packageName }}
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.package.outputs.packageName }}.zip
asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.zip
tag: ${{ github.ref }}
overwrite: true

BIN
3rdparty/Win_x86/mingw/libcrypto-1_1.dll vendored Normal file

Binary file not shown.

BIN
3rdparty/Win_x86/mingw/libssl-1_1.dll vendored Normal file

Binary file not shown.

BIN
3rdparty/Win_x86/msvc/libcrypto-1_1.dll vendored Normal file

Binary file not shown.

BIN
3rdparty/Win_x86/msvc/libssl-1_1.dll vendored Normal file

Binary file not shown.

View File

@ -263,3 +263,53 @@ zxing-cpp
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
************************************************************************************
ChartJs2QML
MIT License
Copyright (c) 2020 ChartJs2QML contributors (starting with Elypson, Michael A. Voelkel, https://github.com/Elypson)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
************************************************************************************
qml-colorpicker
MIT License
Copyright (c) 2022 Ruslan Shestopalyuk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -53,7 +53,7 @@ endforeach(filepath)
if(QT_VERSION VERSION_GREATER_EQUAL "6.2")
#遍历所有qml文件
file(GLOB_RECURSE QML_PATHS *.qml qmldir)
file(GLOB_RECURSE QML_PATHS *.qml)
foreach(filepath ${QML_PATHS})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
if(${filepath} MATCHES "Qt${QT_VERSION_MAJOR}/")
@ -64,7 +64,7 @@ if(QT_VERSION VERSION_GREATER_EQUAL "6.2")
endforeach(filepath)
#遍历所有资源文件
file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp)
file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp qmldir)
foreach(filepath ${RES_PATHS})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND resource_files ${filename})
@ -93,12 +93,17 @@ else ()
)
endif ()
#复制动态库到可执行文件同级目录下
if(WIN32)
#复制动态库到可执行文件同级目录下
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(3RDPARTY_ARCH_DIR ${CMAKE_SOURCE_DIR}/3rdparty/Win_x86)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(3RDPARTY_ARCH_DIR ${CMAKE_SOURCE_DIR}/3rdparty/Win_x64)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/msvc/*.dll)
set(DLLPATH ${3RDPARTY_ARCH_DIR}/msvc/*.dll)
else()
set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/mingw/*.dll)
set(DLLPATH ${3RDPARTY_ARCH_DIR}/mingw/*.dll)
endif()
string(REPLACE "/" ${PATH_SEPARATOR} DLLPATH "${DLLPATH}")
file(GLOB DLL_FILES ${DLLPATH})
@ -122,7 +127,7 @@ else()
target_include_directories(example PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
target_sources(example PRIVATE resource.qrc)
target_sources(example PRIVATE example.qrc)
endif()
#导入component头文件,不然通过QML_NAMED_ELEMENT生成的c++类会找不到头文件报错
@ -130,6 +135,13 @@ target_include_directories(example PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/component
)
#如何是静态库则需要手动注册插件导入FluentUI.h头文件
if(FLUENTUI_BUILD_STATIC_LIB)
target_include_directories(example PRIVATE
${CMAKE_SOURCE_DIR}/src
)
endif()
#设置属性
set_target_properties(example PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
@ -139,18 +151,6 @@ set_target_properties(example PROPERTIES
WIN32_EXECUTABLE TRUE
)
#链接库
if (FLUENTUI_BUILD_STATIC_LIB)
target_link_libraries(example PRIVATE
Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::Svg
Qt${QT_VERSION_MAJOR}::Network
fluentui
fluentuiplugin
FramelessHelper::Core
FramelessHelper::Quick
)
else()
target_link_libraries(example PRIVATE
Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::Svg
@ -159,7 +159,6 @@ else()
FramelessHelper::Core
FramelessHelper::Quick
)
endif()
#安装
install(TARGETS example

View File

@ -126,7 +126,6 @@
<file>qml/component/CustomWindow.qml</file>
<file>qml/global/ItemsFooter.qml</file>
<file>qml/global/ItemsOriginal.qml</file>
<file>qml/global/MainEvent.qml</file>
<file>qml/global/qmldir</file>
<file>qml/page/T_Acrylic.qml</file>
<file>qml/page/T_Awesome.qml</file>
@ -184,5 +183,9 @@
<file>qml/window/StandardWindow.qml</file>
<file>res/image/bg_scenic.png</file>
<file>res/image/image_1.jpg</file>
<file>qml/window/PageWindow.qml</file>
<file>qml/page/T_StaggeredView.qml</file>
<file>qml/viewmodel/SettingsViewModel.qml</file>
<file>qml/viewmodel/TextBoxViewModel.qml</file>
</qresource>
</RCC>

View File

@ -28,6 +28,7 @@ Window {
FluApp.init(app)
FluTheme.darkMode = FluThemeType.System
FluTheme.enableAnimation = true
FluTheme.nativeText = true
FluApp.routes = {
"/":"qrc:/example/qml/window/MainWindow.qml",
"/about":"qrc:/example/qml/window/AboutWindow.qml",
@ -35,7 +36,8 @@ Window {
"/hotload":"qrc:/example/qml/window/HotloadWindow.qml",
"/singleTaskWindow":"qrc:/example/qml/window/SingleTaskWindow.qml",
"/standardWindow":"qrc:/example/qml/window/StandardWindow.qml",
"/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml"
"/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml",
"/pageWindow":"qrc:/example/qml/window/PageWindow.qml"
}
FluApp.initialRoute = "/"
FluApp.httpInterceptor = interceptor

View File

@ -136,7 +136,11 @@ FluExpander{
"FluTour",
"FluQRCode",
"FluTimeline",
"FluChart"
"FluChart",
"FluRangeSlider",
"FluStaggeredView",
"FluProgressButton",
"FluLoadingButton"
];
code = code.replace(/\n/g, "<br>");
code = code.replace(/ /g, "&nbsp;");

View File

@ -14,7 +14,8 @@ FluObject{
FluPaneItem{
title:lang.about
icon:FluentIcons.Contact
tapFunc:function(){
onDropped: { FluApp.navigate("/about") }
onTapListener:function(){
FluApp.navigate("/about")
}
}
@ -22,8 +23,10 @@ FluObject{
FluPaneItem{
title:lang.settings
icon:FluentIcons.Settings
url:"qrc:/example/qml/page/T_Settings.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
navigationView.push("qrc:/example/qml/page/T_Settings.qml")
navigationView.push(url)
}
}

View File

@ -21,11 +21,13 @@ FluObject{
count: item_home.count
}
icon:FluentIcons.Home
url:"qrc:/example/qml/page/T_Home.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
if(navigationView.getCurrentUrl()){
item_home.count = 0
}
navigationView.push("qrc:/example/qml/page/T_Home.qml")
navigationView.push(url)
}
editDelegate: FluTextBox{
text:item_home.title
@ -69,9 +71,11 @@ FluObject{
image:"qrc:/example/res/image/control/Button.png"
recentlyUpdated:true
desc:"A control that responds to user input and raisesa Click event."
url:"qrc:/example/qml/page/T_Buttons.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
item_buttons.count = 0
navigationView.push("qrc:/example/qml/page/T_Buttons.qml")
navigationView.push(url)
}
}
FluPaneItem{
@ -82,46 +86,48 @@ FluObject{
count: item_text.count
color: Qt.rgba(82/255,196/255,26/255,1)
}
url:"qrc:/example/qml/page/T_Text.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
item_text.count = 0
navigationView.push("qrc:/example/qml/page/T_Text.qml")
navigationView.push(url)
}
}
FluPaneItem{
title:"Image"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Image.qml")
}
url:"qrc:/example/qml/page/T_Image.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Slider"
image:"qrc:/example/res/image/control/Slider.png"
recentlyUpdated:true
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
onTap:{
navigationView.push("qrc:/example/qml/page/T_Slider.qml")
}
url:"qrc:/example/qml/page/T_Slider.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"CheckBox"
image:"qrc:/example/res/image/control/Checkbox.png"
recentlyUpdated:true
desc:"A control that a user can select or clear."
onTap:{
navigationView.push("qrc:/example/qml/page/T_CheckBox.qml")
}
url:"qrc:/example/qml/page/T_CheckBox.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"RadioButton"
onTap:{
navigationView.push("qrc:/example/qml/page/T_RadioButton.qml")
}
url:"qrc:/example/qml/page/T_RadioButton.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"ToggleSwitch"
onTap:{
navigationView.push("qrc:/example/qml/page/T_ToggleSwitch.qml")
}
url:"qrc:/example/qml/page/T_ToggleSwitch.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -130,33 +136,33 @@ FluObject{
icon:FluentIcons.GridView
FluPaneItem{
title:"TextBox"
onTap:{
navigationView.push("qrc:/example/qml/page/T_TextBox.qml")
}
url:"qrc:/example/qml/page/T_TextBox.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TimePicker"
onTap:{
navigationView.push("qrc:/example/qml/page/T_TimePicker.qml")
}
url:"qrc:/example/qml/page/T_TimePicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"DatePicker"
onTap:{
navigationView.push("qrc:/example/qml/page/T_DatePicker.qml")
}
url:"qrc:/example/qml/page/T_DatePicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"CalendarPicker"
onTap:{
navigationView.push("qrc:/example/qml/page/T_CalendarPicker.qml")
}
url:"qrc:/example/qml/page/T_CalendarPicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"ColorPicker"
onTap:{
navigationView.push("qrc:/example/qml/page/T_ColorPicker.qml")
}
url:"qrc:/example/qml/page/T_ColorPicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -168,57 +174,63 @@ FluObject{
image:"qrc:/example/res/image/control/InfoBar.png"
recentlyUpdated:true
desc:"An inline message to display app-wide statuschange information."
onTap:{
navigationView.push("qrc:/example/qml/page/T_InfoBar.qml")
}
url:"qrc:/example/qml/page/T_InfoBar.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Progress"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Progress.qml")
}
url:"qrc:/example/qml/page/T_Progress.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"RatingControl"
onTap:{
navigationView.push("qrc:/example/qml/page/T_RatingControl.qml")
}
url:"qrc:/example/qml/page/T_RatingControl.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Badge"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Badge.qml")
}
url:"qrc:/example/qml/page/T_Badge.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Rectangle"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Rectangle.qml")
}
url:"qrc:/example/qml/page/T_Rectangle.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"StatusView"
onTap:{
navigationView.push("qrc:/example/qml/page/T_StatusView.qml")
}
url:"qrc:/example/qml/page/T_StatusView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Carousel"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Carousel.qml")
}
url:"qrc:/example/qml/page/T_Carousel.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Expander"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Expander.qml")
url:"qrc:/example/qml/page/T_Expander.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"StaggeredView"
url:"qrc:/example/qml/page/T_StaggeredView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Watermark"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Watermark.qml")
}
url:"qrc:/example/qml/page/T_Watermark.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -227,9 +239,9 @@ FluObject{
icon:FluentIcons.ButtonMenu
FluPaneItem{
title:"Dialog"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Dialog.qml")
}
url:"qrc:/example/qml/page/T_Dialog.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
id:item_combobox
@ -239,6 +251,8 @@ FluObject{
count: item_combobox.count
color: Qt.rgba(250/255,173/255,20/255,1)
}
url:"qrc:/example/qml/page/T_ComboBox.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
item_combobox.count = 0
navigationView.push("qrc:/example/qml/page/T_ComboBox.qml")
@ -246,15 +260,15 @@ FluObject{
}
FluPaneItem{
title:"Tooltip"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Tooltip.qml")
}
url:"qrc:/example/qml/page/T_Tooltip.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Menu"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Menu.qml")
}
url:"qrc:/example/qml/page/T_Menu.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -267,15 +281,15 @@ FluObject{
recentlyAdded:true
order:3
desc:"Presents information from different sources in atabbed view."
onTap:{
navigationView.push("qrc:/example/qml/page/T_Pivot.qml")
}
url:"qrc:/example/qml/page/T_Pivot.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"BreadcrumbBar"
onTap:{
navigationView.push("qrc:/example/qml/page/T_BreadcrumbBar.qml")
}
url:"qrc:/example/qml/page/T_BreadcrumbBar.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TabView"
@ -283,15 +297,15 @@ FluObject{
recentlyAdded:true
order:1
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
onTap:{
navigationView.push("qrc:/example/qml/page/T_TabView.qml")
}
url:"qrc:/example/qml/page/T_TabView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TreeView"
onTap:{
navigationView.push("qrc:/example/qml/page/T_TreeView.qml")
}
url:"qrc:/example/qml/page/T_TreeView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TableView"
@ -299,21 +313,21 @@ FluObject{
recentlyAdded:true
order:4
desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"
onTap:{
navigationView.push("qrc:/example/qml/page/T_TableView.qml")
}
url:"qrc:/example/qml/page/T_TableView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Pagination"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Pagination.qml")
}
url:"qrc:/example/qml/page/T_Pagination.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"MultiWindow"
onTap:{
navigationView.push("qrc:/example/qml/page/T_MultiWindow.qml")
}
url:"qrc:/example/qml/page/T_MultiWindow.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"FlipView"
@ -321,9 +335,9 @@ FluObject{
recentlyAdded:true
order:2
desc:"Presents a collection of items that the user canflip through, one item at a time."
onTap:{
navigationView.push("qrc:/example/qml/page/T_FlipView.qml")
}
url:"qrc:/example/qml/page/T_FlipView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -332,27 +346,27 @@ FluObject{
icon:FluentIcons.Brightness
FluPaneItem{
title:"Acrylic"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Acrylic.qml")
}
url:"qrc:/example/qml/page/T_Acrylic.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Theme"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Theme.qml")
}
url:"qrc:/example/qml/page/T_Theme.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Typography"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Typography.qml")
}
url:"qrc:/example/qml/page/T_Typography.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Awesome"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Awesome.qml")
}
url:"qrc:/example/qml/page/T_Awesome.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -366,45 +380,45 @@ FluObject{
icon:FluentIcons.Shop
FluPaneItem{
title:"QRCode"
onTap:{
navigationView.push("qrc:/example/qml/page/T_QRCode.qml")
}
url:"qrc:/example/qml/page/T_QRCode.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Tour"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Tour.qml")
}
url:"qrc:/example/qml/page/T_Tour.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Timeline"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Timeline.qml")
}
url:"qrc:/example/qml/page/T_Timeline.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Screenshot"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Screenshot.qml")
}
title:"Screenshot(Todo)"
url:"qrc:/example/qml/page/T_Screenshot.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Captcha"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Captcha.qml")
}
url:"qrc:/example/qml/page/T_Captcha.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Chart"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Chart.qml")
}
url:"qrc:/example/qml/page/T_Chart.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Http"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Http.qml")
}
url:"qrc:/example/qml/page/T_Http.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
id:item_other
@ -414,6 +428,8 @@ FluObject{
count: item_other.count
color: Qt.rgba(82/255,196/255,26/255,1)
}
url:"qrc:/example/qml/page/T_RemoteLoader.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
item_other.count = 0
navigationView.push("qrc:/example/qml/page/T_RemoteLoader.qml")
@ -421,9 +437,10 @@ FluObject{
}
FluPaneItem{
title:"HotLoader"
tapFunc:function(){
onTapListener:function(){
FluApp.navigate("/hotload")
}
onDropped:{ FluApp.navigate("/hotload") }
}
}

View File

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

View File

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

View File

@ -50,7 +50,7 @@ FluScrollablePage{
FluRectangle{
width: 1920/4
height: 1200/4
radius:[15,15,15,15]
radius:[8,8,8,8]
Image {
id:image
asynchronous: true

View File

@ -161,6 +161,97 @@ FluScrollablePage{
}'
}
Timer{
id:timer_progress
interval: 200
onTriggered: {
btn_progress.progress = (btn_progress.progress + 0.1).toFixed(1)
if(btn_progress.progress==1){
timer_progress.stop()
}else{
timer_progress.start()
}
}
}
FluArea{
Layout.fillWidth: true
height: 68
Layout.topMargin: 20
paddings: 10
FluProgressButton{
id:btn_progress
disabled:progress_button_switch.checked
text:"Progress Button"
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
onClicked: {
btn_progress.progress = 0
timer_progress.restart()
}
}
FluToggleSwitch{
id:progress_button_switch
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text:"Disabled"
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
code:'FluProgressButton{
text:"Progress Button"
onClicked: {
}
}'
}
FluArea{
Layout.fillWidth: true
height: 68
Layout.topMargin: 20
paddings: 10
FluLoadingButton{
id:btn_loading
loading:loading_button_switch.checked
text:"Loading Button"
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
onClicked: {
}
}
FluToggleSwitch{
id:loading_button_switch
checked: true
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text:"Loading"
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
code:'FluLoadingButton{
text:"Loading Button"
onClicked: {
}
}'
}
FluArea{
Layout.fillWidth: true

View File

@ -9,10 +9,10 @@ FluScrollablePage{
title:"Captcha"
FluCaptcha{
id:captcha
Layout.topMargin: 20
ignoreCase:switch_case.checked
MouseArea{
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
@ -30,6 +30,13 @@ FluScrollablePage{
}
}
FluToggleSwitch{
id:switch_case
text:"Ignore Case"
checked: true
Layout.topMargin: 10
}
RowLayout{
spacing: 10
Layout.topMargin: 10
@ -49,6 +56,4 @@ FluScrollablePage{
}
}
}
}

View File

@ -36,8 +36,15 @@ FluScrollablePage{
FluText{
text:"轮播图支持无限轮播无限滑动用ListView实现的组件"
}
Item{
width: 400
height: 300
FluShadow{
radius: 8
}
FluCarousel{
radius:[5,5,5,5]
anchors.fill: parent
radius:[8,8,8,8]
delegate: Component{
Image {
anchors.fill: parent
@ -54,6 +61,7 @@ FluScrollablePage{
}
}
}
}
FluArea{
Layout.fillWidth: true
@ -66,8 +74,15 @@ FluScrollablePage{
verticalCenter: parent.verticalCenter
left:parent.left
}
Item{
width: 400
height: 300
FluShadow{
radius: 8
}
FluCarousel{
radius:[15,15,15,15]
anchors.fill: parent
radius:[8,8,8,8]
loopTime:1500
indicatorGravity: Qt.AlignHCenter | Qt.AlignTop
indicatorMarginTop:15
@ -107,6 +122,8 @@ FluScrollablePage{
}
}
}
}
}
CodeExpander{

View File

@ -28,6 +28,7 @@ FluScrollablePage{
fillMode:Image.PreserveAspectCrop
anchors.fill: parent
verticalAlignment: Qt.AlignTop
sourceSize: Qt.size(960,640)
source: "qrc:/example/res/image/bg_home_header.png"
}
Rectangle{
@ -69,12 +70,12 @@ FluScrollablePage{
width: 220
height: 240
FluShadow{
radius:8
radius:5
anchors.fill: item_content
}
FluItem{
id:item_content
radius: [8,8,8,8]
radius: [5,5,5,5]
width: 200
height: 220
anchors.centerIn: parent
@ -88,7 +89,7 @@ FluScrollablePage{
}
Rectangle{
anchors.fill: parent
radius: 8
radius: 5
color:{
if(FluTheme.dark){
if(item_mouse.containsMouse){

View File

@ -10,14 +10,63 @@ import "qrc:///example/qml/component"
FluContentPage{
title:"Http"
property string cacheDirPath: FluTools.getApplicationDirPath() + "/cache/http"
property bool isDownCompleted: false
FluHttp{
id:http
cacheDir:cacheDirPath
}
FluHttp{
id:http_breakpoint_download
cacheDir:cacheDirPath
breakPointDownload: true
}
FluHttp{
id:http_cache_ifnonecacherequest
cacheMode:FluHttpType.IfNoneCacheRequest
cacheDir:cacheDirPath
}
FluHttp{
id:http_cache_requestfailedreadcache
cacheMode:FluHttpType.RequestFailedReadCache
cacheDir:cacheDirPath
}
FluHttp{
id:http_cache_firstcachethenrequest
cacheMode:FluHttpType.FirstCacheThenRequest
cacheDir:cacheDirPath
}
HttpCallable{
id:callable
onStart: {
showLoading()
}
onFinish: {
hideLoading()
}
onError:
(status,errorString,result)=>{
console.debug(status+";"+errorString+";"+result)
}
onSuccess:
(result)=>{
text_info.text = result
}
onCache:
(result)=>{
text_info.text = result
}
}
Flickable{
id:layout_flick
width: 160
width: 200
clip: true
anchors{
top: parent.top
@ -36,21 +85,8 @@ FluContentPage{
implicitHeight: 36
text: "Get请求"
onClicked: {
var callable = {}
callable.onStart = function(){
showLoading()
}
callable.onFinish = function(){
hideLoading()
}
callable.onSuccess = function(result){
text_info.text = result
console.debug(result)
}
callable.onError = function(status,errorString){
console.debug(status+";"+errorString)
}
http.get("https://httpbingo.org/get",callable)
var request = http.newRequest("https://httpbingo.org/get")
http.get(request,callable)
}
}
FluButton{
@ -58,25 +94,13 @@ FluContentPage{
implicitHeight: 36
text: "Post表单请求"
onClicked: {
var callable = {}
callable.onStart = function(){
showLoading()
}
callable.onFinish = function(){
hideLoading()
}
callable.onSuccess = function(result){
text_info.text = result
console.debug(result)
}
callable.onError = function(status,errorString){
console.debug(status+";"+errorString)
}
var param = {}
param.custname = "朱子楚"
param.custtel = "1234567890"
param.custemail = "zhuzichu520@gmail.com"
http.post("https://httpbingo.org/post",callable,param)
var request = http.newRequest("https://httpbingo.org/post")
var params = {}
params.custname = "朱子楚"
params.custtel = "1234567890"
params.custemail = "zhuzichu520@gmail.com"
request.params = params
http.post(request,callable)
}
}
FluButton{
@ -84,25 +108,13 @@ FluContentPage{
implicitHeight: 36
text: "Post Json请求"
onClicked: {
var callable = {}
callable.onStart = function(){
showLoading()
}
callable.onFinish = function(){
hideLoading()
}
callable.onSuccess = function(result){
text_info.text = result
console.debug(result)
}
callable.onError = function(status,errorString){
console.debug(status+";"+errorString)
}
var param = {}
param.custname = "朱子楚"
param.custtel = "1234567890"
param.custemail = "zhuzichu520@gmail.com"
http.postJson("https://httpbingo.org/post",callable,param)
var request = http.newRequest("https://httpbingo.org/post")
var params = {}
params.custname = "朱子楚"
params.custtel = "1234567890"
params.custemail = "zhuzichu520@gmail.com"
request.params = params
http.postJson(request,callable)
}
}
FluButton{
@ -110,25 +122,12 @@ FluContentPage{
implicitHeight: 36
text: "Post String请求"
onClicked: {
var callable = {}
callable.onStart = function(){
showLoading()
}
callable.onFinish = function(){
hideLoading()
}
callable.onSuccess = function(result){
text_info.text = result
console.debug(result)
}
callable.onError = function(status,errorString){
console.debug(status+";"+errorString)
}
var param = "我命由我不由天"
http.postString("https://httpbingo.org/post",callable,param)
var request = http.newRequest("https://httpbingo.org/post")
request.params = "我命由我不由天"
http.postString(request,callable)
}
}
FluButton{
FluProgressButton{
id:btn_download
implicitWidth: parent.width
implicitHeight: 36
@ -137,7 +136,90 @@ FluContentPage{
folder_dialog.open()
}
}
FluButton{
FluProgressButton{
property bool downloading: false
id:btn_breakpoint_download
implicitWidth: parent.width
implicitHeight: 36
text: {
if(downloading){
return "暂停下载"
}
if(progress === 0){
return "断点下载文件"
}else if(progress === 1){
return "打开文件"
}else{
return "继续下载"
}
}
HttpRequest{
id:request_breakpoint_download
url: "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
downloadSavePath: FluTools.getApplicationDirPath()+ "/download/big_buck_bunny.mp4"
}
HttpCallable{
id:callable_breakpoint_download
onStart: {
btn_breakpoint_download.downloading = true
}
onFinish: {
btn_breakpoint_download.downloading = false
}
onError:
(status,errorString,result)=>{
console.debug(status+";"+errorString+";"+result)
}
onSuccess:
(result)=>{
if(!isDownCompleted){
tour.open()
isDownCompleted = true
}
showSuccess(result)
}
onDownloadProgress:
(recv,total)=>{
btn_breakpoint_download.progress = recv/total
}
}
Component.onCompleted: {
progress = http_breakpoint_download.getBreakPointProgress(request_breakpoint_download)
}
onClicked: {
if(downloading){
http_breakpoint_download.cancel()
return
}
if(progress === 1){
FluTools.showFileInFolder(request_breakpoint_download.downloadSavePath)
}else{
http_breakpoint_download.download(request_breakpoint_download,callable_breakpoint_download)
}
}
FluMenu{
id:menu_breakpoint_download
width: 120
FluMenuItem{
text: "删除文件"
onClicked: {
if(FluTools.removeFile(request_breakpoint_download.downloadSavePath)){
btn_breakpoint_download.progress = 0
}
}
}
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: {
if(btn_breakpoint_download.progress === 1){
menu_breakpoint_download.popup()
}
}
}
}
FluProgressButton{
id:btn_upload
implicitWidth: parent.width
implicitHeight: 36
@ -146,81 +228,143 @@ FluContentPage{
file_dialog.open()
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "FirstCacheThenRequest缓存"
onClicked: {
var request = http.newRequest("https://httpbingo.org/post")
request.params = {cacheMode:"FirstCacheThenRequest"}
http_cache_firstcachethenrequest.post(request,callable)
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "RequestFailedReadCache缓存"
onClicked: {
var request = http.newRequest("https://httpbingo.org/post")
request.params = {cacheMode:"RequestFailedReadCache"}
http_cache_requestfailedreadcache.post(request,callable)
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "IfNoneCacheRequest缓存"
onClicked: {
var request = http.newRequest("https://httpbingo.org/post")
request.params = {cacheMode:"IfNoneCacheRequest"}
http_cache_ifnonecacherequest.post(request,callable)
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "打开缓存路径"
onClicked: {
Qt.openUrlExternally("file:///"+cacheDirPath)
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "删除缓存"
onClicked: {
console.debug(FluTools.removeDir(cacheDirPath))
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "清空右边数据"
onClicked: {
text_info.text = ""
}
}
}
}
FluTour{
id:tour
steps:[
{title:"友情提示",description: "下载已完成,左击这里可以打开文件所在路径,右击可以弹出菜单删除文件!",target:()=>btn_breakpoint_download}
]
}
HttpCallable{
id:callable_upload
onStart: {
btn_upload.disabled = true
}
onFinish: {
btn_upload.disabled = false
}
onError:
(status,errorString,result)=>{
btn_upload.progress = 0
text_info.text = result
console.debug(result)
}
onSuccess:
(result)=>{
text_info.text = result
}
onUploadProgress:
(sent,total)=>{
btn_upload.progress = sent/total
}
}
FileDialog {
id: file_dialog
onAccepted: {
var param = {}
var request = http.newRequest("https://httpbingo.org/post")
var params = {}
for(var i=0;i<selectedFiles.length;i++){
var fileUrl = selectedFiles[i]
var fileName = FluTools.getFileNameByUrl(fileUrl)
var filePath = FluTools.toLocalPath(fileUrl)
param[fileName] = filePath
params[fileName] = filePath
}
console.debug(JSON.stringify(param))
var callable = {}
callable.onStart = function(){
btn_upload.disabled = true
}
callable.onFinish = function(){
btn_upload.disabled = false
btn_upload.text = "上传文件"
layout_upload_file_size.visible = false
text_upload_file_size.text = ""
}
callable.onSuccess = function(result){
text_info.text = result
console.debug(result)
}
callable.onError = function(status,errorString,result){
text_info.text = result
console.debug(result)
}
callable.onUploadProgress = function(sent,total){
var locale = Qt.locale()
var precent = (sent/total * 100).toFixed(0) + "%"
btn_upload.text = "上传中..."+precent
text_upload_file_size.text = "%1/%2".arg(locale.formattedDataSize(sent)).arg(locale.formattedDataSize(total))
layout_upload_file_size.visible = true
}
http.upload("https://httpbingo.org/post",callable,param)
request.params = params
http.upload(request,callable_upload)
}
}
HttpCallable{
id:callable_download
onStart: {
btn_download.progress = 0
btn_download.disabled = true
}
onFinish: {
btn_download.disabled = false
}
onError:
(status,errorString,result)=>{
btn_download.progress = 0
showError(errorString)
console.debug(status+";"+errorString+";"+result)
}
onSuccess:
(result)=>{
showSuccess(result)
}
onDownloadProgress:
(recv,total)=>{
btn_download.progress = recv/total
}
}
FolderDialog {
id: folder_dialog
currentFolder: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0]
onAccepted: {
var callable = {}
callable.onStart = function(){
btn_download.disabled = true
}
callable.onFinish = function(){
btn_download.disabled = false
btn_download.text = "下载文件"
layout_download_file_size.visible = false
text_download_file_size.text = ""
}
callable.onSuccess = function(result){
showSuccess(result)
}
callable.onError = function(status,errorString){
showError(errorString)
}
callable.onDownloadProgress = function(recv,total){
var locale = Qt.locale()
var precent = (recv/total * 100).toFixed(0) + "%"
btn_download.text = "下载中..."+precent
text_download_file_size.text = "%1/%2".arg(locale.formattedDataSize(recv)).arg(locale.formattedDataSize(total))
layout_download_file_size.visible = true
}
var path = FluTools.toLocalPath(currentFolder)+ "/big_buck_bunny.mp4"
http.download("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4",callable,path)
var request = http.newRequest("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
request.downloadSavePath = FluTools.toLocalPath(currentFolder)+ "/big_buck_bunny.mp4"
http.download(request,callable_download)
}
}
FluArea{
anchors{
top: layout_flick.top
@ -246,34 +390,4 @@ FluContentPage{
}
}
}
FluRectangle{
id:layout_download_file_size
radius: [4,4,4,4]
height: 36
width: 160
visible: false
x:layout_flick.width
y: 173 - layout_flick.contentY
FluText{
id:text_download_file_size
anchors.centerIn: parent
}
}
FluRectangle{
id:layout_upload_file_size
radius: [4,4,4,4]
height: 36
width: 160
visible: false
x:layout_flick.width
y: 210 - layout_flick.contentY
FluText{
id:text_upload_file_size
anchors.centerIn: parent
}
}
}

View File

@ -116,7 +116,7 @@ FluScrollablePage{
FluRectangle{
width: 1920/5
height: 1200/5
radius:[15,15,15,15]
radius:[8,8,8,8]
Image {
asynchronous: true
source: "qrc:/example/res/image/banner_1.jpg"

View File

@ -30,9 +30,10 @@ FluScrollablePage{
Layout.topMargin: 10
Layout.leftMargin: 4
Layout.bottomMargin: 4
radius: 4
color: FluTheme.dark ? FluColors.Black : FluColors.White
FluShadow{
radius: 0
radius: 4
color: FluTheme.primaryColor.dark
}
Image{

View File

@ -5,11 +5,58 @@ import QtQuick.Controls
import FluentUI
import "qrc:///example/qml/global"
import "qrc:///example/qml/component"
import "qrc:///example/qml/viewmodel"
FluScrollablePage{
title:"Settings"
SettingsViewModel{
id:viewmodel_settings
}
FluEvent{
id:event_checkupdate_finish
name: "checkUpdateFinish"
onTriggered: {
btn_checkupdate.loading = false
}
}
Component.onCompleted: {
FluEventBus.registerEvent(event_checkupdate_finish)
}
Component.onDestruction: {
FluEventBus.unRegisterEvent(event_checkupdate_finish)
}
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
height: 60
paddings: 10
Row{
spacing: 20
anchors.verticalCenter: parent.verticalCenter
FluText{
text:"当前版本 v%1".arg(appInfo.version)
font: FluTextStyle.Body
anchors.verticalCenter: parent.verticalCenter
}
FluLoadingButton{
id:btn_checkupdate
text:"检查更新"
anchors.verticalCenter: parent.verticalCenter
onClicked: {
loading = true
FluEventBus.post("checkUpdate")
}
}
}
}
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
@ -60,10 +107,10 @@ FluScrollablePage{
Repeater{
model: [{title:"Open",mode:FluNavigationViewType.Open},{title:"Compact",mode:FluNavigationViewType.Compact},{title:"Minimal",mode:FluNavigationViewType.Minimal},{title:"Auto",mode:FluNavigationViewType.Auto}]
delegate: FluRadioButton{
checked : MainEvent.displayMode===modelData.mode
checked : viewmodel_settings.displayMode===modelData.mode
text:modelData.title
clickListener:function(){
MainEvent.displayMode = modelData.mode
viewmodel_settings.displayMode = modelData.mode
}
}
}

View File

@ -11,13 +11,20 @@ FluScrollablePage{
FluArea{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.preferredHeight: 200
Layout.topMargin: 20
paddings: 10
Row{
spacing: 30
FluSlider{
}
FluSlider{
orientation: Qt.Vertical
anchors.verticalCenter: parent.verticalCenter
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
@ -26,25 +33,27 @@ FluScrollablePage{
}'
}
FluArea{
Layout.fillWidth: true
height: 200
paddings: 10
Layout.preferredHeight: 200
Layout.topMargin: 20
FluSlider{
paddings: 10
Row{
spacing: 30
FluRangeSlider{
}
FluRangeSlider{
orientation: Qt.Vertical
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
code:'FluSlider{
code:'FluRangeSlider{
orientation: Qt.Vertical
value:50
}'
}
}

View File

@ -0,0 +1,59 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import "qrc:///example/qml/component"
import FluentUI 1.0
FluContentPage{
title:"StaggeredView"
property var colors : [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
ListModel{
id:list_model
Component.onCompleted: {
for(var i=0;i<=100;i++){
var item = {}
item.color = colors[rand(0,7)].dark
item.height = rand(100,300)
append(item)
}
}
}
Flickable{
id: scroll
anchors.fill: parent
anchors.topMargin: 20
boundsBehavior:Flickable.StopAtBounds
contentHeight: staggered_view.implicitHeight
clip: true
ScrollBar.vertical: FluScrollBar {}
FluStaggeredView{
id:staggered_view
width: parent.width
itemWidth: 160
model:list_model
delegate: Rectangle{
height: model.height
color:model.color
FluText{
color:"#FFFFFF"
text:model.index
font.bold: true
font.pixelSize: 18
anchors.centerIn: parent
}
}
}
}
function rand(minNum, maxNum){
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
}
}

View File

@ -4,12 +4,19 @@ import QtQuick.Layouts
import QtQuick.Window
import FluentUI
import "qrc:///example/qml/component"
import "qrc:///example/qml/viewmodel"
FluScrollablePage{
launchMode: FluPageType.SingleInstance
title:"TextBox"
TextBoxViewModel{
id:viewModel
}
Component.onDestruction: {
console.debug("T_TextBox页面销毁了")
}
FluArea{
Layout.fillWidth: true
height: 68
@ -20,6 +27,10 @@ FluScrollablePage{
placeholderText: "单行输入框"
disabled:text_box_switch.checked
cleanEnabled: true
text:viewModel.text1
onTextChanged: {
viewModel.text1 = text
}
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
@ -84,6 +95,10 @@ FluScrollablePage{
FluMultilineTextBox{
id:multiine_textbox
placeholderText: "多行输入框"
text:viewModel.text2
onTextChanged: {
viewModel.text2 = text
}
disabled:text_box_multi_switch.checked
anchors{
verticalCenter: parent.verticalCenter

View File

@ -0,0 +1,13 @@
import QtQuick
import FluentUI
FluViewModel{
objectName: "SettingsViewModel"
property int displayMode
onInitData: {
displayMode = FluNavigationViewType.Auto
}
}

View File

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

View File

@ -7,6 +7,7 @@ import FluentUI
import example
import "qrc:///example/qml/component"
import "qrc:///example/qml/global"
import "qrc:///example/qml/viewmodel"
CustomWindow {
@ -20,14 +21,32 @@ CustomWindow {
appBarVisible: false
launchMode: FluWindowType.SingleTask
SettingsViewModel{
id:viewmodel_settings
}
closeFunc:function(event){
dialog_close.open()
event.accepted = false
}
FluEvent{
id:event_checkupdate
name: "checkUpdate"
onTriggered: {
checkUpdate(false)
}
}
Component.onCompleted: {
FluTools.setQuitOnLastWindowClosed(false)
tour.open()
checkUpdate(true)
FluEventBus.registerEvent(event_checkupdate)
}
Component.onDestruction: {
FluEventBus.unRegisterEvent(event_checkupdate)
}
SystemTrayIcon {
@ -133,13 +152,11 @@ CustomWindow {
}
}
}
FluRemoteLoader{
id:loader
lazy: true
anchors.fill: parent
// source: "http://localhost:9000/RemoteComponent.qml"
source: "https://zhu-zichu.gitee.io/RemoteComponent.qml"
source: "https://zhu-zichu.gitee.io/Qt6_156_LieflatPage.qml"
}
}
front: Item{
@ -165,13 +182,13 @@ CustomWindow {
height: parent.height
z:999
//Stack模式每次切换都会将页面压入栈中随着栈的页面增多消耗的内存也越多内存消耗多就会卡顿这时候就需要按返回将页面pop掉释放内存。该模式可以配合FluPage中的launchMode属性设置页面的启动模式
pageMode: FluNavigationViewType.Stack
// pageMode: FluNavigationViewType.Stack
//NoStack模式每次切换都会销毁之前的页面然后创建一个新的页面只需消耗少量内存推荐
// pageMode: FluNavigationViewType.NoStack
pageMode: FluNavigationViewType.NoStack
items: ItemsOriginal
footerItems:ItemsFooter
topPadding:FluTools.isMacos() ? 20 : 0
displayMode:MainEvent.displayMode
displayMode:viewmodel_settings.displayMode
logo: "qrc:/example/res/image/favicon.ico"
title:"FluentUI"
onLogoClicked:{
@ -277,4 +294,77 @@ CustomWindow {
]
}
FluHttp{
id:http
}
FpsItem{
id:fps_item
}
FluText{
text:"fps %1".arg(fps_item.fps)
opacity: 0.3
anchors{
bottom: parent.bottom
right: parent.right
bottomMargin: 5
rightMargin: 5
}
}
FluContentDialog{
property string newVerson
property string body
id:dialog_update
title:"升级提示"
message:"FluentUI目前最新版本 "+ newVerson +" -- 当前应用版本 "+appInfo.version+" \n现在是否去下载新版本\n\n更新内容\n"+body
buttonFlags: FluContentDialogType.NegativeButton | FluContentDialogType.PositiveButton
negativeText: "取消"
positiveText:"确定"
onPositiveClicked:{
Qt.openUrlExternally("https://github.com/zhuzichu520/FluentUI/releases/latest")
}
}
HttpCallable{
id:callable
property bool silent: true
onStart: {
console.debug("satrt check update...")
}
onFinish: {
console.debug("check update finish")
FluEventBus.post("checkUpdateFinish");
}
onSuccess:
(result)=>{
var data = JSON.parse(result)
console.debug("current version "+appInfo.version)
console.debug("new version "+data.tag_name)
if(data.tag_name !== appInfo.version){
dialog_update.newVerson = data.tag_name
dialog_update.body = data.body
dialog_update.open()
}else{
if(!silent){
showInfo("当前版本已经是最新版")
}
}
}
onError:
(status,errorString)=>{
if(!silent){
showError("网络异常!")
}
console.debug(status+";"+errorString)
}
}
function checkUpdate(silent){
callable.silent = silent
var request = http.newRequest("https://api.github.com/repos/zhuzichu520/FluentUI/releases/latest")
http.get(request,callable);
}
}

View File

@ -0,0 +1,25 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import FluentUI
import example
import "qrc:///example/qml/component"
CustomWindow {
id:window
width: 800
height: 600
minimumWidth: 520
minimumHeight: 200
launchMode: FluWindowType.SingleInstance
onInitArgument:
(arg)=>{
window.title = arg.title
loader.setSource( arg.url,{animDisabled:true})
}
Loader{
id: loader
anchors.fill: parent
}
}

View File

@ -28,6 +28,7 @@ Window {
FluApp.init(app)
FluTheme.darkMode = FluThemeType.System
FluTheme.enableAnimation = true
FluTheme.nativeText = true
FluApp.routes = {
"/":"qrc:/example/qml/window/MainWindow.qml",
"/about":"qrc:/example/qml/window/AboutWindow.qml",
@ -35,7 +36,8 @@ Window {
"/hotload":"qrc:/example/qml/window/HotloadWindow.qml",
"/singleTaskWindow":"qrc:/example/qml/window/SingleTaskWindow.qml",
"/standardWindow":"qrc:/example/qml/window/StandardWindow.qml",
"/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml"
"/singleInstanceWindow":"qrc:/example/qml/window/SingleInstanceWindow.qml",
"/pageWindow":"qrc:/example/qml/window/PageWindow.qml"
}
FluApp.initialRoute = "/"
FluApp.httpInterceptor = interceptor

View File

@ -136,7 +136,11 @@ FluExpander{
"FluTour",
"FluQRCode",
"FluTimeline",
"FluChart"
"FluChart",
"FluRangeSlider",
"FluStaggeredView",
"FluProgressButton",
"FluLoadingButton"
];
code = code.replace(/\n/g, "<br>");
code = code.replace(/ /g, "&nbsp;");

View File

@ -14,7 +14,8 @@ FluObject{
FluPaneItem{
title:lang.about
icon:FluentIcons.Contact
tapFunc:function(){
onDropped: { FluApp.navigate("/about") }
onTapListener:function(){
FluApp.navigate("/about")
}
}
@ -22,8 +23,10 @@ FluObject{
FluPaneItem{
title:lang.settings
icon:FluentIcons.Settings
url:"qrc:/example/qml/page/T_Settings.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
navigationView.push("qrc:/example/qml/page/T_Settings.qml")
navigationView.push(url)
}
}

View File

@ -21,11 +21,13 @@ FluObject{
count: item_home.count
}
icon:FluentIcons.Home
url:"qrc:/example/qml/page/T_Home.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
if(navigationView.getCurrentUrl()){
item_home.count = 0
}
navigationView.push("qrc:/example/qml/page/T_Home.qml")
navigationView.push(url)
}
editDelegate: FluTextBox{
text:item_home.title
@ -69,9 +71,11 @@ FluObject{
image:"qrc:/example/res/image/control/Button.png"
recentlyUpdated:true
desc:"A control that responds to user input and raisesa Click event."
url:"qrc:/example/qml/page/T_Buttons.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
item_buttons.count = 0
navigationView.push("qrc:/example/qml/page/T_Buttons.qml")
navigationView.push(url)
}
}
FluPaneItem{
@ -82,46 +86,48 @@ FluObject{
count: item_text.count
color: Qt.rgba(82/255,196/255,26/255,1)
}
url:"qrc:/example/qml/page/T_Text.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
item_text.count = 0
navigationView.push("qrc:/example/qml/page/T_Text.qml")
navigationView.push(url)
}
}
FluPaneItem{
title:"Image"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Image.qml")
}
url:"qrc:/example/qml/page/T_Image.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Slider"
image:"qrc:/example/res/image/control/Slider.png"
recentlyUpdated:true
desc:"A control that lets the user select from a rangeof values by moving a Thumb control along atrack."
onTap:{
navigationView.push("qrc:/example/qml/page/T_Slider.qml")
}
url:"qrc:/example/qml/page/T_Slider.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"CheckBox"
image:"qrc:/example/res/image/control/Checkbox.png"
recentlyUpdated:true
desc:"A control that a user can select or clear."
onTap:{
navigationView.push("qrc:/example/qml/page/T_CheckBox.qml")
}
url:"qrc:/example/qml/page/T_CheckBox.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"RadioButton"
onTap:{
navigationView.push("qrc:/example/qml/page/T_RadioButton.qml")
}
url:"qrc:/example/qml/page/T_RadioButton.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"ToggleSwitch"
onTap:{
navigationView.push("qrc:/example/qml/page/T_ToggleSwitch.qml")
}
url:"qrc:/example/qml/page/T_ToggleSwitch.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -130,33 +136,33 @@ FluObject{
icon:FluentIcons.GridView
FluPaneItem{
title:"TextBox"
onTap:{
navigationView.push("qrc:/example/qml/page/T_TextBox.qml")
}
url:"qrc:/example/qml/page/T_TextBox.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TimePicker"
onTap:{
navigationView.push("qrc:/example/qml/page/T_TimePicker.qml")
}
url:"qrc:/example/qml/page/T_TimePicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"DatePicker"
onTap:{
navigationView.push("qrc:/example/qml/page/T_DatePicker.qml")
}
url:"qrc:/example/qml/page/T_DatePicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"CalendarPicker"
onTap:{
navigationView.push("qrc:/example/qml/page/T_CalendarPicker.qml")
}
url:"qrc:/example/qml/page/T_CalendarPicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"ColorPicker"
onTap:{
navigationView.push("qrc:/example/qml/page/T_ColorPicker.qml")
}
url:"qrc:/example/qml/page/T_ColorPicker.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -168,57 +174,63 @@ FluObject{
image:"qrc:/example/res/image/control/InfoBar.png"
recentlyUpdated:true
desc:"An inline message to display app-wide statuschange information."
onTap:{
navigationView.push("qrc:/example/qml/page/T_InfoBar.qml")
}
url:"qrc:/example/qml/page/T_InfoBar.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Progress"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Progress.qml")
}
url:"qrc:/example/qml/page/T_Progress.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"RatingControl"
onTap:{
navigationView.push("qrc:/example/qml/page/T_RatingControl.qml")
}
url:"qrc:/example/qml/page/T_RatingControl.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Badge"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Badge.qml")
}
url:"qrc:/example/qml/page/T_Badge.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Rectangle"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Rectangle.qml")
}
url:"qrc:/example/qml/page/T_Rectangle.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"StatusView"
onTap:{
navigationView.push("qrc:/example/qml/page/T_StatusView.qml")
}
url:"qrc:/example/qml/page/T_StatusView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Carousel"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Carousel.qml")
}
url:"qrc:/example/qml/page/T_Carousel.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Expander"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Expander.qml")
url:"qrc:/example/qml/page/T_Expander.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"StaggeredView"
url:"qrc:/example/qml/page/T_StaggeredView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Watermark"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Watermark.qml")
}
url:"qrc:/example/qml/page/T_Watermark.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -227,9 +239,9 @@ FluObject{
icon:FluentIcons.ButtonMenu
FluPaneItem{
title:"Dialog"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Dialog.qml")
}
url:"qrc:/example/qml/page/T_Dialog.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
id:item_combobox
@ -239,6 +251,8 @@ FluObject{
count: item_combobox.count
color: Qt.rgba(250/255,173/255,20/255,1)
}
url:"qrc:/example/qml/page/T_ComboBox.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
item_combobox.count = 0
navigationView.push("qrc:/example/qml/page/T_ComboBox.qml")
@ -246,15 +260,15 @@ FluObject{
}
FluPaneItem{
title:"Tooltip"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Tooltip.qml")
}
url:"qrc:/example/qml/page/T_Tooltip.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Menu"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Menu.qml")
}
url:"qrc:/example/qml/page/T_Menu.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -267,15 +281,15 @@ FluObject{
recentlyAdded:true
order:3
desc:"Presents information from different sources in atabbed view."
onTap:{
navigationView.push("qrc:/example/qml/page/T_Pivot.qml")
}
url:"qrc:/example/qml/page/T_Pivot.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"BreadcrumbBar"
onTap:{
navigationView.push("qrc:/example/qml/page/T_BreadcrumbBar.qml")
}
url:"qrc:/example/qml/page/T_BreadcrumbBar.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TabView"
@ -283,15 +297,15 @@ FluObject{
recentlyAdded:true
order:1
desc:"A control that displays a collection of tabs thatcan be used to display several documents."
onTap:{
navigationView.push("qrc:/example/qml/page/T_TabView.qml")
}
url:"qrc:/example/qml/page/T_TabView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TreeView"
onTap:{
navigationView.push("qrc:/example/qml/page/T_TreeView.qml")
}
url:"qrc:/example/qml/page/T_TreeView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"TableView"
@ -299,21 +313,21 @@ FluObject{
recentlyAdded:true
order:4
desc:"The TableView control provides a flexible way to display a collection of data in rows and columns"
onTap:{
navigationView.push("qrc:/example/qml/page/T_TableView.qml")
}
url:"qrc:/example/qml/page/T_TableView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Pagination"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Pagination.qml")
}
url:"qrc:/example/qml/page/T_Pagination.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"MultiWindow"
onTap:{
navigationView.push("qrc:/example/qml/page/T_MultiWindow.qml")
}
url:"qrc:/example/qml/page/T_MultiWindow.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"FlipView"
@ -321,9 +335,9 @@ FluObject{
recentlyAdded:true
order:2
desc:"Presents a collection of items that the user canflip through, one item at a time."
onTap:{
navigationView.push("qrc:/example/qml/page/T_FlipView.qml")
}
url:"qrc:/example/qml/page/T_FlipView.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -332,27 +346,27 @@ FluObject{
icon:FluentIcons.Brightness
FluPaneItem{
title:"Acrylic"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Acrylic.qml")
}
url:"qrc:/example/qml/page/T_Acrylic.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Theme"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Theme.qml")
}
url:"qrc:/example/qml/page/T_Theme.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Typography"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Typography.qml")
}
url:"qrc:/example/qml/page/T_Typography.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Awesome"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Awesome.qml")
}
url:"qrc:/example/qml/page/T_Awesome.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
}
@ -366,45 +380,45 @@ FluObject{
icon:FluentIcons.Shop
FluPaneItem{
title:"QRCode"
onTap:{
navigationView.push("qrc:/example/qml/page/T_QRCode.qml")
}
url:"qrc:/example/qml/page/T_QRCode.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Tour"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Tour.qml")
}
url:"qrc:/example/qml/page/T_Tour.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Timeline"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Timeline.qml")
}
url:"qrc:/example/qml/page/T_Timeline.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Screenshot"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Screenshot.qml")
}
title:"Screenshot(Todo)"
url:"qrc:/example/qml/page/T_Screenshot.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Captcha"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Captcha.qml")
}
url:"qrc:/example/qml/page/T_Captcha.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Chart"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Chart.qml")
}
url:"qrc:/example/qml/page/T_Chart.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
title:"Http"
onTap:{
navigationView.push("qrc:/example/qml/page/T_Http.qml")
}
url:"qrc:/example/qml/page/T_Http.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{ navigationView.push(url) }
}
FluPaneItem{
id:item_other
@ -414,6 +428,8 @@ FluObject{
count: item_other.count
color: Qt.rgba(82/255,196/255,26/255,1)
}
url:"qrc:/example/qml/page/T_RemoteLoader.qml"
onDropped:{ FluApp.navigate("/pageWindow",{title:title,url:url}) }
onTap:{
item_other.count = 0
navigationView.push("qrc:/example/qml/page/T_RemoteLoader.qml")
@ -421,9 +437,10 @@ FluObject{
}
FluPaneItem{
title:"HotLoader"
tapFunc:function(){
onTapListener:function(){
FluApp.navigate("/hotload")
}
onDropped:{ FluApp.navigate("/hotload") }
}
}

View File

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

View File

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

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{
@ -50,7 +51,7 @@ FluScrollablePage{
FluRectangle{
width: 1920/4
height: 1200/4
radius:[15,15,15,15]
radius:[8,8,8,8]
Image {
id:image
asynchronous: true

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{
@ -160,6 +161,97 @@ FluScrollablePage{
}'
}
Timer{
id:timer_progress
interval: 200
onTriggered: {
btn_progress.progress = (btn_progress.progress + 0.1).toFixed(1)
if(btn_progress.progress==1){
timer_progress.stop()
}else{
timer_progress.start()
}
}
}
FluArea{
Layout.fillWidth: true
height: 68
Layout.topMargin: 20
paddings: 10
FluProgressButton{
id:btn_progress
disabled:progress_button_switch.checked
text:"Progress Button"
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
onClicked: {
btn_progress.progress = 0
timer_progress.restart()
}
}
FluToggleSwitch{
id:progress_button_switch
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text:"Disabled"
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
code:'FluProgressButton{
text:"Progress Button"
onClicked: {
}
}'
}
FluArea{
Layout.fillWidth: true
height: 68
Layout.topMargin: 20
paddings: 10
FluLoadingButton{
id:btn_loading
loading:loading_button_switch.checked
text:"Loading Button"
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
onClicked: {
}
}
FluToggleSwitch{
id:loading_button_switch
checked: true
anchors{
right: parent.right
verticalCenter: parent.verticalCenter
}
text:"Loading"
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
code:'FluLoadingButton{
text:"Loading Button"
onClicked: {
}
}'
}
FluArea{
Layout.fillWidth: true

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,15 +4,16 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{
title:"Captcha"
FluCaptcha{
id:captcha
Layout.topMargin: 20
ignoreCase:switch_case.checked
MouseArea{
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
@ -30,6 +31,13 @@ FluScrollablePage{
}
}
FluToggleSwitch{
id:switch_case
text:"Ignore Case"
checked: true
Layout.topMargin: 10
}
RowLayout{
spacing: 10
Layout.topMargin: 10
@ -49,6 +57,4 @@ FluScrollablePage{
}
}
}
}

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{
@ -36,8 +37,15 @@ FluScrollablePage{
FluText{
text:"轮播图支持无限轮播无限滑动用ListView实现的组件"
}
Item{
width: 400
height: 300
FluShadow{
radius: 8
}
FluCarousel{
radius:[5,5,5,5]
anchors.fill: parent
radius:[8,8,8,8]
delegate: Component{
Image {
anchors.fill: parent
@ -54,6 +62,7 @@ FluScrollablePage{
}
}
}
}
FluArea{
Layout.fillWidth: true
@ -66,8 +75,15 @@ FluScrollablePage{
verticalCenter: parent.verticalCenter
left:parent.left
}
Item{
width: 400
height: 300
FluShadow{
radius: 8
}
FluCarousel{
radius:[15,15,15,15]
anchors.fill: parent
radius:[8,8,8,8]
loopTime:1500
indicatorGravity: Qt.AlignHCenter | Qt.AlignTop
indicatorMarginTop:15
@ -107,6 +123,8 @@ FluScrollablePage{
}
}
}
}
}
CodeExpander{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -29,6 +29,7 @@ FluScrollablePage{
anchors.fill: parent
asynchronous: true
verticalAlignment: Qt.AlignTop
sourceSize: Qt.size(960,640)
source: "qrc:/example/res/image/bg_home_header.png"
}
Rectangle{
@ -70,12 +71,12 @@ FluScrollablePage{
width: 220
height: 240
FluShadow{
radius:8
radius:5
anchors.fill: item_content
}
FluItem{
id:item_content
radius: [8,8,8,8]
radius: [5,5,5,5]
width: 200
height: 220
anchors.centerIn: parent
@ -89,7 +90,7 @@ FluScrollablePage{
}
Rectangle{
anchors.fill: parent
radius: 8
radius: 5
color:{
if(FluTheme.dark){
if(item_mouse.containsMouse){

View File

@ -6,18 +6,68 @@ import QtQuick.Controls 2.15
import QtQuick.Dialogs 1.3
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluContentPage{
title:"Http"
property string cacheDirPath: FluTools.getApplicationDirPath() + "/cache/http"
property bool isDownCompleted: false
FluHttp{
id:http
cacheDir:cacheDirPath
}
FluHttp{
id:http_breakpoint_download
cacheDir:cacheDirPath
breakPointDownload: true
}
FluHttp{
id:http_cache_ifnonecacherequest
cacheMode:FluHttpType.IfNoneCacheRequest
cacheDir:cacheDirPath
}
FluHttp{
id:http_cache_requestfailedreadcache
cacheMode:FluHttpType.RequestFailedReadCache
cacheDir:cacheDirPath
}
FluHttp{
id:http_cache_firstcachethenrequest
cacheMode:FluHttpType.FirstCacheThenRequest
cacheDir:cacheDirPath
}
HttpCallable{
id:callable
onStart: {
showLoading()
}
onFinish: {
hideLoading()
}
onError:
(status,errorString,result)=>{
console.debug(status+";"+errorString+";"+result)
}
onSuccess:
(result)=>{
text_info.text = result
}
onCache:
(result)=>{
text_info.text = result
}
}
Flickable{
id:layout_flick
width: 160
width: 200
clip: true
anchors{
top: parent.top
@ -36,21 +86,8 @@ FluContentPage{
implicitHeight: 36
text: "Get请求"
onClicked: {
var callable = {}
callable.onStart = function(){
showLoading()
}
callable.onFinish = function(){
hideLoading()
}
callable.onSuccess = function(result){
text_info.text = result
console.debug(result)
}
callable.onError = function(status,errorString){
console.debug(status+";"+errorString)
}
http.get("https://httpbingo.org/get",callable)
var request = http.newRequest("https://httpbingo.org/get")
http.get(request,callable)
}
}
FluButton{
@ -58,25 +95,13 @@ FluContentPage{
implicitHeight: 36
text: "Post表单请求"
onClicked: {
var callable = {}
callable.onStart = function(){
showLoading()
}
callable.onFinish = function(){
hideLoading()
}
callable.onSuccess = function(result){
text_info.text = result
console.debug(result)
}
callable.onError = function(status,errorString){
console.debug(status+";"+errorString)
}
var param = {}
param.custname = "朱子楚"
param.custtel = "1234567890"
param.custemail = "zhuzichu520@gmail.com"
http.post("https://httpbingo.org/post",callable,param)
var request = http.newRequest("https://httpbingo.org/post")
var params = {}
params.custname = "朱子楚"
params.custtel = "1234567890"
params.custemail = "zhuzichu520@gmail.com"
request.params = params
http.post(request,callable)
}
}
FluButton{
@ -84,25 +109,13 @@ FluContentPage{
implicitHeight: 36
text: "Post Json请求"
onClicked: {
var callable = {}
callable.onStart = function(){
showLoading()
}
callable.onFinish = function(){
hideLoading()
}
callable.onSuccess = function(result){
text_info.text = result
console.debug(result)
}
callable.onError = function(status,errorString){
console.debug(status+";"+errorString)
}
var param = {}
param.custname = "朱子楚"
param.custtel = "1234567890"
param.custemail = "zhuzichu520@gmail.com"
http.postJson("https://httpbingo.org/post",callable,param)
var request = http.newRequest("https://httpbingo.org/post")
var params = {}
params.custname = "朱子楚"
params.custtel = "1234567890"
params.custemail = "zhuzichu520@gmail.com"
request.params = params
http.postJson(request,callable)
}
}
FluButton{
@ -110,25 +123,12 @@ FluContentPage{
implicitHeight: 36
text: "Post String请求"
onClicked: {
var callable = {}
callable.onStart = function(){
showLoading()
}
callable.onFinish = function(){
hideLoading()
}
callable.onSuccess = function(result){
text_info.text = result
console.debug(result)
}
callable.onError = function(status,errorString){
console.debug(status+";"+errorString)
}
var param = "我命由我不由天"
http.postString("https://httpbingo.org/post",callable,param)
var request = http.newRequest("https://httpbingo.org/post")
request.params = "我命由我不由天"
http.postString(request,callable)
}
}
FluButton{
FluProgressButton{
id:btn_download
implicitWidth: parent.width
implicitHeight: 36
@ -137,7 +137,90 @@ FluContentPage{
folder_dialog.open()
}
}
FluButton{
FluProgressButton{
property bool downloading: false
id:btn_breakpoint_download
implicitWidth: parent.width
implicitHeight: 36
text: {
if(downloading){
return "暂停下载"
}
if(progress === 0){
return "断点下载文件"
}else if(progress === 1){
return "打开文件"
}else{
return "继续下载"
}
}
HttpRequest{
id:request_breakpoint_download
url: "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
downloadSavePath: FluTools.getApplicationDirPath()+ "/download/big_buck_bunny.mp4"
}
HttpCallable{
id:callable_breakpoint_download
onStart: {
btn_breakpoint_download.downloading = true
}
onFinish: {
btn_breakpoint_download.downloading = false
}
onError:
(status,errorString,result)=>{
console.debug(status+";"+errorString+";"+result)
}
onSuccess:
(result)=>{
if(!isDownCompleted){
tour.open()
isDownCompleted = true
}
showSuccess(result)
}
onDownloadProgress:
(recv,total)=>{
btn_breakpoint_download.progress = recv/total
}
}
Component.onCompleted: {
progress = http_breakpoint_download.getBreakPointProgress(request_breakpoint_download)
}
onClicked: {
if(downloading){
http_breakpoint_download.cancel()
return
}
if(progress === 1){
FluTools.showFileInFolder(request_breakpoint_download.downloadSavePath)
}else{
http_breakpoint_download.download(request_breakpoint_download,callable_breakpoint_download)
}
}
FluMenu{
id:menu_breakpoint_download
width: 120
FluMenuItem{
text: "删除文件"
onClicked: {
if(FluTools.removeFile(request_breakpoint_download.downloadSavePath)){
btn_breakpoint_download.progress = 0
}
}
}
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: {
if(btn_breakpoint_download.progress === 1){
menu_breakpoint_download.popup()
}
}
}
}
FluProgressButton{
id:btn_upload
implicitWidth: parent.width
implicitHeight: 36
@ -146,81 +229,143 @@ FluContentPage{
file_dialog.open()
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "FirstCacheThenRequest缓存"
onClicked: {
var request = http.newRequest("https://httpbingo.org/post")
request.params = {cacheMode:"FirstCacheThenRequest"}
http_cache_firstcachethenrequest.post(request,callable)
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "RequestFailedReadCache缓存"
onClicked: {
var request = http.newRequest("https://httpbingo.org/post")
request.params = {cacheMode:"RequestFailedReadCache"}
http_cache_requestfailedreadcache.post(request,callable)
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "IfNoneCacheRequest缓存"
onClicked: {
var request = http.newRequest("https://httpbingo.org/post")
request.params = {cacheMode:"IfNoneCacheRequest"}
http_cache_ifnonecacherequest.post(request,callable)
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "打开缓存路径"
onClicked: {
Qt.openUrlExternally("file:///"+cacheDirPath)
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "删除缓存"
onClicked: {
console.debug(FluTools.removeDir(cacheDirPath))
}
}
FluButton{
implicitWidth: parent.width
implicitHeight: 36
text: "清空右边数据"
onClicked: {
text_info.text = ""
}
}
}
}
FluTour{
id:tour
steps:[
{title:"友情提示",description: "下载已完成,左击这里可以打开文件所在路径,右击可以弹出菜单删除文件!",target:()=>btn_breakpoint_download}
]
}
HttpCallable{
id:callable_upload
onStart: {
btn_upload.disabled = true
}
onFinish: {
btn_upload.disabled = false
}
onError:
(status,errorString,result)=>{
btn_upload.progress = 0
text_info.text = result
console.debug(result)
}
onSuccess:
(result)=>{
text_info.text = result
}
onUploadProgress:
(sent,total)=>{
btn_upload.progress = sent/total
}
}
FileDialog {
id: file_dialog
onAccepted: {
var param = {}
var request = http.newRequest("https://httpbingo.org/post")
var params = {}
for(var i=0;i<selectedFiles.length;i++){
var fileUrl = selectedFiles[i]
var fileName = FluTools.getFileNameByUrl(fileUrl)
var filePath = FluTools.toLocalPath(fileUrl)
param[fileName] = filePath
params[fileName] = filePath
}
console.debug(JSON.stringify(param))
var callable = {}
callable.onStart = function(){
btn_upload.disabled = true
}
callable.onFinish = function(){
btn_upload.disabled = false
btn_upload.text = "上传文件"
layout_upload_file_size.visible = false
text_upload_file_size.text = ""
}
callable.onSuccess = function(result){
text_info.text = result
console.debug(result)
}
callable.onError = function(status,errorString,result){
text_info.text = result
console.debug(result)
}
callable.onUploadProgress = function(sent,total){
var locale = Qt.locale()
var precent = (sent/total * 100).toFixed(0) + "%"
btn_upload.text = "上传中..."+precent
text_upload_file_size.text = "%1/%2".arg(locale.formattedDataSize(sent)).arg(locale.formattedDataSize(total))
layout_upload_file_size.visible = true
}
http.upload("https://httpbingo.org/post",callable,param)
request.params = params
http.upload(request,callable_upload)
}
}
HttpCallable{
id:callable_download
onStart: {
btn_download.progress = 0
btn_download.disabled = true
}
onFinish: {
btn_download.disabled = false
}
onError:
(status,errorString,result)=>{
btn_download.progress = 0
showError(errorString)
console.debug(status+";"+errorString+";"+result)
}
onSuccess:
(result)=>{
showSuccess(result)
}
onDownloadProgress:
(recv,total)=>{
btn_download.progress = recv/total
}
}
FolderDialog {
id: folder_dialog
currentFolder: StandardPaths.standardLocations(StandardPaths.DownloadLocation)[0]
onAccepted: {
var callable = {}
callable.onStart = function(){
btn_download.disabled = true
}
callable.onFinish = function(){
btn_download.disabled = false
btn_download.text = "下载文件"
layout_download_file_size.visible = false
text_download_file_size.text = ""
}
callable.onSuccess = function(result){
showSuccess(result)
}
callable.onError = function(status,errorString){
showError(errorString)
}
callable.onDownloadProgress = function(recv,total){
var locale = Qt.locale()
var precent = (recv/total * 100).toFixed(0) + "%"
btn_download.text = "下载中..."+precent
text_download_file_size.text = "%1/%2".arg(locale.formattedDataSize(recv)).arg(locale.formattedDataSize(total))
layout_download_file_size.visible = true
}
var path = FluTools.toLocalPath(currentFolder)+ "/big_buck_bunny.mp4"
http.download("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4",callable,path)
var request = http.newRequest("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
request.downloadSavePath = FluTools.toLocalPath(currentFolder)+ "/big_buck_bunny.mp4"
http.download(request,callable_download)
}
}
FluArea{
anchors{
top: layout_flick.top
@ -246,34 +391,4 @@ FluContentPage{
}
}
}
FluRectangle{
id:layout_download_file_size
radius: [4,4,4,4]
height: 36
width: 160
visible: false
x:layout_flick.width
y: 173 - layout_flick.contentY
FluText{
id:text_download_file_size
anchors.centerIn: parent
}
}
FluRectangle{
id:layout_upload_file_size
radius: [4,4,4,4]
height: 36
width: 160
visible: false
x:layout_flick.width
y: 210 - layout_flick.contentY
FluText{
id:text_upload_file_size
anchors.centerIn: parent
}
}
}

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import "qrc:///example/qml/component"
import "../component"
import FluentUI 1.0
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{
@ -15,9 +16,12 @@ FluScrollablePage{
height: 400
paddings: 10
FluPivot{
anchors.fill: parent
currentIndex: 2
FluPivotItem{
title:"All"
contentItem:FluText{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -5,6 +5,7 @@ import QtQuick.Window 2.15
import FluentUI 1.0
import QtGraphicalEffects 1.15
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage {

View File

@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{
@ -116,7 +117,7 @@ FluScrollablePage{
FluRectangle{
width: 1920/5
height: 1200/5
radius:[15,15,15,15]
radius:[8,8,8,8]
Image {
asynchronous: true
source: "qrc:/example/res/image/banner_1.jpg"

View File

@ -4,11 +4,12 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluPage{
launchMode: FluPageType.SingleTop
FluRemoteLoader{
anchors.fill: parent
source: "https://zhu-zichu.gitee.io/T_RemoteLoader.qml"
source: "https://zhu-zichu.gitee.io/Qt5_T_RemoteLoader.qml"
}
}

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{
@ -30,9 +31,10 @@ FluScrollablePage{
Layout.topMargin: 10
Layout.leftMargin: 4
Layout.bottomMargin: 4
radius: 4
color: FluTheme.dark ? FluColors.Black : FluColors.White
FluShadow{
radius: 0
radius: 4
color: FluTheme.primaryColor.dark
}
Image{

View File

@ -5,11 +5,61 @@ import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/global"
import "qrc:///example/qml/component"
import "qrc:///example/qml/viewmodel"
import "../component"
import "../viewmodel"
import "../global"
FluScrollablePage{
title:"Settings"
SettingsViewModel{
id:viewmodel_settings
}
FluEvent{
id:event_checkupdate_finish
name: "checkUpdateFinish"
onTriggered: {
btn_checkupdate.loading = false
}
}
Component.onCompleted: {
FluEventBus.registerEvent(event_checkupdate_finish)
}
Component.onDestruction: {
FluEventBus.unRegisterEvent(event_checkupdate_finish)
}
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
height: 60
paddings: 10
Row{
spacing: 20
anchors.verticalCenter: parent.verticalCenter
FluText{
text:"当前版本 v%1".arg(appInfo.version)
font: FluTextStyle.Body
anchors.verticalCenter: parent.verticalCenter
}
FluLoadingButton{
id:btn_checkupdate
text:"检查更新"
anchors.verticalCenter: parent.verticalCenter
onClicked: {
loading = true
FluEventBus.post("checkUpdate")
}
}
}
}
FluArea{
Layout.fillWidth: true
Layout.topMargin: 20
@ -60,10 +110,10 @@ FluScrollablePage{
Repeater{
model: [{title:"Open",mode:FluNavigationViewType.Open},{title:"Compact",mode:FluNavigationViewType.Compact},{title:"Minimal",mode:FluNavigationViewType.Minimal},{title:"Auto",mode:FluNavigationViewType.Auto}]
delegate: FluRadioButton{
checked : MainEvent.displayMode===modelData.mode
checked : viewmodel_settings.displayMode===modelData.mode
text:modelData.title
clickListener:function(){
MainEvent.displayMode = modelData.mode
viewmodel_settings.displayMode = modelData.mode
}
}
}

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import "qrc:///example/qml/component"
import "../component"
import FluentUI 1.0
FluScrollablePage{
@ -11,13 +12,20 @@ FluScrollablePage{
FluArea{
Layout.fillWidth: true
height: 100
paddings: 10
Layout.preferredHeight: 200
Layout.topMargin: 20
paddings: 10
Row{
spacing: 30
FluSlider{
}
FluSlider{
orientation: Qt.Vertical
anchors.verticalCenter: parent.verticalCenter
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
@ -26,25 +34,28 @@ FluScrollablePage{
}'
}
FluArea{
Layout.fillWidth: true
height: 200
paddings: 10
Layout.preferredHeight: 200
Layout.topMargin: 20
FluSlider{
paddings: 10
Row{
spacing: 30
FluRangeSlider{
}
FluRangeSlider{
orientation: Qt.Vertical
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
code:'FluSlider{
code:'FluRangeSlider{
orientation: Qt.Vertical
value:50
}'
}
}

View File

@ -0,0 +1,61 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import "qrc:///example/qml/component"
import "../component"
import FluentUI 1.0
FluContentPage{
title:"StaggeredView"
property var colors : [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green]
ListModel{
id:list_model
Component.onCompleted: {
for(var i=0;i<=100;i++){
var item = {}
item.color = colors[rand(0,7)].dark
item.height = rand(100,300)
append(item)
}
}
}
Flickable{
id: scroll
anchors.fill: parent
anchors.topMargin: 20
boundsBehavior:Flickable.StopAtBounds
contentHeight: staggered_view.implicitHeight
clip: true
ScrollBar.vertical: FluScrollBar {}
FluStaggeredView{
id:staggered_view
width: parent.width
itemWidth: 160
model:list_model
delegate: Rectangle{
height: model.height
color:model.color
FluText{
color:"#FFFFFF"
text:model.index
font.bold: true
font.pixelSize: 18
anchors.centerIn: parent
}
}
}
}
function rand(minNum, maxNum){
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
}
}

View File

@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluContentPage{

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,12 +4,21 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "qrc:///example/qml/viewmodel"
import "../component"
import "../viewmodel"
FluScrollablePage{
launchMode: FluPageType.SingleInstance
title:"TextBox"
TextBoxViewModel{
id:viewModel
}
Component.onDestruction: {
console.debug("T_TextBox页面销毁了")
}
FluArea{
Layout.fillWidth: true
height: 68
@ -20,6 +29,10 @@ FluScrollablePage{
placeholderText: "单行输入框"
disabled:text_box_switch.checked
cleanEnabled: true
text:viewModel.text1
onTextChanged: {
viewModel.text1 = text
}
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
@ -84,6 +97,10 @@ FluScrollablePage{
FluMultilineTextBox{
id:multiine_textbox
placeholderText: "多行输入框"
text:viewModel.text2
onTextChanged: {
viewModel.text2 = text
}
disabled:text_box_multi_switch.checked
anchors{
verticalCenter: parent.verticalCenter

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage{

View File

@ -4,6 +4,7 @@ import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluScrollablePage {

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
FluContentPage{

View File

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

View File

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

View File

@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
CustomWindow {

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import FluentUI 1.0
import example 1.0
import "qrc:///example/qml/component"
import "../component"
CustomWindow {

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
CustomWindow {

View File

@ -7,6 +7,10 @@ import FluentUI 1.0
import example 1.0
import "qrc:///example/qml/component"
import "qrc:///example/qml/global"
import "qrc:///example/qml/viewmodel"
import "../component"
import "../viewmodel"
import "../global"
CustomWindow {
@ -20,14 +24,32 @@ CustomWindow {
appBarVisible: false
launchMode: FluWindowType.SingleTask
SettingsViewModel{
id:viewmodel_settings
}
closeFunc:function(event){
dialog_close.open()
event.accepted = false
}
FluEvent{
id:event_checkupdate
name: "checkUpdate"
onTriggered: {
checkUpdate(false)
}
}
Component.onCompleted: {
FluTools.setQuitOnLastWindowClosed(false)
tour.open()
checkUpdate(true)
FluEventBus.registerEvent(event_checkupdate)
}
Component.onDestruction: {
FluEventBus.unRegisterEvent(event_checkupdate)
}
SystemTrayIcon {
@ -133,13 +155,11 @@ CustomWindow {
}
}
}
FluRemoteLoader{
id:loader
lazy: true
anchors.fill: parent
// source: "http://localhost:9000/RemoteComponent.qml"
source: "https://zhu-zichu.gitee.io/RemoteComponent.qml"
source: "https://zhu-zichu.gitee.io/Qt5_156_LieflatPage.qml"
}
}
front: Item{
@ -165,13 +185,13 @@ CustomWindow {
height: parent.height
z:999
//Stack模式每次切换都会将页面压入栈中随着栈的页面增多消耗的内存也越多内存消耗多就会卡顿这时候就需要按返回将页面pop掉释放内存。该模式可以配合FluPage中的launchMode属性设置页面的启动模式
pageMode: FluNavigationViewType.Stack
// pageMode: FluNavigationViewType.Stack
//NoStack模式每次切换都会销毁之前的页面然后创建一个新的页面只需消耗少量内存推荐
// pageMode: FluNavigationViewType.NoStack
pageMode: FluNavigationViewType.NoStack
items: ItemsOriginal
footerItems:ItemsFooter
topPadding:FluTools.isMacos() ? 20 : 0
displayMode:MainEvent.displayMode
displayMode:viewmodel_settings.displayMode
logo: "qrc:/example/res/image/favicon.ico"
title:"FluentUI"
onLogoClicked:{
@ -277,4 +297,77 @@ CustomWindow {
]
}
FluHttp{
id:http
}
FpsItem{
id:fps_item
}
FluText{
text:"fps %1".arg(fps_item.fps)
opacity: 0.3
anchors{
bottom: parent.bottom
right: parent.right
bottomMargin: 5
rightMargin: 5
}
}
FluContentDialog{
property string newVerson
property string body
id:dialog_update
title:"升级提示"
message:"FluentUI目前最新版本 "+ newVerson +" -- 当前应用版本 "+appInfo.version+" \n现在是否去下载新版本\n\n更新内容\n"+body
buttonFlags: FluContentDialogType.NegativeButton | FluContentDialogType.PositiveButton
negativeText: "取消"
positiveText:"确定"
onPositiveClicked:{
Qt.openUrlExternally("https://github.com/zhuzichu520/FluentUI/releases/latest")
}
}
HttpCallable{
id:callable
property bool silent: true
onStart: {
console.debug("satrt check update...")
}
onFinish: {
console.debug("check update finish")
FluEventBus.post("checkUpdateFinish");
}
onSuccess:
(result)=>{
var data = JSON.parse(result)
console.debug("current version "+appInfo.version)
console.debug("new version "+data.tag_name)
if(data.tag_name !== appInfo.version){
dialog_update.newVerson = data.tag_name
dialog_update.body = data.body
dialog_update.open()
}else{
if(!silent){
showInfo("当前版本已经是最新版")
}
}
}
onError:
(status,errorString)=>{
if(!silent){
showError("网络异常!")
}
console.debug(status+";"+errorString)
}
}
function checkUpdate(silent){
callable.silent = silent
var request = http.newRequest("https://api.github.com/repos/zhuzichu520/FluentUI/releases/latest")
http.get(request,callable);
}
}

View File

@ -0,0 +1,26 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import FluentUI 1.0
import example 1.0
import "qrc:///example/qml/component"
import "../component"
CustomWindow {
id:window
width: 800
height: 600
minimumWidth: 520
minimumHeight: 200
launchMode: FluWindowType.SingleInstance
onInitArgument:
(arg)=>{
window.title = arg.title
loader.setSource( arg.url,{animDisabled:true})
}
Loader{
id: loader
anchors.fill: parent
}
}

View File

@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
CustomWindow {

View File

@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import FluentUI 1.0
import "qrc:///example/qml/component"
import "../component"
CustomWindow {

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