This commit is contained in:
朱子楚\zhuzi 2024-02-23 12:26:10 +08:00
parent 438d1fe623
commit c330dc840e
25 changed files with 84 additions and 84 deletions

View File

@ -22,7 +22,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [macos-latest] os: [macos-latest]
qt_ver: [6.6.1] qt_ver: [6.6.2]
qt_arch: [clang_64] qt_arch: [clang_64]
env: env:
targetName: example targetName: example

View File

@ -23,7 +23,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest] os: [ubuntu-latest]
qt_ver: [6.6.1] qt_ver: [6.6.2]
qt_arch: [gcc_64] qt_arch: [gcc_64]
env: env:
targetName: example targetName: example

View File

@ -24,7 +24,7 @@ jobs:
os: [windows-latest] os: [windows-latest]
include: include:
- qt_arch: win64_mingw - qt_arch: win64_mingw
qt_ver: 6.6.1 qt_ver: 6.6.2
qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900" qt_tools: "tools_mingw,9.0.0-1-202203221220,qt.tools.win64_mingw900"
qt_tools_mingw_install: mingw900_64 qt_tools_mingw_install: mingw900_64
env: env:

View File

@ -23,7 +23,7 @@ jobs:
matrix: matrix:
os: [windows-latest] os: [windows-latest]
include: include:
- qt_ver: 6.6.1 - qt_ver: 6.6.2
qt_arch: win64_msvc2019_64 qt_arch: win64_msvc2019_64
msvc_arch: x64 msvc_arch: x64
qt_arch_install: msvc2019_64 qt_arch_install: msvc2019_64

View File

@ -157,7 +157,7 @@
<file>qml/page/T_Screenshot.qml</file> <file>qml/page/T_Screenshot.qml</file>
<file>qml/page/T_Settings.qml</file> <file>qml/page/T_Settings.qml</file>
<file>qml/page/T_Slider.qml</file> <file>qml/page/T_Slider.qml</file>
<file>qml/page/T_StatusView.qml</file> <file>qml/page/T_StatusLayout.qml</file>
<file>qml/page/T_TableView.qml</file> <file>qml/page/T_TableView.qml</file>
<file>qml/page/T_TabView.qml</file> <file>qml/page/T_TabView.qml</file>
<file>qml/page/T_Text.qml</file> <file>qml/page/T_Text.qml</file>

View File

@ -118,7 +118,7 @@ FluExpander{
"FluTableView", "FluTableView",
"FluColors", "FluColors",
"FluTheme", "FluTheme",
"FluStatusView", "FluStatusLayout",
"FluRatingControl", "FluRatingControl",
"FluPasswordBox", "FluPasswordBox",
"FluBreadcrumbBar", "FluBreadcrumbBar",

View File

@ -192,12 +192,6 @@ FluObject{
url:"qrc:/example/qml/page/T_Clip.qml" url:"qrc:/example/qml/page/T_Clip.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
FluPaneItem{
title:"StatusView"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_StatusView.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{ FluPaneItem{
title:"Carousel" title:"Carousel"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
@ -233,6 +227,12 @@ FluObject{
url:"qrc:/example/qml/page/T_SplitLayout.qml" url:"qrc:/example/qml/page/T_SplitLayout.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
FluPaneItem{
title:"StatusLayout"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_StatusLayout.qml"
onTap:{ navigationView.push(url) }
}
} }
FluPaneItemExpander{ FluPaneItemExpander{

View File

@ -7,7 +7,7 @@ import "../component"
FluScrollablePage{ FluScrollablePage{
title:"StatusView" title:"StatusLayout"
FluArea{ FluArea{
id:layout_actions id:layout_actions
@ -25,28 +25,28 @@ FluScrollablePage{
text:"Loading" text:"Loading"
onClicked: { onClicked: {
btn_status_mode.text = text btn_status_mode.text = text
status_view.statusMode = FluStatusViewType.Loading status_view.statusMode = FluStatusLayoutType.Loading
} }
} }
FluMenuItem{ FluMenuItem{
text:"Empty" text:"Empty"
onClicked: { onClicked: {
btn_status_mode.text = text btn_status_mode.text = text
status_view.statusMode = FluStatusViewType.Empty status_view.statusMode = FluStatusLayoutType.Empty
} }
} }
FluMenuItem{ FluMenuItem{
text:"Error" text:"Error"
onClicked: { onClicked: {
btn_status_mode.text = text btn_status_mode.text = text
status_view.statusMode = FluStatusViewType.Error status_view.statusMode = FluStatusLayoutType.Error
} }
} }
FluMenuItem{ FluMenuItem{
text:"Success" text:"Success"
onClicked: { onClicked: {
btn_status_mode.text = text btn_status_mode.text = text
status_view.statusMode = FluStatusViewType.Success status_view.statusMode = FluStatusLayoutType.Success
} }
} }
} }
@ -58,7 +58,7 @@ FluScrollablePage{
Layout.topMargin: 10 Layout.topMargin: 10
height: 380 height: 380
paddings: 10 paddings: 10
FluStatusView{ FluStatusLayout{
id:status_view id:status_view
anchors.fill: parent anchors.fill: parent
onErrorClicked:{ onErrorClicked:{
@ -73,9 +73,9 @@ FluScrollablePage{
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -1
code:'FluStatusView{ code:'FluStatusLayout{
anchors.fill: parent anchors.fill: parent
statusMode: FluStatusViewType.Loading statusMode: FluStatusLayoutType.Loading
Rectangle{ Rectangle{
anchors.fill: parent anchors.fill: parent
color:FluTheme.primaryColor color:FluTheme.primaryColor

View File

@ -25,7 +25,7 @@ FluWindow {
FluRemoteLoader{ FluRemoteLoader{
id:loader id:loader
anchors.fill: parent anchors.fill: parent
statusMode: FluStatusViewType.Success statusMode: FluStatusLayoutType.Success
lazy: true lazy: true
errorItem: Item{ errorItem: Item{
FluText{ FluText{
@ -43,7 +43,7 @@ FluWindow {
text:"拖入qml文件" text:"拖入qml文件"
font.pixelSize: 26 font.pixelSize: 26
anchors.centerIn: parent anchors.centerIn: parent
visible: !loader.itemLodaer().item && loader.statusMode === FluStatusViewType.Success visible: !loader.itemLodaer().item && loader.statusMode === FluStatusLayoutType.Success
} }
Rectangle{ Rectangle{
radius: 4 radius: 4

View File

@ -118,7 +118,7 @@ FluExpander{
"FluTableView", "FluTableView",
"FluColors", "FluColors",
"FluTheme", "FluTheme",
"FluStatusView", "FluStatusLayout",
"FluRatingControl", "FluRatingControl",
"FluPasswordBox", "FluPasswordBox",
"FluBreadcrumbBar", "FluBreadcrumbBar",

View File

@ -192,12 +192,6 @@ FluObject{
url:"qrc:/example/qml/page/T_Clip.qml" url:"qrc:/example/qml/page/T_Clip.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
FluPaneItem{
title:"StatusView"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_StatusView.qml"
onTap:{ navigationView.push(url) }
}
FluPaneItem{ FluPaneItem{
title:"Carousel" title:"Carousel"
menuDelegate: paneItemMenu menuDelegate: paneItemMenu
@ -233,6 +227,12 @@ FluObject{
url:"qrc:/example/qml/page/T_SplitLayout.qml" url:"qrc:/example/qml/page/T_SplitLayout.qml"
onTap:{ navigationView.push(url) } onTap:{ navigationView.push(url) }
} }
FluPaneItem{
title:"StatusLayout"
menuDelegate: paneItemMenu
url:"qrc:/example/qml/page/T_StatusLayout.qml"
onTap:{ navigationView.push(url) }
}
} }
FluPaneItemExpander{ FluPaneItemExpander{

View File

@ -7,7 +7,7 @@ import "../component"
FluScrollablePage{ FluScrollablePage{
title:"StatusView" title:"StatusLayout"
FluArea{ FluArea{
id:layout_actions id:layout_actions
@ -25,28 +25,28 @@ FluScrollablePage{
text:"Loading" text:"Loading"
onClicked: { onClicked: {
btn_status_mode.text = text btn_status_mode.text = text
status_view.statusMode = FluStatusViewType.Loading status_view.statusMode = FluStatusLayoutType.Loading
} }
} }
FluMenuItem{ FluMenuItem{
text:"Empty" text:"Empty"
onClicked: { onClicked: {
btn_status_mode.text = text btn_status_mode.text = text
status_view.statusMode = FluStatusViewType.Empty status_view.statusMode = FluStatusLayoutType.Empty
} }
} }
FluMenuItem{ FluMenuItem{
text:"Error" text:"Error"
onClicked: { onClicked: {
btn_status_mode.text = text btn_status_mode.text = text
status_view.statusMode = FluStatusViewType.Error status_view.statusMode = FluStatusLayoutType.Error
} }
} }
FluMenuItem{ FluMenuItem{
text:"Success" text:"Success"
onClicked: { onClicked: {
btn_status_mode.text = text btn_status_mode.text = text
status_view.statusMode = FluStatusViewType.Success status_view.statusMode = FluStatusLayoutType.Success
} }
} }
} }
@ -58,7 +58,7 @@ FluScrollablePage{
Layout.topMargin: 10 Layout.topMargin: 10
height: 380 height: 380
paddings: 10 paddings: 10
FluStatusView{ FluStatusLayout{
id:status_view id:status_view
anchors.fill: parent anchors.fill: parent
onErrorClicked:{ onErrorClicked:{
@ -73,9 +73,9 @@ FluScrollablePage{
CodeExpander{ CodeExpander{
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -1 Layout.topMargin: -1
code:'FluStatusView{ code:'FluStatusLayout{
anchors.fill: parent anchors.fill: parent
statusMode: FluStatusViewType.Loading statusMode: FluStatusLayoutType.Loading
Rectangle{ Rectangle{
anchors.fill: parent anchors.fill: parent
color:FluTheme.primaryColor color:FluTheme.primaryColor

View File

@ -25,7 +25,7 @@ FluWindow {
FluRemoteLoader{ FluRemoteLoader{
id:loader id:loader
anchors.fill: parent anchors.fill: parent
statusMode: FluStatusViewType.Success statusMode: FluStatusLayoutType.Success
lazy: true lazy: true
errorItem: Item{ errorItem: Item{
FluText{ FluText{
@ -43,7 +43,7 @@ FluWindow {
text:"拖入qml文件" text:"拖入qml文件"
font.pixelSize: 26 font.pixelSize: 26
anchors.centerIn: parent anchors.centerIn: parent
visible: !loader.itemLodaer().item && loader.statusMode === FluStatusViewType.Success visible: !loader.itemLodaer().item && loader.statusMode === FluStatusLayoutType.Success
} }
Rectangle{ Rectangle{
radius: 4 radius: 4

View File

@ -92,7 +92,7 @@ Q_ENUM_NS(SelectionMode)
QML_NAMED_ELEMENT(FluTreeViewType) QML_NAMED_ELEMENT(FluTreeViewType)
} }
namespace FluStatusViewType { namespace FluStatusLayoutType {
Q_NAMESPACE Q_NAMESPACE
enum StatusMode { enum StatusMode {
Loading = 0x0000, Loading = 0x0000,
@ -101,7 +101,7 @@ enum StatusMode {
Success = 0x0004 Success = 0x0004
}; };
Q_ENUM_NS(StatusMode) Q_ENUM_NS(StatusMode)
QML_NAMED_ELEMENT(FluStatusViewType) QML_NAMED_ELEMENT(FluStatusLayoutType)
} }
namespace FluContentDialogType { namespace FluContentDialogType {

View File

@ -114,7 +114,7 @@ void FluentUI::registerTypes(const char *uri){
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluShadow.qml"),uri,major,minor,"FluShadow"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluShadow.qml"),uri,major,minor,"FluShadow");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluSlider.qml"),uri,major,minor,"FluSlider"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluSlider.qml"),uri,major,minor,"FluSlider");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluSpinBox.qml"),uri,major,minor,"FluSpinBox"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluSpinBox.qml"),uri,major,minor,"FluSpinBox");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluStatusView.qml"),uri,major,minor,"FluStatusView"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluStatusLayout.qml"),uri,major,minor,"FluStatusLayout");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTabView.qml"),uri,major,minor,"FluTabView"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTabView.qml"),uri,major,minor,"FluTabView");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTableView.qml"),uri,major,minor,"FluTableView"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTableView.qml"),uri,major,minor,"FluTableView");
qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluText.qml"),uri,major,minor,"FluText"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluText.qml"),uri,major,minor,"FluText");
@ -144,7 +144,7 @@ void FluentUI::registerTypes(const char *uri){
qmlRegisterUncreatableMetaObject(FluPageType::staticMetaObject, uri,major,minor,"FluPageType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluPageType::staticMetaObject, uri,major,minor,"FluPageType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluWindowType::staticMetaObject, uri,major,minor,"FluWindowType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluWindowType::staticMetaObject, uri,major,minor,"FluWindowType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluTreeViewType::staticMetaObject, uri,major,minor,"FluTreeViewType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluTreeViewType::staticMetaObject, uri,major,minor,"FluTreeViewType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluStatusViewType::staticMetaObject, uri,major,minor,"FluStatusViewType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluStatusLayoutType::staticMetaObject, uri,major,minor,"FluStatusLayoutType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluContentDialogType::staticMetaObject, uri,major,minor,"FluContentDialogType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluContentDialogType::staticMetaObject, uri,major,minor,"FluContentDialogType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluTimePickerType::staticMetaObject, uri,major,minor,"FluTimePickerType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluTimePickerType::staticMetaObject, uri,major,minor,"FluTimePickerType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluCalendarViewType::staticMetaObject, uri,major,minor,"FluCalendarViewType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluCalendarViewType::staticMetaObject, uri,major,minor,"FluCalendarViewType", "Access to enums & flags only");

View File

@ -37,10 +37,10 @@ FluPage {
rightMargin: control.rightPadding rightMargin: control.rightPadding
} }
} }
FluStatusView{ FluStatusLayout{
id:status_view id:status_view
color: "#00000000" color: "#00000000"
statusMode: FluStatusViewType.Success statusMode: FluStatusLayoutType.Success
onErrorClicked: control.errorClicked() onErrorClicked: control.errorClicked()
anchors{ anchors{
left: parent.left left: parent.left

View File

@ -2,7 +2,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import FluentUI 1.0 import FluentUI 1.0
FluStatusView { FluStatusLayout {
property url source: "" property url source: ""
property bool lazy: false property bool lazy: false
color:"transparent" color:"transparent"
@ -21,11 +21,11 @@ FluStatusView {
asynchronous: true asynchronous: true
onStatusChanged: { onStatusChanged: {
if(status === Loader.Error){ if(status === Loader.Error){
control.statusMode = FluStatusViewType.Error control.statusMode = FluStatusLayoutType.Error
}else if(status === Loader.Loading){ }else if(status === Loader.Loading){
control.statusMode = FluStatusViewType.Loading control.statusMode = FluStatusLayoutType.Loading
}else{ }else{
control.statusMode = FluStatusViewType.Success control.statusMode = FluStatusLayoutType.Success
} }
} }
} }

View File

@ -38,10 +38,10 @@ FluPage {
rightMargin: control.rightPadding rightMargin: control.rightPadding
} }
} }
FluStatusView{ FluStatusLayout{
id:status_view id:status_view
color: "#00000000" color: "#00000000"
statusMode: FluStatusViewType.Success statusMode: FluStatusLayoutType.Success
onErrorClicked: control.errorClicked() onErrorClicked: control.errorClicked()
anchors{ anchors{
left: parent.left left: parent.left

View File

@ -7,7 +7,7 @@ import FluentUI 1.0
Item{ Item{
id:control id:control
default property alias content: container.data default property alias content: container.data
property int statusMode: FluStatusViewType.Loading property int statusMode: FluStatusLayoutType.Loading
property string loadingText:"正在加载..." property string loadingText:"正在加载..."
property string emptyText: "空空如也" property string emptyText: "空空如也"
property string errorText: "页面出错了.." property string errorText: "页面出错了.."
@ -21,20 +21,20 @@ Item{
Item{ Item{
id:container id:container
anchors.fill: parent anchors.fill: parent
visible: statusMode===FluStatusViewType.Success visible: statusMode===FluStatusLayoutType.Success
} }
FluLoader{ FluLoader{
id:loader id:loader
anchors.fill: parent anchors.fill: parent
visible: statusMode!==FluStatusViewType.Success visible: statusMode!==FluStatusLayoutType.Success
sourceComponent: { sourceComponent: {
if(statusMode === FluStatusViewType.Loading){ if(statusMode === FluStatusLayoutType.Loading){
return loadingItem return loadingItem
} }
if(statusMode === FluStatusViewType.Empty){ if(statusMode === FluStatusLayoutType.Empty){
return emptyItem return emptyItem
} }
if(statusMode === FluStatusViewType.Error){ if(statusMode === FluStatusLayoutType.Error){
return errorItem return errorItem
} }
return undefined return undefined
@ -103,15 +103,15 @@ Item{
} }
} }
function showSuccessView(){ function showSuccessView(){
statusMode = FluStatusViewType.Success statusMode = FluStatusLayoutType.Success
} }
function showLoadingView(){ function showLoadingView(){
statusMode = FluStatusViewType.Loading statusMode = FluStatusLayoutType.Loading
} }
function showEmptyView(){ function showEmptyView(){
statusMode = FluStatusViewType.Empty statusMode = FluStatusLayoutType.Empty
} }
function showErrorView(){ function showErrorView(){
statusMode = FluStatusViewType.Error statusMode = FluStatusLayoutType.Error
} }
} }

View File

@ -158,8 +158,8 @@ Module {
} }
} }
Component { Component {
name: "FluStatusViewType" name: "FluStatusLayoutType"
exports: ["FluentUI/FluStatusViewType 1.0"] exports: ["FluentUI/FluStatusLayoutType 1.0"]
isCreatable: false isCreatable: false
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
Enum { Enum {
@ -3521,8 +3521,8 @@ Module {
} }
Component { Component {
prototype: "QQuickItem" prototype: "QQuickItem"
name: "FluentUI/FluStatusView 1.0" name: "FluentUI/FluStatusLayout 1.0"
exports: ["FluentUI/FluStatusView 1.0"] exports: ["FluentUI/FluStatusLayout 1.0"]
exportMetaObjectRevisions: [0] exportMetaObjectRevisions: [0]
isComposite: true isComposite: true
defaultProperty: "content" defaultProperty: "content"

View File

@ -70,7 +70,7 @@
<file>FluentUI/Controls/FluSlider.qml</file> <file>FluentUI/Controls/FluSlider.qml</file>
<file>FluentUI/Controls/FluSpinBox.qml</file> <file>FluentUI/Controls/FluSpinBox.qml</file>
<file>FluentUI/Controls/FluStaggeredLayout.qml</file> <file>FluentUI/Controls/FluStaggeredLayout.qml</file>
<file>FluentUI/Controls/FluStatusView.qml</file> <file>FluentUI/Controls/FluStatusLayout.qml</file>
<file>FluentUI/Controls/FluTableView.qml</file> <file>FluentUI/Controls/FluTableView.qml</file>
<file>FluentUI/Controls/FluTabView.qml</file> <file>FluentUI/Controls/FluTabView.qml</file>
<file>FluentUI/Controls/FluText.qml</file> <file>FluentUI/Controls/FluText.qml</file>

View File

@ -37,10 +37,10 @@ FluPage {
rightMargin: control.rightPadding rightMargin: control.rightPadding
} }
} }
FluStatusView{ FluStatusLayout{
id:status_view id:status_view
color: "#00000000" color: "#00000000"
statusMode: FluStatusViewType.Success statusMode: FluStatusLayoutType.Success
onErrorClicked: control.errorClicked() onErrorClicked: control.errorClicked()
anchors{ anchors{
left: parent.left left: parent.left

View File

@ -2,7 +2,7 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import FluentUI import FluentUI
FluStatusView { FluStatusLayout {
property url source: "" property url source: ""
property bool lazy: false property bool lazy: false
color:"transparent" color:"transparent"
@ -21,11 +21,11 @@ FluStatusView {
asynchronous: true asynchronous: true
onStatusChanged: { onStatusChanged: {
if(status === Loader.Error){ if(status === Loader.Error){
control.statusMode = FluStatusViewType.Error control.statusMode = FluStatusLayoutType.Error
}else if(status === Loader.Loading){ }else if(status === Loader.Loading){
control.statusMode = FluStatusViewType.Loading control.statusMode = FluStatusLayoutType.Loading
}else{ }else{
control.statusMode = FluStatusViewType.Success control.statusMode = FluStatusLayoutType.Success
} }
} }
} }

View File

@ -38,10 +38,10 @@ FluPage {
rightMargin: control.rightPadding rightMargin: control.rightPadding
} }
} }
FluStatusView{ FluStatusLayout{
id:status_view id:status_view
color: "#00000000" color: "#00000000"
statusMode: FluStatusViewType.Success statusMode: FluStatusLayoutType.Success
onErrorClicked: control.errorClicked() onErrorClicked: control.errorClicked()
anchors{ anchors{
left: parent.left left: parent.left

View File

@ -6,7 +6,7 @@ import FluentUI
Item{ Item{
id:control id:control
default property alias content: container.data default property alias content: container.data
property int statusMode: FluStatusViewType.Loading property int statusMode: FluStatusLayoutType.Loading
property string loadingText:"正在加载..." property string loadingText:"正在加载..."
property string emptyText: "空空如也" property string emptyText: "空空如也"
property string errorText: "页面出错了.." property string errorText: "页面出错了.."
@ -20,20 +20,20 @@ Item{
Item{ Item{
id:container id:container
anchors.fill: parent anchors.fill: parent
visible: statusMode===FluStatusViewType.Success visible: statusMode===FluStatusLayoutType.Success
} }
FluLoader{ FluLoader{
id:loader id:loader
anchors.fill: parent anchors.fill: parent
visible: statusMode!==FluStatusViewType.Success visible: statusMode!==FluStatusLayoutType.Success
sourceComponent: { sourceComponent: {
if(statusMode === FluStatusViewType.Loading){ if(statusMode === FluStatusLayoutType.Loading){
return loadingItem return loadingItem
} }
if(statusMode === FluStatusViewType.Empty){ if(statusMode === FluStatusLayoutType.Empty){
return emptyItem return emptyItem
} }
if(statusMode === FluStatusViewType.Error){ if(statusMode === FluStatusLayoutType.Error){
return errorItem return errorItem
} }
return undefined return undefined
@ -102,15 +102,15 @@ Item{
} }
} }
function showSuccessView(){ function showSuccessView(){
statusMode = FluStatusViewType.Success statusMode = FluStatusLayoutType.Success
} }
function showLoadingView(){ function showLoadingView(){
statusMode = FluStatusViewType.Loading statusMode = FluStatusLayoutType.Loading
} }
function showEmptyView(){ function showEmptyView(){
statusMode = FluStatusViewType.Empty statusMode = FluStatusLayoutType.Empty
} }
function showErrorView(){ function showErrorView(){
statusMode = FluStatusViewType.Error statusMode = FluStatusLayoutType.Error
} }
} }