ItemModel Class Reference
from PyKDE4.akonadi import *
Inherits: QAbstractTableModel → QAbstractItemModel → QObject
Namespace: Akonadi
Detailed Description
A table model for items.
A self-updating table model that shows all items of a collection.
QTableView *view = new QTableView( this ); Akonadi.ItemModel *model = new Akonadi.ItemModel(); view->setModel( model ); model->setCollection( Akonadi.Collection.root() );
Enumerations | |
Column | { Id, RemoteId, MimeType } |
Roles | { IdRole, ItemRole, MimeTypeRole, UserRole } |
Signals | |
collectionChanged (Akonadi.Collection collection) | |
Methods | |
__init__ (self, QObject parent=0) | |
Akonadi.Collection | collection (self) |
collectionChanged (self, Akonadi.Collection collection) | |
int | columnCount (self, QModelIndex parent=QModelIndex()) |
QVariant | data (self, QModelIndex index, int role=Qt.DisplayRole) |
bool | dropMimeData (self, QMimeData data, Qt.DropAction action, int row, int column, QModelIndex parent) |
Akonadi.ItemFetchScope | fetchScope (self) |
Qt.ItemFlags | flags (self, QModelIndex index) |
QVariant | headerData (self, int section, Qt.Orientation orientation, int role=Qt.DisplayRole) |
QModelIndex | indexForItem (self, Akonadi.Item item, int column) |
Akonadi.Item | itemForIndex (self, QModelIndex index) |
QMimeData | mimeData (self, QModelIndexList indexes) |
QStringList | mimeTypes (self) |
int | rowCount (self, QModelIndex parent=QModelIndex()) |
Akonadi.Session | session (self) |
setCollection (self, Akonadi.Collection collection) | |
setFetchScope (self, Akonadi.ItemFetchScope fetchScope) |
Method Documentation
__init__ | ( | self, | ||
QObject | parent=0 | |||
) |
Creates a new item model.
- Parameters:
-
parent The parent object.
Akonadi.Collection collection | ( | self ) |
Returns the collection being displayed in the model.
collectionChanged | ( | self, | ||
Akonadi.Collection | collection | |||
) |
This signal is emitted whenever setCollection is called.
- Parameters:
-
collection The new collection.
- Signal syntax:
QObject.connect(source, SIGNAL("collectionChanged(const Collection&)"), target_slot)
int columnCount | ( | self, | ||
QModelIndex | parent=QModelIndex() | |||
) |
QVariant data | ( | self, | ||
QModelIndex | index, | |||
int | role=Qt.DisplayRole | |||
) |
bool dropMimeData | ( | self, | ||
QMimeData | data, | |||
Qt.DropAction | action, | |||
int | row, | |||
int | column, | |||
QModelIndex | parent | |||
) |
Akonadi.ItemFetchScope fetchScope | ( | self ) |
Returns the item fetch scope.
Since this returns a reference it can be used to conveniently modify the current scope in-place, i.e. by calling a method on the returned reference without storing it in a local variable. See the ItemFetchScope documentation for an example.
- Returns:
- a reference to the current item fetch scope.
- See also:
- setFetchScope() for replacing the current item fetch scope.
Qt.ItemFlags flags | ( | self, | ||
QModelIndex | index | |||
) |
QVariant headerData | ( | self, | ||
int | section, | |||
Qt.Orientation | orientation, | |||
int | role=Qt.DisplayRole | |||
) |
QModelIndex indexForItem | ( | self, | ||
Akonadi.Item | item, | |||
int | column | |||
) |
Returns the model index for the given item, with the given column.
- Parameters:
-
item The item to find. column The column for the returned index.
Akonadi.Item itemForIndex | ( | self, | ||
QModelIndex | index | |||
) |
Returns the item at the given index.
QMimeData mimeData | ( | self, | ||
QModelIndexList | indexes | |||
) |
QStringList mimeTypes | ( | self ) |
int rowCount | ( | self, | ||
QModelIndex | parent=QModelIndex() | |||
) |
Akonadi.Session session | ( | self ) |
Returns the Session object used for all operations by this model.
setCollection | ( | self, | ||
Akonadi.Collection | collection | |||
) |
Sets the collection the model should display. If the collection has changed, the model is reset and a new message listing is requested from the Akonadi storage.
- Parameters:
-
collection The collection.
setFetchScope | ( | self, | ||
Akonadi.ItemFetchScope | fetchScope | |||
) |
Sets the item fetch scope.
The ItemFetchScope controls how much of an item's data is fetched from the server, e.g. whether to fetch the full item payload or only meta data.
- Parameters:
-
fetchScope The new scope for item fetch operations.
- See also:
- fetchScope()
Enumeration Documentation
Column |
Describes the types of the columns in the model.
- Enumerator:
-
Id = 0 RemoteId MimeType
Roles |
Describes the roles of the model.
- Enumerator:
-
IdRole = Qt::UserRole+1 ItemRole MimeTypeRole UserRole = Qt::UserRole+42