Qt 4.8
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
VisualItemModel Class Reference

The VisualItemModel allows items to be provided to a view. More...

Detailed Description

The VisualItemModel allows items to be provided to a view.

Since
4.7

A VisualItemModel contains the visual items to be used in a view. When a VisualItemModel is used in a view, the view does not require a delegate since the VisualItemModel already contains the visual delegate (items).

An item can determine its index within the model via the index attached property.

The example below places three colored rectangles in a ListView.

import QtQuick 1.0
Rectangle {
id: itemModel
Rectangle { height: 30; width: 80; color: "red" }
Rectangle { height: 30; width: 80; color: "green" }
Rectangle { height: 30; width: 80; color: "blue" }
}
anchors.fill: parent
model: itemModel
}
}
visualitemmodel.png
See also
{declarative/modelviews/visualitemmodel}{VisualItemModel example}

The documentation for this class was generated from the following file: