Home · All Classes · Grouped Classes · Annotated · Functions

QContactListView Class Reference

The QContactListView class provides a list view widget for use with QContactModel. More...

    #include <QContactListView>

Inherits QListView.

Public Functions

Additional Inherited Members


Detailed Description

The QContactListView class provides a list view widget for use with QContactModel.

The convenience functions provided by QContactListView include functions for interpreting the view's model, delegate and current item as the corresponding QContactModel, QContactDelegate and QContact objects. In addition, QContactListView enforces using a QContactModel (or a derivative) as the model.

Upon construction, QContactListView automatically sets itself to use a QContactDelegate for drawing, sets Batch layout mode (setLayoutMode()), and sets the resize mode to Adjust (setResizeMode()).

The following image displays a QContactListView, using the default QContactDelegate to render QContacts from a QContactModel.

"List of QContacts"

See also QContact, QContactModel, and QContactDelegate.


Member Function Documentation

QContactListView::QContactListView ( QWidget * parent = 0 )

Constructs a QContactListView with the given parent.

This also sets the layout mode to Batched for performance, the resize mode to Adjust, and creates a QContactDelegate to use as the delegate.

QContactListView::~QContactListView ()

Destroys the QContactListView.

QContactDelegate * QContactListView::contactDelegate () const

Returns the QContactDelegate set for the view. During construction, QContactListView will automatically create a QContactDelegate to use as the delegate, but this can be overridden with a different delegate derived from QContactDelegate if necessary.

QContactModel * QContactListView::contactModel () const

Returns the QContactModel set for the view.

QContact QContactListView::currentContact () const

Returns the QContact for the currently selected index.

QList<QUniqueId> QContactListView::selectedContactIds () const

Returns the list of ids for contacts selected in the view.

See also selectedContacts().

QList<QContact> QContactListView::selectedContacts () const

Returns the list of complete contacts selected from the view. If a large number of contacts might be selected this function can be expensive, and selectedContactIds() should be used instead.

See also selectedContactIds().

void QContactListView::setModel ( QAbstractItemModel * model )   [virtual]

Sets the model for the view to model.

Will only accept the model if it inherits or is a QContactModel. If the model does not inherit a QContactModel, the existing model will be retained.

Reimplemented from QAbstractItemView.


Copyright © 2007 Trolltech Trademarks
Qtopia 4.2.5