1

I would like to know if it is possible to add a toggle button to a tabbed pane. Here is some code to explain the issue:

TabbedPane {
    showTabsOnActionBar: false
    Tab {
        title: qsTr("Some tab") + Retranslate.onLocaleOrLanguageChanged
        //Adding a toggle button here causes an error
    } 
}

I would like the tab to display "Some tab" and next to it there should be a toggle button. The toggle button would represent some setting. If this is not possible, how would you suggest that I go about doing this?

Jagger
  • 10,350
  • 9
  • 51
  • 93
Lunchbox
  • 1,538
  • 2
  • 16
  • 42

1 Answers1

1

The other tab can be this:

Tab {
    title: "Tab 2"
    property variant toggle: false
    onTriggered: {
        console.log("YOU TRIGGERED! " +toggle)
        title = "Tab X"
        toggle = !toggle;
    }
}

Now you can change image and title from there, and everything the button does.

Bojan Kogoj
  • 5,321
  • 3
  • 35
  • 57