Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QPimSourceModel class provides a Model class for manipulating a set of QPimSource objects. More...
#include <QPimSourceModel>
Inherits QAbstractListModel.
The QPimSourceModel class provides a Model class for manipulating a set of QPimSource objects.
This is intended to be used with a QAbstractItemView derived class like QListView, in order to provide the user with a way to select a source (or sources) for their PIM data. It provides sorting of the sources, accessing translated strings for source titles, and the ability to check and uncheck sources for use with one of the PIM models (QContactModel, QTaskModel and QAppointmentModel).
By default, this model will provide a non-checkable model, suitable for selecting a single source, but if setCheckedSources() is called this model will allow for multiple sources to be selected.
See also QPimModel, QPimContext, and Pim Library.
Constructs a QPimSourceModel with parent parent.
Destroys the QPimSourceModel.
Adds the PIM data source to the model
See also removeSource() and updateSource().
Returns the set of checked sources.
See also setCheckedSources().
Returns the context that controls the PIM data source at index. Returns 0 if no context controlling the PIM data source is found, or if the index is invalid.
See also source().
Returns the data stored under the given role for the item referred to by the index.
This function will return the QPimSource's title for role Qt::DisplayRole, the icon for the corresponding QPimContext for role Qt::DecorationRole, and the appropriate check state for Qt::CheckStateRole.
Reimplemented from QAbstractItemModel.
See also setData().
Returns the item flags for the given index.
If setCheckedSources() has been called, these flags will include Qt::ItemIsUserCheckable, as a hint to the view to provide multiple selection capabilities.
Reimplemented from QAbstractItemModel.
Returns the index for this model that corresponds to the PIM data source. Returns a null index if the source is not listed in the model.
Removes the PIM data source from the model.
See also addSource() and updateSource().
Returns the number of rows in the model. The parameter parent is not used.
Reimplemented from QAbstractItemModel.
Sets the sources that should be marked as checked to those contained in set. Calling this function will also indicate that this model should allow multiple selections.
Typically, this function will be called with the results from QPimModel::visibleSources().
See also checkedSources().
Sets the contexts defining the PIM data sources to display to contexts The available sources for each context are built into a list of PIM data sources.
Typically, the list of contexts is provided by QPimModel::contexts().
This is an overloaded member function, provided for convenience.
This is a convenience function for the contexts of a QContactModel.
This is an overloaded member function, provided for convenience.
This is a convenience function for the contexts of a QAppointmentModel.
This is an overloaded member function, provided for convenience.
This is a convenience function for the contexts of a QTaskModel.
Sets the role data for the item at index to value. Returns true if successful, otherwise returns false.
In this implementation only the data for the Qt::CheckStateRole can be modified this way.
Reimplemented from QAbstractItemModel.
See also data().
Returns the PIM data source at index.
See also context().
Updates the PIM data source at index to source. Because the model maintains a sort order, the new source may not appear at index.
See also addSource() and removeSource().
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |