These sections give some insight into these classes. Please also read the RunnerModel and RunnerItem description .
Generally, a RunnerItem has a parent item, and can have a number of child items. Each RunnerItem object contains information about its place in the tree structure, it can return its parent item and its row number. The use of a pointer-based tree structure allows to store the runner item object pointer in the QModelIndex which refers to the runner item. Use QModelIndex's internalPointer() method to get the pointer.
There must be a root item in the tree structure of the model which is the top level parent of all runner items. The root item has no parent item. It is never referenced outside the model but defines the number of columns and the column headers for the views attached to the model. Although the root item is automatically assigned a row number of 0, this information is never used by the model.
The model can run code in the runner items and observe their execution. Signals are fired to inform the environment about ongoing execution status. The current model implementation only executes code in items which have no children, but this could change in the future. Therefore the code in a runner item should check whether it is a parent or not. Only selected runner items get executed. Execution is strictly sequential, i.e. the first runner item found for execution in the tree structure is run, or if it has children these are run, then the next selected sibling item is run and so on.
Runner items get executed asynchronously in a separate thread allocated by RunnerModelThread. Stopping item execution is only possible in the moment between termination of a runner item and the start of the next one. The thread isn't stopped the 'hard way' by terminating it which is dangerous and discouraged in the Qt documentation. Instead a flag is set which indicates that the thread must stop. This flag is checked regularly in the method that drives item execution.
Data updates with RunnerModel::setData() are not possible during item execution. Although the code in runner items can do anything thinkable it is recommended to keep the code to a minimum and to forego lengthy operations because a running item can't be interrupted.
Due to the parallelism induced by the thread the item execution must be synchronized with clients that consume item execution related information. The GUI for example displays state information about item execution. If the items are executing faster in the thread than the GUI is able to upate its widgets in its own thread the information shown in the GUI won't be reasonable. Therefore the model waits after each executed item until the signals it emits are completely processed by the signal receivers.
The model can be set to minimal update mode. In this mode only a reduced amount of item data and execution state information is returned. It's up to clients to decide when this is useful. QxRunner uses minimal update mode to speed up item execution because not all item data must be updated in views for an executing runner item.
Data changes from the outside of the model with RunnerModel::setData() are allowed for the selected flag in column 0 only. Of course there occur data changes all the time during item execution but this happens behind the scenes.
The model name uniquely identifies a model which has its unique structure. It is used to identify the settings of a program using the model. Therefore it's not recommended to use a version number or other variable information as part of the model name. Furthermore it is essential that the model name can be part of a valid filename, i.e. no special characters must be used in the name.
The other columns, if any, can be used freely.