A QWidget containing a QTabWidget with two tabs — Nodes and Edges — each backed by a sortable, searchable table view.
More...
#include <widgets/graphtablewidget.h>
|
| void | doExport (QAbstractItemModel *proxyModel, const QString &defaultName, bool csv) |
| | Opens a save dialog and writes proxyModel via TableExport.
|
| |
| void | doImport (bool forNodes, bool csv) |
| | Opens DialogImportAttributes and, on acceptance, calls the appropriate Graph import method then refreshes the table.
|
| |
A QWidget containing a QTabWidget with two tabs — Nodes and Edges — each backed by a sortable, searchable table view.
Call refresh() whenever the graph data changes and the panel is visible. The widget itself does not auto-refresh; the caller controls when to rebuild the cache.
◆ GraphTableWidget()
| GraphTableWidget::GraphTableWidget |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
Constructs the GraphTableWidget.
Builds both tabs (Nodes, Edges) with search bar, Refresh button, and a sortable/searchable QTableView backed by a QSortFilterProxyModel.
◆ doExport()
| void GraphTableWidget::doExport |
( |
QAbstractItemModel * |
proxyModel, |
|
|
const QString & |
defaultName, |
|
|
bool |
csv |
|
) |
| |
|
private |
Opens a save dialog and writes proxyModel via TableExport.
defaultName is used to suggest a filename ("nodes" or "edges"). csv selects CSV (true) or JSON (false) format.
◆ doImport()
| void GraphTableWidget::doImport |
( |
bool |
forNodes, |
|
|
bool |
csv |
|
) |
| |
|
private |
Opens DialogImportAttributes and, on acceptance, calls the appropriate Graph import method then refreshes the table.
forNodes true → import node attributes; false → import edge attributes. csv true → CSV format; false → JSON format.
◆ edgeModel()
| QAbstractItemModel * GraphTableWidget::edgeModel |
( |
| ) |
const |
Returns the raw (unfiltered) edge source model.
◆ exportEdgesCSV
| void GraphTableWidget::exportEdgesCSV |
( |
| ) |
|
|
slot |
Prompts for a file path and exports visible edge rows as CSV.
◆ exportEdgesJSON
| void GraphTableWidget::exportEdgesJSON |
( |
| ) |
|
|
slot |
Prompts for a file path and exports visible edge rows as JSON.
◆ exportNodesCSV
| void GraphTableWidget::exportNodesCSV |
( |
| ) |
|
|
slot |
Prompts for a file path and exports visible node rows as CSV.
◆ exportNodesJSON
| void GraphTableWidget::exportNodesJSON |
( |
| ) |
|
|
slot |
Prompts for a file path and exports visible node rows as JSON.
◆ exportStatusMessage
| void GraphTableWidget::exportStatusMessage |
( |
const QString & |
message | ) |
|
|
signal |
Emitted with a status message after an export attempt.
◆ importEdgesCSV
| void GraphTableWidget::importEdgesCSV |
( |
| ) |
|
|
slot |
Opens the column-mapping dialog and imports edge attributes from a CSV.
◆ importEdgesJSON
| void GraphTableWidget::importEdgesJSON |
( |
| ) |
|
|
slot |
Opens the column-mapping dialog and imports edge attributes from a JSON.
◆ importNodesCSV
| void GraphTableWidget::importNodesCSV |
( |
| ) |
|
|
slot |
Opens the column-mapping dialog and imports node attributes from a CSV.
◆ importNodesJSON
| void GraphTableWidget::importNodesJSON |
( |
| ) |
|
|
slot |
Opens the column-mapping dialog and imports node attributes from a JSON.
◆ importStatusMessage
| void GraphTableWidget::importStatusMessage |
( |
const QString & |
message | ) |
|
|
signal |
Emitted with a status message after an import attempt.
◆ nodeModel()
| QAbstractItemModel * GraphTableWidget::nodeModel |
( |
| ) |
const |
Returns the raw (unfiltered) node source model.
◆ nodeSelected
| void GraphTableWidget::nodeSelected |
( |
int |
number | ) |
|
|
signal |
Emitted when the user clicks a row in the Nodes tab.
◆ onNodeRowClicked
| void GraphTableWidget::onNodeRowClicked |
( |
const QModelIndex & |
proxyIndex | ) |
|
|
privateslot |
◆ refresh
| void GraphTableWidget::refresh |
( |
Graph * |
graph | ) |
|
|
slot |
Repopulates both the node and edge models from graph.
Repopulates both models from graph and resizes columns.
Stores a pointer to graph for subsequent Refresh button clicks.
◆ m_edgeModel
◆ m_edgeProxy
| QSortFilterProxyModel* GraphTableWidget::m_edgeProxy |
|
private |
◆ m_edgeSearch
| QLineEdit* GraphTableWidget::m_edgeSearch |
|
private |
◆ m_edgeView
| QTableView* GraphTableWidget::m_edgeView |
|
private |
◆ m_graph
| Graph* GraphTableWidget::m_graph = nullptr |
|
private |
◆ m_nodeModel
◆ m_nodeProxy
| QSortFilterProxyModel* GraphTableWidget::m_nodeProxy |
|
private |
◆ m_nodeSearch
| QLineEdit* GraphTableWidget::m_nodeSearch |
|
private |
◆ m_nodeView
| QTableView* GraphTableWidget::m_nodeView |
|
private |
◆ m_tabs
| QTabWidget* GraphTableWidget::m_tabs |
|
private |
The documentation for this class was generated from the following files: