Code Documentation 3.5
Social Network Visualizer
Loading...
Searching...
No Matches
dialogimportattributes.h
Go to the documentation of this file.
1
14#pragma once
15
16#include <QDialog>
17#include "../graph/io/table_import.h"
18
19class QComboBox;
20class QDialogButtonBox;
21class QLabel;
22class QRadioButton;
23class QTableWidget;
24
42class DialogImportAttributes : public QDialog
43{
44 Q_OBJECT
45public:
46 enum class Scope { Nodes, Edges };
47
48 explicit DialogImportAttributes(Scope scope, bool isCSV, QWidget *parent = nullptr);
49
51 const TableImport::ParsedTable &parsedTable() const { return m_table; }
52
58 int idColumn() const;
59 bool matchByLabel() const;
61
67 int srcColumn() const;
68 int tgtColumn() const;
70
71private slots:
72 void onBrowse();
73 void onAccepted();
74
75private:
76 void loadFile(const QString &path);
77 void populatePreview();
79
81 const bool m_isCSV;
82
84
85 // File selection
86 QLabel *m_fileLabel;
87
88 // Preview
89 QTableWidget *m_previewTable;
90
91 // Nodes mapping
92 QComboBox *m_idCombo = nullptr;
93 QRadioButton *m_byNumberRadio = nullptr;
94 QRadioButton *m_byLabelRadio = nullptr;
95
96 // Edges mapping
97 QComboBox *m_srcCombo = nullptr;
98 QComboBox *m_tgtCombo = nullptr;
99
100 QDialogButtonBox *m_buttonBox;
101};
Modal dialog that lets the user pick a CSV or JSON file and map its columns to graph node/edge identi...
Definition dialogimportattributes.h:43
QTableWidget * m_previewTable
Definition dialogimportattributes.h:89
QComboBox * m_srcCombo
Definition dialogimportattributes.h:97
void onAccepted()
Definition dialogimportattributes.cpp:164
const Scope m_scope
Definition dialogimportattributes.h:80
bool matchByLabel() const
True → match by label; false → match by node number.
Definition dialogimportattributes.cpp:247
QComboBox * m_tgtCombo
Definition dialogimportattributes.h:98
void onBrowse()
Definition dialogimportattributes.cpp:146
TableImport::ParsedTable m_table
Definition dialogimportattributes.h:83
Scope
Definition dialogimportattributes.h:46
const bool m_isCSV
Definition dialogimportattributes.h:81
int idColumn() const
Index of the node-ID column in parsedTable().headers.
Definition dialogimportattributes.cpp:242
QLabel * m_fileLabel
Definition dialogimportattributes.h:86
void loadFile(const QString &path)
Definition dialogimportattributes.cpp:173
QComboBox * m_idCombo
Definition dialogimportattributes.h:92
QDialogButtonBox * m_buttonBox
Definition dialogimportattributes.h:100
int srcColumn() const
Index of the source-node column.
Definition dialogimportattributes.cpp:252
QRadioButton * m_byLabelRadio
Definition dialogimportattributes.h:94
int tgtColumn() const
Index of the target-node column.
Definition dialogimportattributes.cpp:257
const TableImport::ParsedTable & parsedTable() const
Definition dialogimportattributes.h:51
QRadioButton * m_byNumberRadio
Definition dialogimportattributes.h:93
void populateColumnCombos()
Definition dialogimportattributes.cpp:214
void populatePreview()
Definition dialogimportattributes.cpp:195
In-memory representation of a parsed tabular file.
Definition table_import.h:37