def filterAcceptsRow(self, row, parent=QModelIndex()): accepted = QSortFilterProxyModel.filterAcceptsRow(self, row, parent) if accepted and self.__filterFunc is not None: model = self.sourceModel() index = model.index(row, self.filterKeyColumn(), parent) return self.__filterFunc(index) else: return accepted
def filterAcceptsRow(self, sourceRow, sourceParent): index = self.sourceModel().index(sourceRow, 0, sourceParent) rowCount = self.sourceModel().rowCount(index) accepted = QSortFilterProxyModel.filterAcceptsRow(self, sourceRow, sourceParent) if rowCount > 0 and not accepted: for row in range(rowCount): if self.filterAcceptsRow(row, index): return True return accepted
def filterAcceptsRow(self, sourceRow, sourceParent): index = self.sourceModel().index(sourceRow, 0, sourceParent) rowCount = self.sourceModel().rowCount(index) accepted = QSortFilterProxyModel.filterAcceptsRow( self, sourceRow, sourceParent) if rowCount > 0 and not accepted: for row in range(rowCount): if self.filterAcceptsRow(row, index): return True return accepted
def filterAcceptsRow(self, sourceRow, sourceParent): """ Public method to determine, if the row is acceptable. @param sourceRow row number in the source model (integer) @param sourceParent index of the source item (QModelIndex) @return flag indicating acceptance (boolean) """ idx = self.sourceModel().index(sourceRow, 0, sourceParent) if self.sourceModel().hasChildren(idx): return True return QSortFilterProxyModel.filterAcceptsRow( self, sourceRow, sourceParent)
def filterAcceptsRow(self, sourceRow, sourceParent): """ Public method to determine, if the row is acceptable. @param sourceRow row number in the source model (integer) @param sourceParent index of the source item (QModelIndex) @return flag indicating acceptance (boolean) """ idx = self.sourceModel().index(sourceRow, 0, sourceParent) if self.sourceModel().hasChildren(idx): return True return QSortFilterProxyModel.filterAcceptsRow(self, sourceRow, sourceParent)
def filterAcceptsRow(self, source_row, source_parent): model = self.sourceModel() index = model.index(source_row, 0, source_parent) if index.isValid(): level, _, _ = model.messages[source_row] if level == 'debug' and not self.showDebugMessages: return False elif level == 'info' and not self.showInfoMessages: return False elif level == 'warning' and not self.showWarningMessages: return False elif level == 'error' and not self.showErrorMessages: return False return QSortFilterProxyModel.filterAcceptsRow(self, source_row, source_parent)