Skip to content

Conversation

john-michaelburke
Copy link
Collaborator

Fixes issue with correct subtab showing when you use the tab cli arg. For example:
cargo make run --tab TRACKING_SKYPLOT

Layout.fillWidth: false
spacing: 1
onCountChanged: {
if (Globals.initialSubTabIndex > -1 && count == tabBarRepeater.count) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a little strange. The tabBars local count seems to increment up to the expected where as tabBarRepeater's count will be the max expected. Using onCompleted happens before all tabButtons seem to complete.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onCompleted - are you speaking of the onCompleted within TabBar?
Maybe try putting the onCompleted within the Repeater? Still, it does seem odd that it happens before all tabButtons are created.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the Repeater triggers the onCompleted before any of the tab buttons are created and only once. I found using onModelChanged seems to trigger after all the tab buttons have been completed so it seems like a decent choice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried a Component.onCompleted on the TabBar instead of the repeater?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it appears to complete before the model is populated as well.

@john-michaelburke john-michaelburke merged commit 8635ec3 into main Jan 5, 2022
@john-michaelburke john-michaelburke deleted the john-michaelburke/fix-subtab-selection-from-cli branch January 5, 2022 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants