BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
JobPropertiesTableModel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Job/JobPropertiesTableModel.h
6 //! @brief Defines class JobPropertiesWidget
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_VIEW_JOB_JOBPROPERTIESTABLEMODEL_H
16 #define BORNAGAIN_GUI_VIEW_JOB_JOBPROPERTIESTABLEMODEL_H
17 
18 #include <QAbstractTableModel>
19 
20 class JobItem;
21 
22 
23 //! The JobPropertiesTableModel is a table model for the properties of a job except for the comment.
24 //! The name of the job is editable, all other fields are read only.
25 
26 class JobPropertiesTableModel : public QAbstractTableModel {
27  Q_OBJECT
28 public:
29  explicit JobPropertiesTableModel(QObject* parent = nullptr);
30  ~JobPropertiesTableModel() override;
31  int rowCount(const QModelIndex& parent = QModelIndex()) const override;
32  int columnCount(const QModelIndex& parent = QModelIndex()) const override;
33  QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
34  QVariant headerData(int section, Qt::Orientation orientation,
35  int role = Qt::DisplayRole) const override;
36  Qt::ItemFlags flags(const QModelIndex& index) const override;
37  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
38  void setItem(JobItem* item);
39 
40 private:
42 
43 private:
45 };
46 
47 #endif // BORNAGAIN_GUI_VIEW_JOB_JOBPROPERTIESTABLEMODEL_H
The JobPropertiesTableModel is a table model for the properties of a job except for the comment....
Qt::ItemFlags flags(const QModelIndex &index) const override
JobPropertiesTableModel(QObject *parent=nullptr)
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override