|
cut 3.3.0
|
Receives and stores Task executions and results. More...
Public Member Functions | |
| __init__ (self, QObject parent=None) | |
| Initializes the TaskModel object, setting a list of headers and basic members. | |
| QModelIndex | index (self, int row, int column, QModelIndex parent=QModelIndex()) |
| Creates a valid index to identify a cell in the model. | |
| QModelIndex | parent (self, QModelIndex child) |
| Returns the parent of a cell. | |
| int | rowCount (self, QModelIndex parent=QModelIndex()) |
| Indicates how many rows the model has. | |
| int | columnCount (self, QModelIndex parent=QModelIndex()) |
| Indicates how many columns the model has. | |
| object | data (self, QModelIndex index, int role) |
| For a particular cell, it returns its Qt.DisplayData or the role asked. | |
| headerData (self, int section, Qt.Orientation orientation, int role) | |
| Returns the headers of the rows and columns. | |
| hasChildren (self, QModelIndex parent=QModelIndex()) | |
| Indicates wether the cell can be expanded in case it has children. | |
| TaskSummary | get_ts_from_id (self, int id) |
| Convinience method that returns a TaskSummary out of the id. | |
| push_initial_data (self, int id, str name, str args) | |
| Creates initial tasksummary object and fills it with data. | |
| push_start_time (self, int task_id) | |
| Indicates that the Task identified by task_id has started. | |
| push_end_time (self, int task_id) | |
| Indicates that the Task identified by task_id has finished. | |
| push_result_value (self, int task_id, str outcome, object obj) | |
| Indicates that there is a result available from the task. | |
Receives and stores Task executions and results.
| task.taskmodel.TaskModel.__init__ | ( | self, | |
| QObject | parent = None ) |
Initializes the TaskModel object, setting a list of headers and basic members.
| [in] | parent | Parent to this QObject. Used by Qt to set parent/children relations. |
| int task.taskmodel.TaskModel.columnCount | ( | self, | |
| QModelIndex | parent = QModelIndex() ) |
Indicates how many columns the model has.
It returns the number of headers in the table.
| object task.taskmodel.TaskModel.data | ( | self, | |
| QModelIndex | index, | ||
| int | role ) |
For a particular cell, it returns its Qt.DisplayData or the role asked.
This is the most important method in the model, since this is the method that the view will use to query the data from the model.
| TaskSummary task.taskmodel.TaskModel.get_ts_from_id | ( | self, | |
| int | id ) |
Convinience method that returns a TaskSummary out of the id.
| [in] | id | Task id we are looking for |
| task.taskmodel.TaskModel.hasChildren | ( | self, | |
| QModelIndex | parent = QModelIndex() ) |
Indicates wether the cell can be expanded in case it has children.
This in reserved to tree-structured models, so in this case, we return False.
| task.taskmodel.TaskModel.headerData | ( | self, | |
| int | section, | ||
| Qt.Orientation | orientation, | ||
| int | role ) |
Returns the headers of the rows and columns.
Used to quickly identify the data.
| QModelIndex task.taskmodel.TaskModel.index | ( | self, | |
| int | row, | ||
| int | column, | ||
| QModelIndex | parent = QModelIndex() ) |
Creates a valid index to identify a cell in the model.
It is required by Qt that you create indeces to a particular model by its provided index() method.
| QModelIndex task.taskmodel.TaskModel.parent | ( | self, | |
| QModelIndex | child ) |
Returns the parent of a cell.
This is reserved for Tree structured models. Since this is a table, we return an invalid QModelIndex that indicates there is no parent. The cell is at the top level of the model.
| task.taskmodel.TaskModel.push_end_time | ( | self, | |
| int | task_id ) |
Indicates that the Task identified by task_id has finished.
This method records the timestamp.
| [in] | task_id | Task ID of the Task we wish to update. |
| task.taskmodel.TaskModel.push_initial_data | ( | self, | |
| int | id, | ||
| str | name, | ||
| str | args ) |
Creates initial tasksummary object and fills it with data.
Stores it in a dict.
| [in] | id | ID of the Task we are adding to the model. |
| [in] | name | Name of the Task (method name). |
| [in] | args | Arguments to be passed to the method in the task. |
| task.taskmodel.TaskModel.push_result_value | ( | self, | |
| int | task_id, | ||
| str | outcome, | ||
| object | obj ) |
Indicates that there is a result available from the task.
This method records the values.
| [in] | task_id | Task ID of the Task we wish to update. |
| [in] | outcome | The outcome of the execution (Error, Progress, Ok) |
| [in] | obj | The return value, progress value, or exception tuple. |
| task.taskmodel.TaskModel.push_start_time | ( | self, | |
| int | task_id ) |
Indicates that the Task identified by task_id has started.
This method records the timestamp.
| [in] | task_id | Task ID of the Task we wish to update. |
| int task.taskmodel.TaskModel.rowCount | ( | self, | |
| QModelIndex | parent = QModelIndex() ) |
Indicates how many rows the model has.
It returns the number of segments.