Qt 5.6 | Qt Labs Controls | QML Types | Container QML Type

Qt 5.6.3 Reference Documentation

# Container QML Type

A container control base type. More...

Import Statement: | import Qt.labs.controls 1.0
Inherits: | Control
Inherited By: | Drawer, SwipeView, and TabBar

- List of all members, including inherited members

## Properties

- contentChildren : list<Item>
- contentData : list<Object>
- contentModel : model
- count : int
- currentIndex : int
- currentItem : Item

## Methods

- void addItem(Item item)
- void insertItem(int index, Item item)
- Item itemAt(int index)
- void moveItem(int from, int to)
- void removeItem(int index)

## Detailed Description

Container is the base type of container-like user interface controls.

Note: Types in the Qt.labs module are not guaranteed to remain compatible in future versions.

See also Container Controls.

## Property Documentation

contentChildren : list<Item>

This property holds the list of content children.

See also Item::children.

[default] contentData : list<Object>

This property holds the list of content data.

See also Item::data.

[read-only] contentModel : model

This property holds the content model of items.

[read-only] count : int

This property holds the number of items.

currentIndex : int

This property holds the index of the current item in the container.

currentItem : Item

This property holds the current item.

## Method Documentation

void addItem(Item item)

Adds an item.

void insertItem(int index, Item item)

Inserts an item at index.

Item itemAt(int index)

Returns the item at index, or `null` if it does not exist.

void moveItem(int from, int to)

Moves an item from one index to another.

void removeItem(int index)

Removes an item at index.

Note: The ownership of the item is transferred to the caller.