Reimplements the :meth:`QAbstractItemModel.rowCount` method.

        :param parent: Parent node.
        :type parent: AbstractCompositeNode or GraphModelNode
        :return: Row count.
        :rtype: int

def rowCount(self, parent=QModelIndex()):
        """
        Reimplements the :meth:`QAbstractItemModel.rowCount` method.

        :param parent: Parent node.
        :type parent: AbstractCompositeNode or GraphModelNode
        :return: Row count.
        :rtype: int
        """

        if not parent.isValid():
            parent_node = self.__root_node
        else:
            parent_node = parent.internalPointer()
        return parent_node.children_count()