def rowCount(self, parent: PySide2.QtCore.QModelIndex = ...) -> int: if parent.column() > 0: return 0 if not parent.isValid(): parent_item = self.root_item else: parent_item = parent.internalPointer() return parent_item.children_count()
def data(self, index: PySide2.QtCore.QModelIndex, role: int = ...) -> typing.Any: if role == Qt.DisplayRole: if index.column() == 0: return index.row() else: fetcher = self.fetchers[index.column() - 1] media = self.playlist.media( index.row()) # type: QtMultimedia.QMediaContent path = media.canonicalUrl().toString() record = MockDomain.GetByPath(path) if record is None: # ruh uh print("Failed to lookup path: ", path) return fetcher(record)
def data(self, index: PySide2.QtCore.QModelIndex, role: int = ...) -> typing.Any: if role == Qt.DisplayRole: row, col = index.row(), index.column() ret = str(self.df.iloc[row, col]) else: ret = None return ret
def data(self, index: PySide2.QtCore.QModelIndex, role: int = ...) -> Any: if not index.isValid(): return None row = index.row() col = index.column() if role == Qt.DisplayRole: return self._get_column_text(row, col) else: return None
def data(self, index: PySide2.QtCore.QModelIndex, role: int = ...) -> typing.Any: if index.isValid() is False: return None if role != Qt.DisplayRole: return None item = index.internalPointer() return item.data(index.column())
def data(self, index: PySide2.QtCore.QModelIndex, role: int = ...) -> typing.Any: if role == Qt.DisplayRole: record = ParentDir.query.limit(1).offset( index.row()).first() # type: ParentDir if index.column() == 0: return record.id else: return record.path
def data(self, index:PySide2.QtCore.QModelIndex, role:int=...) -> Any: if not index.isValid(): return None row = index.row() if row >= len(self.instance.traces): return None col = index.column() if role == Qt.DisplayRole: return self._get_column_text(self.instance.traces[row], col) else: return None
def data(self, index: PySide2.QtCore.QModelIndex, role: int = ...) -> Any: if not index.isValid(): return None row = index.row() reg = self._filtered_register_list()[row] col = index.column() if role == Qt.DisplayRole: return self._get_column_text(reg, col) elif role == Qt.ForegroundRole: return QBrush(Qt.red) if self._did_data_change(reg) else None else: return None
def data(self, index: PySide2.QtCore.QModelIndex, role: int = ...) -> typing.Any: if not index.isValid(): return None row = index.row() if row >= len(self.targets): return None target = self.targets[row] col = index.column() if role == Qt.DisplayRole: return self._get_column_text(target, col) return None
def data(self, index: PySide2.QtCore.QModelIndex, role: int = ...): if not index.isValid(): return None node = index.internalPointer() if role == Qt.DisplayRole: column = index.column() if column == 0: return node.value.timestamp elif column == 1: return node.value.server elif column == 2: return node.value.source elif column == 3: return len(node.value.packets)
def data(self, index: PySide2.QtCore.QModelIndex, role: int = ...) -> Any: if not index.isValid(): return None row = index.row() if row >= len(self.log): return None log = self.log[row] col = index.column() if role == Qt.DisplayRole: return self._get_column_text(log, col) elif role == Qt.DecorationRole and col == QLogTableModel.COL_ICON: return self._get_column_icon(log) return None
def data(self, index: PySide2.QtCore.QModelIndex, role: int = ...): if not index.isValid(): return None node = index.internalPointer() if role == Qt.DisplayRole: column = index.column() if column == 0: return self.name_resolver.get(node, '../../../../../../server').value elif column == 1: return node.value.code elif column == 2: return self.name_resolver.get(node, './content').class_name elif column == 3: return self.name_resolver.get(node, './content/content').class_name