diff options
author | Alexandre Marie <alexandre.marie@synchrotron-soleil.fr> | 2018-12-17 12:28:24 +0100 |
---|---|---|
committer | Alexandre Marie <alexandre.marie@synchrotron-soleil.fr> | 2018-12-17 12:28:24 +0100 |
commit | cebdc9244c019224846cb8d2668080fe386a6adc (patch) | |
tree | aedec55da0f9dd4fc4d6c7eb0f58489a956e2e8c /silx/gui/hdf5/NexusSortFilterProxyModel.py | |
parent | 159ef14fb9e198bb0066ea14e6b980f065de63dd (diff) |
New upstream version 0.9.0+dfsg
Diffstat (limited to 'silx/gui/hdf5/NexusSortFilterProxyModel.py')
-rw-r--r-- | silx/gui/hdf5/NexusSortFilterProxyModel.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/silx/gui/hdf5/NexusSortFilterProxyModel.py b/silx/gui/hdf5/NexusSortFilterProxyModel.py index 3f2cf8d..216e992 100644 --- a/silx/gui/hdf5/NexusSortFilterProxyModel.py +++ b/silx/gui/hdf5/NexusSortFilterProxyModel.py @@ -25,7 +25,7 @@ __authors__ = ["V. Valls"] __license__ = "MIT" -__date__ = "25/06/2018" +__date__ = "24/07/2018" import logging @@ -48,6 +48,24 @@ class NexusSortFilterProxyModel(qt.QSortFilterProxyModel): self.__split = re.compile("(\\d+|\\D+)") self.__iconCache = {} + def hasChildren(self, parent): + """Returns true if parent has any children; otherwise returns false. + + :param qt.QModelIndex parent: Index of the item to check + :rtype: bool + """ + parent = self.mapToSource(parent) + return self.sourceModel().hasChildren(parent) + + def rowCount(self, parent): + """Returns the number of rows under the given parent. + + :param qt.QModelIndex parent: Index of the item to check + :rtype: int + """ + parent = self.mapToSource(parent) + return self.sourceModel().rowCount(parent) + def lessThan(self, sourceLeft, sourceRight): """Returns True if the value of the item referred to by the given index `sourceLeft` is less than the value of the item referred to by |