def rowCount(self, parentIndex=QtCore.QModelIndex()):
        """ Returns the number of rows under the given parent. When the parent is valid it means
            that rowCount is returning the number of children of parent.

            Note: When implementing a table based model, rowCount() should return 0 when the parent
            is valid.
        """
        parentItem = self.getItem(parentIndex, altItem=self.invisibleRootItem)
        return parentItem.nChildren()
def rowCount ( self , parentIndex = QtCore . QModelIndex ( ) ) : parentItem = self . getItem ( parentIndex , altItem = self . invisibleRootItem ) return parentItem . nChildren ( )
Returns the number of rows under the given parent. When the parent is valid it means
            that rowCount is returning the number of children of parent.

            Note: When implementing a table based model, rowCount() should return 0 when the parent
            is valid.