1 #ifndef GUI_GRAPH_MODEL_H_
2 #define GUI_GRAPH_MODEL_H_
6 #include <QAbstractItemModel>
11 #include "graph_model_item.h"
44 QVariant
data(
const QModelIndex &
index,
int role)
const;
47 QModelIndex
index(
int row,
int column,
const QModelIndex &
parent = QModelIndex())
const;
50 QModelIndex
parent(
const QModelIndex &index)
const;
53 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
56 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
59 QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const;
65 std::map<std::string, GraphModelItem*>
items;
Definition: graph_model.h:36
QVariant data(const QModelIndex &index, int role) const
Overloads of functions required for QAbstractItemModel interface.
Definition: graph_model.cc:14
QModelIndex parent(const QModelIndex &index) const
Provides the parent for a given index.
Definition: graph_model.cc:44
int rowCount(const QModelIndex &parent=QModelIndex()) const
Number of rows.
Definition: graph_model.cc:58
Definition: graph_model_item.h:22
int columnCount(const QModelIndex &parent=QModelIndex()) const
Number of columns.
Definition: graph_model.cc:72
GraphModelItem * root_item_
Root Item for the data model. This is a no-use item.
Definition: graph_model.h:69
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Provides header to use.
Definition: graph_model.cc:81
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Provides the index for a specific position in the model.
Definition: graph_model.cc:26
std::map< std::string, GraphModelItem * > items
List of nodes that are in this tree, indexed by name in this case that might change later (...
Definition: graph_model.h:65