BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
gui2::ImportTableWidget Class Reference

Contains table with imported data. More...

Inheritance diagram for gui2::ImportTableWidget:
[legend]
Collaboration diagram for gui2::ImportTableWidget:
[legend]

Public Member Functions

 ImportTableWidget (QWidget *parent=nullptr)
 
 ~ImportTableWidget ()
 
std::vector< ColumnInfocolumnInfo () const
 
void setRawData (const std::vector< std::vector< std::string >> &table_data)
 

Private Attributes

std::unique_ptr< ModelView::ViewModelDelegatem_delegate
 
ImportTableModelm_tableModel {nullptr}
 
QTableView * m_tableView {nullptr}
 

Detailed Description

Contains table with imported data.

Belongs to LoaderPreviewPanel.

Definition at line 39 of file importtablewidget.h.

Constructor & Destructor Documentation

◆ ImportTableWidget()

gui2::ImportTableWidget::ImportTableWidget ( QWidget *  parent = nullptr)

Definition at line 25 of file importtablewidget.cpp.

26  : QWidget(parent)
27  , m_tableModel(new ImportTableModel(this))
28  , m_tableView(new QTableView)
30 {
31  auto layout = new QVBoxLayout(this);
32  layout->setContentsMargins(0, 0, 0, 0);
33  layout->addWidget(m_tableView);
34 
35  m_tableView->setItemDelegate(m_delegate.get());
36  m_tableView->setModel(m_tableModel);
37 }
Model delegate to provide editing/painting for custom variants.
std::unique_ptr< ModelView::ViewModelDelegate > m_delegate
ImportTableModel * m_tableModel

References m_delegate, m_tableModel, and m_tableView.

◆ ~ImportTableWidget()

gui2::ImportTableWidget::~ImportTableWidget ( )
default

Member Function Documentation

◆ columnInfo()

std::vector< ColumnInfo > gui2::ImportTableWidget::columnInfo ( ) const

Definition at line 46 of file importtablewidget.cpp.

47 {
48  return m_tableModel->columnInfo();
49 }
std::vector< ColumnInfo > columnInfo() const

References gui2::ImportTableModel::columnInfo(), and m_tableModel.

Referenced by gui2::LoaderPreviewPanel::columnInfo().

Here is the call graph for this function:

◆ setRawData()

void gui2::ImportTableWidget::setRawData ( const std::vector< std::vector< std::string >> &  table_data)

Definition at line 41 of file importtablewidget.cpp.

42 {
43  m_tableModel->setRawData(table_data);
44 }
void setRawData(const raw_data_t &raw_data)
Sets content of the model.

References m_tableModel, and gui2::ImportTableModel::setRawData().

Referenced by gui2::LoaderPreviewPanel::clearPanel(), and gui2::LoaderPreviewPanel::showData().

Here is the call graph for this function:

Member Data Documentation

◆ m_delegate

std::unique_ptr<ModelView::ViewModelDelegate> gui2::ImportTableWidget::m_delegate
private

Definition at line 53 of file importtablewidget.h.

Referenced by ImportTableWidget().

◆ m_tableModel

ImportTableModel* gui2::ImportTableWidget::m_tableModel {nullptr}
private

Definition at line 51 of file importtablewidget.h.

Referenced by ImportTableWidget(), columnInfo(), and setRawData().

◆ m_tableView

QTableView* gui2::ImportTableWidget::m_tableView {nullptr}
private

Definition at line 52 of file importtablewidget.h.

Referenced by ImportTableWidget().


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