36 """ |
36 """ |
37 return min(1, QSortFilterProxyModel.columnCount(self, parent)) |
37 return min(1, QSortFilterProxyModel.columnCount(self, parent)) |
38 |
38 |
39 def filterAcceptsRow(self, sourceRow, sourceParent): |
39 def filterAcceptsRow(self, sourceRow, sourceParent): |
40 """ |
40 """ |
41 Protected method to determine, if the row is acceptable. |
41 Public method to determine, if the row is acceptable. |
42 |
42 |
43 @param sourceRow row number in the source model (integer) |
43 @param sourceRow row number in the source model (integer) |
44 @param sourceParent index of the source item (QModelIndex) |
44 @param sourceParent index of the source item (QModelIndex) |
45 @return flag indicating acceptance (boolean) |
45 @return flag indicating acceptance (boolean) |
46 """ |
46 """ |
47 idx = self.sourceModel().index(sourceRow, 0, sourceParent) |
47 idx = self.sourceModel().index(sourceRow, 0, sourceParent) |
48 return self.sourceModel().hasChildren(idx) |
48 return self.sourceModel().hasChildren(idx) |
49 |
49 |
50 def filterAcceptsColumn(self, sourceColumn, sourceParent): |
50 def filterAcceptsColumn(self, sourceColumn, sourceParent): |
51 """ |
51 """ |
52 Protected method to determine, if the column is acceptable. |
52 Public method to determine, if the column is acceptable. |
53 |
53 |
54 @param sourceColumn column number in the source model (integer) |
54 @param sourceColumn column number in the source model (integer) |
55 @param sourceParent index of the source item (QModelIndex) |
55 @param sourceParent index of the source item (QModelIndex) |
56 @return flag indicating acceptance (boolean) |
56 @return flag indicating acceptance (boolean) |
57 """ |
57 """ |