Return the flags for the given index

        This will call :meth:`TreeItem.flags` for valid ones.

        :param index: the index to query
        :type index: :class:`QtCore.QModelIndex`
        :returns: None
        :rtype: None
        :raises: None

def flags(self, index):
        """Return the flags for the given index

        This will call :meth:`TreeItem.flags` for valid ones.

        :param index: the index to query
        :type index: :class:`QtCore.QModelIndex`
        :returns: None
        :rtype: None
        :raises: None
        """
        if index.isValid():
            item = index.internalPointer()
            return item.flags(index)
        else:
            super(TreeModel, self).flags(index)