The treemodel module#
This module implements TreeModel, which inherits from QAbstractItemModel and provides a model for a tree structure.
This can be used for debugging the tree using a Qt gui. See also the debug module.
- class TreeModel(tree, parent=None)[source]#
Bases:
QAbstractItemModelTreeModel implements QAbstractItemModel to show a parce tree in Qt widgets such as a QTreeView.
- CONTEXT_FLAGS = <PyQt5.QtCore.Qt.ItemFlags object>#
- TOKEN_FLAGS = <PyQt5.QtCore.Qt.ItemFlags object>#
- CONTEXT_FORMAT = '{name} at {pos} ({count})'#
- TOKEN_FORMAT = '{action} {text} at {pos} {group}'#
- CONTEXT_TOOLTIP = 'Context: {name}\nPos: {pos} - {end} (length: {length})\nChild count: {count}\nParent: {parent}\nParent-index: {index}'#
- TOKEN_TOOLTIP = 'Token: {text}\nPos: {pos} - {end} (length: {length})\nAction: {action}\nGroup: {group}\nParent: {parent}\nParent-index: {index}'#
- disconnect_builder(builder)[source]#
Disconnect from the started and finished signals of a TreeBuilder.
- connect_debugging_builder(builder)[source]#
Connect to all the signals of a debugging tree builder.
(See the
debugmodule).
- disconnect_debugging_builder(builder)[source]#
Disconnect from all the signals of a debugging tree builder.
(See the
debugmodule).
- TreeModel.index(self, int, int, parent: QModelIndex = QModelIndex()) -> QModelIndex[source]