10/7/2023 0 Comments Shortcut editor software![]() This makes writing the model easier and ensures that all model indexes that refer to the same item have the same internal data pointer. ![]() The use of a pointer-based tree structure means that, when passing a model index to a view, we can record the address of the corresponding item in the index (see QAbstractItemModel::createIndex()) and retrieve it later with QModelIndex::internalPointer(). For simplicity, we will use a list of QVariant objects to store the data for each column in the item. Since each item in a tree view usually contains several columns of data (a name and a shortcut in this example), it is natural to store this information in each item. Having this information readily available makes implementing the model easier. However, the root item in the tree structure has no parent item and it is never referenced outside the model.Įach ShortcutEditorModelItem contains information about its place in the tree structure it can return its parent item and its row number. Generally, each ShortcutEditorModelItem has a parent item, and can have a number of child items. The data is stored internally in the model using ShortcutEditorModelItem objects that are linked together in a pointer-based tree structure.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |