extracting value from child component
-
Hi all -
Imagine that I have a main.qml:
ColumnLayout { Navbar { id: navBar } Mainarea { currentIndex: navTabs.currentIndex // this doesn't work of course }
And Navbar.qml:
Item { id: bigPicture Rectangle { id: navBar TabBar { id: navTabs ...
How can I find the currentIndex of the TabBar from my Mainarea object?
Thanks...
-
Hi all -
Imagine that I have a main.qml:
ColumnLayout { Navbar { id: navBar } Mainarea { currentIndex: navTabs.currentIndex // this doesn't work of course }
And Navbar.qml:
Item { id: bigPicture Rectangle { id: navBar TabBar { id: navTabs ...
How can I find the currentIndex of the TabBar from my Mainarea object?
Thanks...
Got it...property alias. Added a line to Navbar.qml:
Item { id: bigPicture property alias tabIndex: navTabs.currentIndex // the new line Rectangle { id: navBar TabBar { id: navTabs ...
And in main.qml:
Navbar { id: navBar } Mainarea { currentIndex: navBar.tabIndex }
Seems to work, but if someone knows of a better way, I'm open to suggestions. Thanks for looking...