create files with abstract model class
This commit is contained in:
committed by
Thomas Peetz
parent
954dab289a
commit
3f0a37ff19
@@ -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
|
||||
Reference in New Issue
Block a user