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

        :param index: Index.
        :type index: QModelIndex
        :return: Flags. ( Qt.ItemFlags )

def flags(self, index):
        """
        Reimplements the :meth:`QAbstractItemModel.flags` method.

        :param index: Index.
        :type index: QModelIndex
        :return: Flags. ( Qt.ItemFlags )
        """

        if not index.isValid():
            return Qt.NoItemFlags

        node = self.get_node(index)
        if index.column() == 0:
            return hasattr(node, "flags") and Qt.ItemFlags(node.flags) or Qt.NoItemFlags
        else:
            attribute = self.get_attribute(node, index.column())
            return attribute and hasattr(attribute, "flags") and Qt.ItemFlags(attribute.flags) or Qt.NoItemFlags