![]() |
Code Documentation 3.5
Social Network Visualizer
|
Table model that caches node data from Graph and writes back via the Graph API. More...
#include <widgets/nodetablemodel.h>


Classes | |
| struct | NodeRow |
Public Member Functions | |
| NodeTableModel (QObject *parent=nullptr) | |
| void | populate (Graph *graph) |
Rebuilds the internal cache from graph. | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
Private Attributes | |
| Graph * | m_graph = nullptr |
| QList< NodeRow > | m_rows |
| QStringList | m_attrKeys |
Static Private Attributes | |
| static constexpr int | FIXED_COLS = 6 |
| static constexpr int | COL_NUMBER = 0 |
| static constexpr int | COL_LABEL = 1 |
| static constexpr int | COL_VISIBLE = 2 |
| static constexpr int | COL_SHAPE = 3 |
| static constexpr int | COL_SIZE = 4 |
| static constexpr int | COL_COLOR = 5 |
Table model that caches node data from Graph and writes back via the Graph API.
Fixed columns: #, Label, Visible, Shape, Size, Color. Dynamic columns: one per custom attribute key reported by the graph.
|
explicit |
|
override |
|
override |
|
override |
|
override |
| void NodeTableModel::populate | ( | Graph * | graph | ) |
Rebuilds the internal cache from graph.
Rebuilds the internal row cache from graph.
Calls beginResetModel() / endResetModel() so connected views repaint.
All vertices (enabled and disabled) are included; the Visible column reflects the vertex's enabled state. Custom attribute keys are taken from Graph::graphHasVertexCustomAttributes().
|
override |
|
override |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
private |
|
private |
|
private |