19 #include <variant_topic_tools/MessageVariable.h> 23 Q_DECLARE_METATYPE(variant_topic_tools::DataType)
31 MessageFieldItemModel::MessageFieldItemModel(QObject* parent) :
32 QAbstractItemModel(parent),
46 MessageDataType& dataType) {
52 if (dataType.isValid())
61 return variant_topic_tools::MessageDataType();
65 QString& field)
const {
73 return variant_topic_tools::DataType();
81 if (parent.column() <= 0) {
84 if (!parent.isValid())
97 if (parent.isValid()) {
99 parent.internalPointer());
113 if (index.isValid()) {
114 if ((role == Qt::DisplayRole) || (role == Qt::EditRole)) {
116 index.internalPointer());
127 QModelIndex&
parent)
const {
128 if (hasIndex(row, column, parent)) {
131 if (!parent.isValid())
140 return createIndex(row, column, childItem);
144 return QModelIndex();
148 if (index.isValid()) {
150 index.internalPointer());
156 return createIndex(parentItem->
getRow(), 0, parentItem);
160 return QModelIndex();
const QString & getName() const
virtual ~MessageFieldItemModel()
MessageFieldItem * getChild(size_t row) const
size_t getNumColumns() const
const variant_topic_tools::DataType & getDataType() const
QModelIndex index(int row, int column, const QModelIndex &parent) const
MessageFieldItem * getParent() const
size_t getNumChildren() const
MessageFieldItem * getDescendant(const QString &path) const
int columnCount(const QModelIndex &parent) const
MessageFieldItem * rootItem_
QModelIndex parent(const QModelIndex &index) const
void update(const QString &path)
int rowCount(const QModelIndex &parent) const
void update(const QString &path)
QVariant data(const QModelIndex &index, int role) const
variant_topic_tools::DataType getFieldDataType(const QString &field) const
void setMessageDataType(const variant_topic_tools::MessageDataType &dataType)
variant_topic_tools::MessageDataType getMessageDataType() const