Stack view problem
-
Hi
In my project, the 5 tab bar contain five different pages. Each page is created on the item container. I load the each page in the rectangle as stack view child item. If I run the program , the all the page will appear in the rectangle at first time. The initial page didn't appear first.
sample code:
StackView{
id:stack
anchors.fill: rect_stackview
initialItem: page_firstFirst{ id:page_first //visible: false } Second{ id:page_second // visible: false } Third{ id:page_third // visible: false } Fourth{ id:page_fourth // visible: false }
If i put visible =false, the stackview is working fine, otherwise all the page appear in the rectangle. How can i solve this problem without set visible as false ?
-
Hi
In my project, the 5 tab bar contain five different pages. Each page is created on the item container. I load the each page in the rectangle as stack view child item. If I run the program , the all the page will appear in the rectangle at first time. The initial page didn't appear first.
sample code:
StackView{
id:stack
anchors.fill: rect_stackview
initialItem: page_firstFirst{ id:page_first //visible: false } Second{ id:page_second // visible: false } Third{ id:page_third // visible: false } Fourth{ id:page_fourth // visible: false }
If i put visible =false, the stackview is working fine, otherwise all the page appear in the rectangle. How can i solve this problem without set visible as false ?
-
@eswar I suppose your sample code isn't copypasted, you have "initialItem: page_First" but " id:page_first" which doesn't work.
-
Hi
In my project, the 5 tab bar contain five different pages. Each page is created on the item container. I load the each page in the rectangle as stack view child item. If I run the program , the all the page will appear in the rectangle at first time. The initial page didn't appear first.
sample code:
StackView{
id:stack
anchors.fill: rect_stackview
initialItem: page_firstFirst{ id:page_first //visible: false } Second{ id:page_second // visible: false } Third{ id:page_third // visible: false } Fourth{ id:page_fourth // visible: false }
If i put visible =false, the stackview is working fine, otherwise all the page appear in the rectangle. How can i solve this problem without set visible as false ?
-
You can do like this :
Rectangle { id: baseComponent property Item first: Item { id: first_item } property Item second: Item { ... } property Item third: Item { ... } property Item fourth: Item { ... } StackView { anchors.fill: parent initialItem: first_item } }
Hope it helped!
-
You can do like this :
Rectangle { id: baseComponent property Item first: Item { id: first_item } property Item second: Item { ... } property Item third: Item { ... } property Item fourth: Item { ... } StackView { anchors.fill: parent initialItem: first_item } }
Hope it helped!