Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
New Developer
Posts: 11
Registered: ‎10-01-2009
My Device: Not Specified

Startup Tab

Hello everyone!

 

I'm looking for a way to make the user choose the tab on which the app starts.

 

Thanks

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Startup Tab

How about just using Qsettings to record the last one they were on?


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
New Developer
Posts: 10
Registered: ‎03-11-2014
My Device: Z10
My Carrier: BITE Latvia

Re: Startup Tab

In your main.qml

 

TabbedPane {
    id: root_tab

    activeTab: activeTab()
    
    function activeTab() {
        var default_tab = settings.getvalueFor("default_tab", "some_tab");
        switch (default_tab) {
            case "some_tab": return some_tab
            case "second_tab": return second_tab
            case "third_tab": return third_tab
            case "fourth_tab": return fourth_tab
        }
    }
}

 

In my case I have a qml->setContextProperty for 'settings' in application constructor

Hope you know/figure out how to use QSettings.