by the user.
For an example of a more complex model, see the
- \l{itemviews/simpletreemodel}{Simple Tree Model} example.
+ \l{widgets/itemviews/simpletreemodel}{Simple Tree Model} example.
The requirements of QAbstractItemModel subclasses is described in more
detail in the \l{Model Subclassing Reference} document.
However, if the underlying data structure can only be represented
by a hierarchical tree structure, it is necessary to subclass
QAbstractItemModel. This approach is taken in the
- \l{itemviews/simpletreemodel}{Simple Tree Model} example.
+ \l{widgets/itemviews/simpletreemodel}{Simple Tree Model} example.
In this section, we implement a simple model based on a list of
strings, so the QAbstractListModel provides an ideal base class on
\section1 Item view convenience classes
- Qt 4 also introduced some standard widgets to provide classic
+ Qt 4 introduced some standard widgets to provide classic
item-based container widgets. These behave in a similar way to the
item view classes in Qt 3, but have been rewritten to use the
underlying model/view framework for performance and
- maintainability. The old item view classes are still available in
- the compatibility library (see the \l{porting4.html}{Porting
- Guide} for more information).
+ maintainability.
The item-based widgets have been given names which reflect their uses:
\c QListWidget provides a list of items, \c QTreeWidget displays a
Note that the model will typically need to provide implementations of the
QAbstractItemModel::insertRows() and QAbstractItemModel::setData() functions.
- \sa {Item Views Puzzle Example}
+ \sa {widgets/itemviews/puzzle}{Item Views Puzzle Example}
\section1 Proxy models
\section1 Related examples
\list
- \li \l{itemviews/dirview}{Dir View}
- \li \l{itemviews/spinboxdelegate}{Spin Box Delegate}
- \li \l{itemviews/pixelator}{Pixelator}
- \li \l{itemviews/simpletreemodel}{Simple Tree Model}
- \li \l{itemviews/chart}{Chart}
+ \li \l{widgets/itemviews/dirview}{Dir View}
+ \li \l{widgets/itemviews/spinboxdelegate}{Spin Box Delegate}
+ \li \l{widgets/itemviews/pixelator}{Pixelator}
+ \li \l{widgets/itemviews/simpletreemodel}{Simple Tree Model}
+ \li \l{widgets/itemviews/chart}{Chart}
\endlist
*/