set header labels
@@ -34,6 +34,9 @@ def build_entity_index(sections: SectionDict) -> EntityIndex:
return entity_index
+HEADER_LABLES = ["Group Code", "Data Type", "Content", "4", "5"]
+
+
class DXFTagsModel(QAbstractTableModel):
def __init__(self, tags: Tags):
super().__init__()
@@ -49,6 +52,14 @@ class DXFTagsModel(QAbstractTableModel):
tag = self._tags[row]
return render_tag(tag, col)
+ def headerData(self, section: int, orientation: Qt.Orientation,
+ role: int = ...) -> Any:
+ if orientation == Qt.Horizontal:
+ if role == Qt.DisplayRole:
+ return HEADER_LABLES[section]
+ elif role == Qt.TextAlignmentRole:
+ return Qt.AlignLeft
+
def rowCount(self, parent: QModelIndex = ...) -> int:
return len(self._tags)
