Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QTaskModel class provides access to Tasks data. More...
#include <QTaskModel>
Inherits QPimModel.
The QTaskModel class provides access to Tasks data.
User tasks are represented in the task model as a table, with each row corresponding to a particular task and each column as on of the fields of the task. Complete QTask objects can be retrieved using the task() function which takes either a row, index, or unique identifier.
The task model is a descendant of QAbstractItemModel, so it is suitable for use with the Qt View classes such as QListView and QTableView, as well as QTaskListView or any custom views.
The task model provides functions for filtering of tasks by category and completion status, and by default will sort by completion status, priority and description. Note that this sort order may change in future versions of Qtopia.
The appointment model provides functions for sorting and some filtering of items. For filters or sorting that is not provided by the task model, it is recommended that QSortFilterProxyModel be used to wrap the task model.
A QTaskModel instance will also reflect changes made in other instances of QTaskModel, both within this application and from other applications. This will result in the modelReset() signal being emitted.
See also QTask, QTaskListView, QSortFilterProxyModel, and Pim Library.
Enumerates the columns when in table mode and columns used for sorting. This is a subset of the data retrievable from a QTask.
Constant | Value | Description |
---|---|---|
QTaskModel::Invalid | -1 | An invalid field |
QTaskModel::Description | 0 | The description of the task |
QTaskModel::Priority | 1 | The priority of the task |
QTaskModel::Completed | 2 | Whether the task is completed |
QTaskModel::PercentCompleted | 3 | The percent completed of the task |
QTaskModel::Status | 4 | The status of the task |
QTaskModel::DueDate | 5 | The due date of the task |
QTaskModel::StartedDate | 6 | The started date of the task |
QTaskModel::CompletedDate | 7 | The completed date of the task |
QTaskModel::Notes | 8 | The notes of the task |
QTaskModel::Identifier | 9 | The identifier of the task |
QTaskModel::Categories | 10 | The list of categories the task belongs to |
QTaskModel::Alarm | 11 | The type of alarm of the task, if it has a due date |
QTaskModel::RepeatRule | 12 | The repeat rule of the task, if it has a due date |
QTaskModel::RepeatFrequency | 14 | The repeat frequency of the task, if it has a due date |
QTaskModel::RepeatEndDate | 13 | The date a repeating task repeats until, if it has a due date. If null the task repeats forever |
QTaskModel::RepeatWeekFlags | 15 | The flags specifying what days of the week the task repeats on, if it has a due date. |
Constructs a task model with the given parent.
Destroys the task model.
Adds the PIM record encoded in bytes to the model under the specified storage source. The format of the record in bytes is given by format. An empty format string will cause the record to be read using the data stream operators for the PIM data type of the model. If the specified source is null the function will add the record to the default storage source.
Returns a valid identifier for the record if the record was successfully added. Otherwise returns a null identifier.
Can only add PIM data that is represented by the model. This means that only task data can be added using a task model. Valid formats are "vCalendar" or an empty string.
Reimplemented from QPimModel.
See also addTask().
Adds the task to the model under the specified storage source. If source is null the function will add the task to the default storage source.
Returns a valid identifier for the task if the task was successfully added. Otherwise returns a null identifier.
Note the current identifier of the specified appointment is ignored.
Returns the data stored under the given role for the item referred to by the index.
The row of the index specifies which task to access and the column of the index is treated as a QTaskModel::Field.
Reimplemented from QAbstractItemModel.
See also setData() and taskField().
Returns an icon representing the task model field.
Returns a null icon if no icon is available.
See also fieldLabel(), fieldIdentifier(), and identifierField().
Returns a non-translated string describing the task model field.
See also fieldLabel(), fieldIcon(), and identifierField().
Returns a translated string describing the task model field.
See also fieldIcon(), fieldIdentifier(), and identifierField().
Returns true if the model contains only completed tasks.
See also setFilterCompleted().
Returns the task model field for the non-translated field identifier.
See also fieldLabel(), fieldIcon(), and fieldIdentifier().
Returns a list of indexes for the items where the data matches the specified value. The list that is returned may be empty. The search starts from the start index.
Currently unimplemented, this function ignores start, role, value, hits and flags.
Returns the record in the model with the specified identifier encoded in the format specified by the format string. An empty format string will cause the record to be written using the data stream operators for the PIM data type of the model.
Valid formats are "vCalendar" or an empty string.
Reimplemented from QPimModel.
See also task().
Removes the records in the model specified by the list of identifiers.
Returns true if tasks were successfully removed.
Removes the record from the model with the specified identifier.
Returns true if the record was successfully removed.
Reimplemented from QPimModel.
See also removeTask().
Removes the task from the model with the same identifier as the specified task.
Returns true if the task was successfully removed.
This is an overloaded member function, provided for convenience.
Removes the task from the model with the specified identifier.
Returns true if the task was successfully removed.
Sets the role data for the item at index to value. Returns true if successful.
The task model only accepts data for the EditRole. The column of the specified index specifies the QTaskModel::Field to set and the row of the index specifies which task to modify.
Reimplemented from QAbstractItemModel.
See also data() and setTaskField().
Sets whether the model contains only completed Tasks to completedOnly.
See also filterCompleted().
Sets the value for the specified field of the given task to value.
Returns true if the task was modified.
See also taskField() and setData().
Sorts the model by column in ascending order
Currently order is ignored but may be implemented at a future date.
Reimplemented from QAbstractItemModel.
Returns the task for the row specified by index. The column of index is ignored.
This is an overloaded member function, provided for convenience.
Returns the task in the model with the given identifier. The task does not have to be in the current filter mode for it to be returned.
This is an overloaded member function, provided for convenience.
Return the task for the given row.
Returns the value for the specified field of the given task.
Note: Certain fields (Alarm, RepeatRule, RepeatFrequency, RepeatEndDate and RepeatWeekFlags) are not accessible by this function. Use data() instead, or fetch the dependent QAppointment directly.
See also setTaskField() and data().
Updates the corresponding record in the model to equal the record encoded in bytes. The format of the record in bytes is given by the format string. An empty format string will cause the record to be read using the data stream operators for the PIM data type of the model. If id is not null will set the record identifier to id before attempting to update the record.
Returns true if the record was successfully updated.
Valid formats are "vCalendar" or an empty string.
Reimplemented from QPimModel.
See also updateTask().
This function will update any recurring tasks that require updating (for example, to set the new due date). This should be called in response to the QCop message "Tasks::updateRecurringTasks()", or when the application wants to ensure that all recurring tasks are up to date.
The library will generate the QCop message at the appropriate times.
Returns true if updates were successful, false otherwise.
Updates the task in the model with the same identifier as the specified task to equal the specified task.
Returns true if the task was successfully updated.
Copyright © 2009 Nokia | Trademarks | Qt Extended 4.4.3 |