summaryrefslogtreecommitdiff
path: root/silx/gui/hdf5/NexusSortFilterProxyModel.py
diff options
context:
space:
mode:
authorAlexandre Marie <alexandre.marie@synchrotron-soleil.fr>2018-12-17 12:28:45 +0100
committerAlexandre Marie <alexandre.marie@synchrotron-soleil.fr>2018-12-17 12:28:45 +0100
commitc49572a2e90b398e90a43f86b490f27ee6c58de6 (patch)
treed130cf7dfc3cf73157e1bece8173331bb4bc7156 /silx/gui/hdf5/NexusSortFilterProxyModel.py
parent0bbc8ab933e62c1fa6d548e879ae6d98cbd461f1 (diff)
parentcebdc9244c019224846cb8d2668080fe386a6adc (diff)
Merge tag 'upstream/0.9.0+dfsg'
Upstream version 0.9.0+dfsg
Diffstat (limited to 'silx/gui/hdf5/NexusSortFilterProxyModel.py')
-rw-r--r--silx/gui/hdf5/NexusSortFilterProxyModel.py20
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