def parent(self, index): if not index.isValid(): return QModelIndex() item = index.internalPointer() if not isinstance(item, QtTreeViewItem) or item.is_destroyed: return QModelIndex() parent = item.parent() if not isinstance(parent, QtTreeViewItem) or item.is_destroyed: return QModelIndex() d = parent.declaration return self.createIndex(d.row, 0, parent)
def parent(self, index): parent = index.internalPointer() d = parent.declaration if d==self.declaration: return QModelIndex() #d = d.parent return self.createIndex(d.row,0,d.parent.proxy)
def rowCount(self, index=QModelIndex()): if not index.isValid(): return len(self.data_frame) return 0
def rowCount(self, index=QModelIndex()): if not index.isValid(): return self.cache.total_rows return 0
def columnCount(self, index=QModelIndex()): if not index.isValid(): return len(self.columns) return 0
def columnCount(self, index=QModelIndex()): if not index.isValid(): return len(self.data_frame.columns) else: return 0
def rowCount(self, index=QModelIndex()): if self.interface is None: return 0 return len(self.interface.get_rows())
def columnCount(self, index=QModelIndex()): if self.interface is None: return 0 return len(self.interface.get_columns())
def rowCount(self, index=QModelIndex()): if self._data is not None: return len(self._data) else: return 0
def columnCount(self, index=QModelIndex()): return len(self._columns)