create files with abstract model class

This commit is contained in:
Thomas Peetz
2025-01-13 00:26:42 +01:00
committed by Thomas Peetz
parent 954dab289a
commit 3f0a37ff19
5 changed files with 59 additions and 9 deletions
+33
View File
@@ -0,0 +1,33 @@
from typing import List
from PyQt5.QtCore import QAbstractTableModel
from PySide6.QtCore import QModelIndex
from PySide6.QtGui import Qt
from gui.data_view import DataViewMeta
class DataViewModel(QAbstractTableModel):
def __init__(self):
super().__init__()
self.main_window = None
self._config = None
self._data = List[DataViewMeta]
def rowCount(self, parent = QModelIndex()):
return len(self._data)
def columnCount(self, parent = QModelIndex()):
return 0
def headerData(self, section, orientation, role = Qt.ItemDataRole.DisplayRole):
return None
def data(self, index, role = Qt.ItemDataRole.DisplayRole):
return None
def setData(self, index, value, role = Qt.ItemDataRole.EditRole):
return False
def flags(self, index):
return None