Obsolete Members for Container | Qt Quick Controls 5.12.11

- Qt 5.12
- Qt Quick Controls
- QML Types
- Obsolete Members for Container
- Qt 5.12.11 Reference Documentation

# Obsolete Members for Container

The following members of QML type Container are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

## Methods

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

## Method Documentation

void addItem(Item item)

Adds an item.

void decrementCurrentIndex()

Decrements the current index of the container.

This method can be called to alter the current index without breaking existing `currentIndex` bindings.

This method was introduced in QtQuick.Controls 2.1 (Qt 5.8).

See also currentIndex and Managing the Current Index.

void incrementCurrentIndex()

Increments the current index of the container.

This method can be called to alter the current index without breaking existing `currentIndex` bindings.

This method was introduced in QtQuick.Controls 2.1 (Qt 5.8).

See also currentIndex and Managing the Current Index.

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(Item item)

Removes and destroys the specified item.

This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).

void setCurrentIndex(int index)

Sets the current index of the container.

This method can be called to set a specific current index without breaking existing `currentIndex` bindings.

See also currentIndex and Managing the Current Index.

Item takeItem(int index)

Removes and returns the item at index.

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

This method was introduced in QtQuick.Controls 2.3 (Qt 5.10).