RibbonTabPage: Fix containerItem read empty issue.
This commit is contained in:
parent
8d6dea6c5d
commit
3af821668e
|
@ -47,17 +47,15 @@ RibbonTabBar {
|
||||||
property var pushButtonLayout
|
property var pushButtonLayout
|
||||||
|
|
||||||
onContainerItemUpdated: {
|
onContainerItemUpdated: {
|
||||||
if(getItem(0)){
|
basic_page.sliderLayout = getItem(0).sliderLayout
|
||||||
sliderLayout = getItem(0).sliderLayout
|
basic_page.sliderWithBtn = getItem(0).sliderWithBtn
|
||||||
sliderWithBtn = getItem(0).sliderWithBtn
|
basic_page.sliderWithoutBtn = getItem(0).sliderWithoutBtn
|
||||||
sliderWithoutBtn = getItem(0).sliderWithoutBtn
|
basic_page.switchLayout = getItem(1).switchLayout
|
||||||
switchLayout = getItem(1).switchLayout
|
basic_page.btnWithColorAndGrabberText = getItem(1).btnWithColorAndGrabberText
|
||||||
btnWithColorAndGrabberText = getItem(1).btnWithColorAndGrabberText
|
basic_page.checkBoxLayout = getItem(2).checkBoxLayout
|
||||||
checkBoxLayout = getItem(2).checkBoxLayout
|
basic_page.buttonLayout = getItem(3).buttonLayout
|
||||||
buttonLayout = getItem(3).buttonLayout
|
basic_page.btnWithoutBgAndLabel = getItem(3).btnWithoutBgAndLabel
|
||||||
btnWithoutBgAndLabel = getItem(3).btnWithoutBgAndLabel
|
basic_page.pushButtonLayout = getItem(4).pushButtonLayout
|
||||||
pushButtonLayout = getItem(4).pushButtonLayout
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RibbonTabGroup{
|
RibbonTabGroup{
|
||||||
|
@ -333,10 +331,8 @@ RibbonTabBar {
|
||||||
property var lineEditWithIcon
|
property var lineEditWithIcon
|
||||||
|
|
||||||
onContainerItemUpdated: {
|
onContainerItemUpdated: {
|
||||||
if(getItem(0)){
|
lineEditLayout = getItem(0).lineEditLayout
|
||||||
lineEditLayout = getItem(0).lineEditLayout
|
lineEditWithIcon = getItem(0).lineEditWithIcon
|
||||||
lineEditWithIcon = getItem(0).lineEditWithIcon
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RibbonTabGroup{
|
RibbonTabGroup{
|
||||||
|
@ -507,8 +503,7 @@ RibbonTabBar {
|
||||||
title: qsTr("Progress")
|
title: qsTr("Progress")
|
||||||
property var progressbarSlider
|
property var progressbarSlider
|
||||||
onContainerItemUpdated:{
|
onContainerItemUpdated:{
|
||||||
if(getItem(0))
|
progress_page.progressbarSlider = getItem(0).progressbarSlider
|
||||||
progressbarSlider = getItem(0).progressbarSlider
|
|
||||||
}
|
}
|
||||||
RibbonTabGroup{
|
RibbonTabGroup{
|
||||||
width: progressbar_slider.width + 30
|
width: progressbar_slider.width + 30
|
||||||
|
|
|
@ -47,17 +47,15 @@ RibbonTabBar {
|
||||||
property var pushButtonLayout
|
property var pushButtonLayout
|
||||||
|
|
||||||
onContainerItemUpdated: {
|
onContainerItemUpdated: {
|
||||||
if(getItem(0)){
|
basic_page.sliderLayout = getItem(0).sliderLayout
|
||||||
sliderLayout = getItem(0).sliderLayout
|
basic_page.sliderWithBtn = getItem(0).sliderWithBtn
|
||||||
sliderWithBtn = getItem(0).sliderWithBtn
|
basic_page.sliderWithoutBtn = getItem(0).sliderWithoutBtn
|
||||||
sliderWithoutBtn = getItem(0).sliderWithoutBtn
|
basic_page.switchLayout = getItem(1).switchLayout
|
||||||
switchLayout = getItem(1).switchLayout
|
basic_page.btnWithColorAndGrabberText = getItem(1).btnWithColorAndGrabberText
|
||||||
btnWithColorAndGrabberText = getItem(1).btnWithColorAndGrabberText
|
basic_page.checkBoxLayout = getItem(2).checkBoxLayout
|
||||||
checkBoxLayout = getItem(2).checkBoxLayout
|
basic_page.buttonLayout = getItem(3).buttonLayout
|
||||||
buttonLayout = getItem(3).buttonLayout
|
basic_page.btnWithoutBgAndLabel = getItem(3).btnWithoutBgAndLabel
|
||||||
btnWithoutBgAndLabel = getItem(3).btnWithoutBgAndLabel
|
basic_page.pushButtonLayout = getItem(4).pushButtonLayout
|
||||||
pushButtonLayout = getItem(4).pushButtonLayout
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RibbonTabGroup{
|
RibbonTabGroup{
|
||||||
|
@ -333,10 +331,8 @@ RibbonTabBar {
|
||||||
property var lineEditWithIcon
|
property var lineEditWithIcon
|
||||||
|
|
||||||
onContainerItemUpdated: {
|
onContainerItemUpdated: {
|
||||||
if(getItem(0)){
|
lineEditLayout = getItem(0).lineEditLayout
|
||||||
lineEditLayout = getItem(0).lineEditLayout
|
lineEditWithIcon = getItem(0).lineEditWithIcon
|
||||||
lineEditWithIcon = getItem(0).lineEditWithIcon
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RibbonTabGroup{
|
RibbonTabGroup{
|
||||||
|
@ -507,8 +503,7 @@ RibbonTabBar {
|
||||||
title: QT_TRANSLATE_NOOP("RibbonTabBar", "Progress")
|
title: QT_TRANSLATE_NOOP("RibbonTabBar", "Progress")
|
||||||
property var progressbarSlider
|
property var progressbarSlider
|
||||||
onContainerItemUpdated:{
|
onContainerItemUpdated:{
|
||||||
if(getItem(0))
|
progress_page.progressbarSlider = getItem(0).progressbarSlider
|
||||||
progressbarSlider = getItem(0).progressbarSlider
|
|
||||||
}
|
}
|
||||||
RibbonTabGroup{
|
RibbonTabGroup{
|
||||||
width: progressbar_slider.width + 30
|
width: progressbar_slider.width + 30
|
||||||
|
|
|
@ -28,6 +28,7 @@ Item {
|
||||||
active: control.needActive
|
active: control.needActive
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
property int loadedItem: 0
|
||||||
sourceComponent: Flickable{
|
sourceComponent: Flickable{
|
||||||
id: view
|
id: view
|
||||||
property alias containerItem: container
|
property alias containerItem: container
|
||||||
|
@ -49,11 +50,19 @@ Item {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
active: control.needActive
|
active: control.needActive
|
||||||
sourceComponent: control.delegateList[modelData.index].content
|
sourceComponent: control.delegateList[modelData.index].content
|
||||||
|
onLoaded: main_loader.loadedItem++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onLoaded: containerItemUpdated()
|
Timer{
|
||||||
|
running: main_loader.loadedItem === control.delegateCount && main_loader.loadedItem !==0
|
||||||
|
interval: 1
|
||||||
|
onTriggered: {
|
||||||
|
main_loader.loadedItem = 0
|
||||||
|
containerItemUpdated()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getItem( index ){
|
function getItem( index ){
|
||||||
|
|
|
@ -28,6 +28,7 @@ Item {
|
||||||
active: control.needActive
|
active: control.needActive
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
property int loadedItem: 0
|
||||||
sourceComponent: Flickable{
|
sourceComponent: Flickable{
|
||||||
id: view
|
id: view
|
||||||
property alias containerItem: container
|
property alias containerItem: container
|
||||||
|
@ -49,11 +50,19 @@ Item {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
active: control.needActive
|
active: control.needActive
|
||||||
sourceComponent: control.delegateList[modelData.index].content
|
sourceComponent: control.delegateList[modelData.index].content
|
||||||
|
onLoaded: main_loader.loadedItem++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onLoaded: containerItemUpdated()
|
Timer{
|
||||||
|
running: main_loader.loadedItem === control.delegateCount && main_loader.loadedItem !==0
|
||||||
|
interval: 1
|
||||||
|
onTriggered: {
|
||||||
|
main_loader.loadedItem = 0
|
||||||
|
containerItemUpdated()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getItem( index ){
|
function getItem( index ){
|
||||||
|
|
Loading…
Reference in New Issue