TabView

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

Import Statement: import QtQuick.Controls 1.4
Since: Qt 5.1
Inherits:

FocusScope

Properties

Methods

  • Tab addTab(string title, Component component)
  • Tab getTab(int index)
  • Tab insertTab(int index, string title, Component component)
  • void moveTab(int from, int to)
  • void removeTab(int 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-only] contentItem : 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-only] count : 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

Tab addTab(string title, Component component)

Adds a new tab with the given title and an optional component.

Returns the newly added tab.


Tab getTab(int index)

Returns the Tab item at index.


Tab insertTab(int index, string title, Component component)

Inserts a new tab at index, with the given title and an optional component.

Returns the newly added tab.


void moveTab(int from, int to)

Moves a tab from index to another.


void removeTab(int index)

Removes and destroys a tab at the given index.


Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support