TabBar QML Type

Tab bar that will be shown in the header when Tabs is active. This component does not need to be instantiated by the developer, it is automatically created by the Tabs. More...

Import Statement: import Ubuntu.Components 1.2
Inherits:

StyledItem

Properties

Detailed Description

Property Documentation

activeFocusOnPress : bool

The property specifies whether the StyledItem can gain focus on a mouse press/touch or not. When the value is true, the focus will be set on the component when the mouse is pressed over it or touched. However if one of the component's ancestor StyledItem or derived is having the property value false, the focus will not be gained automatically.

In the following example the TextField will stay focused when clicked on the red rectangle.

import QtQuick 2.4
import Ubuntu.Components 1.2

Column {
    width: units.gu(50)
    height: units.gu(100)

    StyledItem {
        objectName: "passiveScope"
        width: parent.width
        height: units.gu(30)
        Rectangle {
            anchors.fill: parent
            color: "red"
            StyledItem {
                objectName: "activeScope"
                activeFocusOnPress: true
                anchors.fill: parent
            }
        }
    }

    TextField {
        id: input
        text: "The input stays focus even if red box is clicked"
    }

    Component.onCompleted: input.forceActiveFocus()

    Connections {
        target: window
        onActiveFocusItemChanged: console.debug("focus on", window.activeFocusItem)
    }
}

The default value is false.

This QML property was introduced in Ubuntu.Components 1.1.


alwaysSelectionMode : bool

Do not deactivate the tab bar after a specified idle time or when the user selects a new tab. Off by default.


animate : bool

Show animations when the state changes. Default: true.


model : var

The model containing the tabs to be controlled by the TabBar. The tabs are visualized by the style, displaying controlling elements based on the data specified by the roles. The default style mandates the existence of either the title or tab role, but different styles may require to have other roles (e.g. image, color). The order the role existence is checked is also determined by the style component, Default style checks the existence of the tab role first, and if not defined will use the title role.


read-onlypressed : bool

The user is interacting with the tab bar. Depends on the style pressed property.


selectedIndex : int

The property holds the index of the selected Tab item. Note: Setting this property is DEPRECATED. Set the selectedIndex of the model instead.


selectionMode : bool

An inactive tab bar only displays the currently selected tab, and an active tab bar can be interacted with to select a tab.


style : Component

Component instantiated immediately and placed below everything else.