BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
importtablewidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/dataloader/importtablewidget.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI2_DATALOADER_IMPORTTABLEWIDGET_H
16 #define BORNAGAIN_GUI2_DATALOADER_IMPORTTABLEWIDGET_H
17 
18 #include "darefl_export.h"
19 #include <QWidget>
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 class QTableView;
25 
26 namespace ModelView {
27 class ViewModelDelegate;
28 }
29 
30 namespace gui2 {
31 
32 struct ColumnInfo;
33 
34 class ImportTableModel;
35 
36 //! Contains table with imported data.
37 //! Belongs to LoaderPreviewPanel.
38 
39 class DAREFLCORE_EXPORT ImportTableWidget : public QWidget {
40  Q_OBJECT
41 
42 public:
43  ImportTableWidget(QWidget* parent = nullptr);
45 
46  void setRawData(const std::vector<std::vector<std::string>>& table_data);
47 
48  std::vector<ColumnInfo> columnInfo() const;
49 
50 private:
51  ImportTableModel* m_tableModel{nullptr};
52  QTableView* m_tableView{nullptr};
53  std::unique_ptr<ModelView::ViewModelDelegate> m_delegate;
54 };
55 
56 } // namespace gui2
57 
58 #endif // BORNAGAIN_GUI2_DATALOADER_IMPORTTABLEWIDGET_H
Model delegate to provide editing/painting for custom variants.
Table model to hold imported ASCII data after parsing it to multi-column presentation.
Contains table with imported data.
std::unique_ptr< ModelView::ViewModelDelegate > m_delegate
materialitems.h Collection of materials to populate MaterialModel.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20