Code Documentation 3.5
Social Network Visualizer
Loading...
Searching...
No Matches
DialogImportAttributes Class Reference

Modal dialog that lets the user pick a CSV or JSON file and map its columns to graph node/edge identifiers before importing attributes. More...

#include <forms/dialogimportattributes.h>

Inheritance diagram for DialogImportAttributes:
Collaboration diagram for DialogImportAttributes:

Public Types

enum class  Scope { Nodes , Edges }
 

Public Member Functions

 DialogImportAttributes (Scope scope, bool isCSV, QWidget *parent=nullptr)
 
const TableImport::ParsedTableparsedTable () const
 
Nodes mapping results

Valid when scope == Nodes and the dialog was accepted.

int idColumn () const
 Index of the node-ID column in parsedTable().headers.
 
bool matchByLabel () const
 True → match by label; false → match by node number.
 
Edges mapping results

Valid when scope == Edges and the dialog was accepted.

int srcColumn () const
 Index of the source-node column.
 
int tgtColumn () const
 Index of the target-node column.
 

Private Slots

void onBrowse ()
 
void onAccepted ()
 

Private Member Functions

void loadFile (const QString &path)
 
void populatePreview ()
 
void populateColumnCombos ()
 

Private Attributes

const Scope m_scope
 
const bool m_isCSV
 
TableImport::ParsedTable m_table
 
QLabel * m_fileLabel
 
QTableWidget * m_previewTable
 
QComboBox * m_idCombo = nullptr
 
QRadioButton * m_byNumberRadio = nullptr
 
QRadioButton * m_byLabelRadio = nullptr
 
QComboBox * m_srcCombo = nullptr
 
QComboBox * m_tgtCombo = nullptr
 
QDialogButtonBox * m_buttonBox
 

Detailed Description

Modal dialog that lets the user pick a CSV or JSON file and map its columns to graph node/edge identifiers before importing attributes.

Usage:

true, // isCSV
parent);
if (dlg.exec() == QDialog::Accepted) {
graph->vertexAttributesImport(dlg.parsedTable().headers,
dlg.parsedTable().rows,
dlg.idColumn(),
dlg.matchByLabel());
}
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

Member Enumeration Documentation

◆ Scope

enum class DialogImportAttributes::Scope
strong
Enumerator
Nodes 
Edges 

Constructor & Destructor Documentation

◆ DialogImportAttributes()

DialogImportAttributes::DialogImportAttributes ( Scope  scope,
bool  isCSV,
QWidget *  parent = nullptr 
)
explicit

Member Function Documentation

◆ idColumn()

int DialogImportAttributes::idColumn ( ) const

Index of the node-ID column in parsedTable().headers.

◆ loadFile()

void DialogImportAttributes::loadFile ( const QString &  path)
private

◆ matchByLabel()

bool DialogImportAttributes::matchByLabel ( ) const

True → match by label; false → match by node number.

◆ onAccepted

void DialogImportAttributes::onAccepted ( )
privateslot

◆ onBrowse

void DialogImportAttributes::onBrowse ( )
privateslot

◆ parsedTable()

const TableImport::ParsedTable & DialogImportAttributes::parsedTable ( ) const
inline

Parsed file contents — valid only after the dialog is accepted.

◆ populateColumnCombos()

void DialogImportAttributes::populateColumnCombos ( )
private

◆ populatePreview()

void DialogImportAttributes::populatePreview ( )
private

◆ srcColumn()

int DialogImportAttributes::srcColumn ( ) const

Index of the source-node column.

◆ tgtColumn()

int DialogImportAttributes::tgtColumn ( ) const

Index of the target-node column.

Member Data Documentation

◆ m_buttonBox

QDialogButtonBox* DialogImportAttributes::m_buttonBox
private

◆ m_byLabelRadio

QRadioButton* DialogImportAttributes::m_byLabelRadio = nullptr
private

◆ m_byNumberRadio

QRadioButton* DialogImportAttributes::m_byNumberRadio = nullptr
private

◆ m_fileLabel

QLabel* DialogImportAttributes::m_fileLabel
private

◆ m_idCombo

QComboBox* DialogImportAttributes::m_idCombo = nullptr
private

◆ m_isCSV

const bool DialogImportAttributes::m_isCSV
private

◆ m_previewTable

QTableWidget* DialogImportAttributes::m_previewTable
private

◆ m_scope

const Scope DialogImportAttributes::m_scope
private

◆ m_srcCombo

QComboBox* DialogImportAttributes::m_srcCombo = nullptr
private

◆ m_table

TableImport::ParsedTable DialogImportAttributes::m_table
private

◆ m_tgtCombo

QComboBox* DialogImportAttributes::m_tgtCombo = nullptr
private

The documentation for this class was generated from the following files: