TabView QML Type

Provides a tabbed view More...

Import Statement: import quey.ui 0.1
Inherits:

Item

Properties

Signals

Methods

Detailed Description

import QtQuick 2.4
import quey.ui 0.1


ApplicationView {
    width: Units.dp(640)
    height: Units.dp(480)

    TabView {
        id: tabView
        anchors.fill: parent

        menu: Menu {
            items: [
                MenuItem {
                    text: "File"
                }
            ]
        }

        actions: [
            Action {
                iconName: "plus"
            }
        ]

        TabPage {
            title: "Main"

            Label {
                anchors.centerIn: parent
                text: "Something"
            }
        }

    }

    Component {
        id: myTabPage

        TabPage {
            id: page

            closable: true
            movable: true

            Button {
                anchors.centerIn: parent
                text: page.title
            }
        }
    }

    Component.onCompleted: {
        for (var i=0; i<5; i++) {
            var page = myTabPage.createObject(null, {title: "My Tab " + i.toString()})
            tabView.addTab(page)
        }
    }
}

Property Documentation

actions : Action

A list of actions to be displayed next to the tab bar.


activeTab : var

Holds the current tab.


activeTabHistory : var

A list of tabs ordered by their activation time.


lastActiveTab : var

Holds the last active tab.


lastTabUID : int

The last internally used tab id.


An attached Menu.


tabsModel : ListModel

A model of tabs. Used internally.


Signal Documentation

lastTabClosed()

Emitted if the last tab was closed.


Method Documentation

addTab(view, background)

Add a tab to the view.


ensureTabIsVisible(t)

Ensure a tab is visible.


getTabModelDataByUID(uid)

Return the model data based on a tab id. Used internally.


getTabModelIndexByUID(uid)

Return the model index based on a tab id. Used internally.


getUIDByModelIndex(i)

Return the tab id based on the model index. Used internally.


removeTab(t)

Remove a tab from the view.


setActiveTab(t, ensureVisible)

Set the active tab.


setLastActiveTabActive()

Set the last active tab active.