summaryrefslogtreecommitdiff
path: root/src/plugins/scxmleditor/plugin_interface/attributeitemmodel.cpp
blob: c257f57669ad8d6d514bdf4d48c17a1303ff5c9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "attributeitemmodel.h"

using namespace ScxmlEditor::PluginInterface;

AttributeItemModel::AttributeItemModel(QObject *parent)
    : QAbstractTableModel(parent)
{
}

void AttributeItemModel::setTag(ScxmlTag *tag)
{
    beginResetModel();
    m_tag = tag;
    m_document = m_tag ? m_tag->document() : nullptr;
    endResetModel();
    emit layoutChanged();
    emit dataChanged(QModelIndex(), QModelIndex());
}

ScxmlTag *AttributeItemModel::tag() const
{
    return m_tag;
}