TabView QML Type | Qt Quick Controls 5.4

- Qt 5.4
- Qt Quick Controls
- QML Types
- TabView QML Type
- Qt 5.4.2 Reference Documentation

# TabView QML Type

A control that allows the user to select one of multiple stacked items. More...

Import Statement: | import QtQuick.Controls 1.3
Since: | Qt 5.1
Inherits: | FocusScope

- List of all members, including inherited members

## Properties

- contentItem : Item
- count : int
- currentIndex : int
- frameVisible : bool
- tabPosition : int
- tabsVisible : bool

## Methods

- addTab(title, component)
- getTab(index)
- insertTab(index, title, component)
- moveTab(from, to)
- removeTab(index)

## Detailed Description

TabView provides tab-based navigation model for your application. For example, the following snippet uses tabs to present rectangles of different color on each tab page:

    TabView {
        Tab {
            title: "Red"
            Rectangle { color: "red" }
        }
        Tab {
            title: "Blue"
            Rectangle { color: "blue" }
        }
        Tab {
            title: "Green"
            Rectangle { color: "green" }
        }
    }

Note: You can create a custom appearance for a TabView by assigning a TabViewStyle.

Tab represents the content of a tab in a TabView.

## Property Documentation

read-onlycontentItem : Item

This property holds the content item of the tab view.

Tabs declared as children of a TabView are automatically parented to the TabView's contentItem.

This QML property was introduced in QtQuick.Controls 1.3.

read-onlycount : int

The current tab count

currentIndex : int

The current tab index

frameVisible : bool

The visibility of the tab frame around contents

tabPosition : int

- Qt.TopEdge (default)
- Qt.BottomEdge

tabsVisible : bool

The visibility of the tab bar

## Method Documentation

addTab( title, component)

Adds a new tab page with title with and optional Component. Returns the newly added tab.

getTab( index)

Returns the Tab item at index.

insertTab( index, title, component)

Inserts a new tab with title at index, with an optional Component. Returns the newly added tab.

moveTab( from, to)

Moves a tab from index to another.

removeTab( index)

Removes and destroys a tab at the given index.