BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
importtableheader.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/dataloader/importtableheader.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_IMPORTTABLEHEADER_H
16 #define BORNAGAIN_GUI2_DATALOADER_IMPORTTABLEHEADER_H
17 
18 #include "darefl_export.h"
19 #include <QVariant>
20 #include <vector>
21 
22 namespace gui2 {
23 
24 struct ColumnInfo;
25 
26 //! Holds all data related to the content of utility rows in ImportTableModel.
27 
28 class DAREFLCORE_EXPORT ImportTableHeader {
29 public:
30  enum RowTypes { TYPE, UNITS, MULTIPLIER, MAX };
31  using header_data_t = std::vector<std::vector<QVariant>>;
32 
33  ImportTableHeader(int max_column_count);
34 
35  int rowCount() const;
36 
37  int columnCount() const;
38 
39  QVariant data(int row, int column) const;
40 
41  bool setData(int row, int column, const QVariant& variant);
42 
43  std::string rowName(int row) const;
44 
45  std::vector<ColumnInfo> columnInfo() const;
46 
47 private:
48  void init_data();
49  bool isValid(int row, int column) const;
50 
53 };
54 
55 } // namespace gui2
56 
57 #endif // BORNAGAIN_GUI2_DATALOADER_IMPORTTABLEHEADER_H
Holds all data related to the content of utility rows in ImportTableModel.
std::vector< std::vector< QVariant > > header_data_t
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20