casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotMSPageHeaderDataModel.qo.h
Go to the documentation of this file.
1 #ifndef PLOTMSPAGEHEADERDATAMODEL_H_
2 #define PLOTMSPAGEHEADERDATAMODEL_H_
3 
4 #include <plotms/PlotMS/PlotMS.h>
5 #include <QAbstractTableModel>
6 
7 namespace casa {
8 
9 // A Qt Data Model for the table(view) displayed in PlotMS's page header
10 // Implements header items layout rules specifications:
11 // - 1. Layout header items in a 2-column table, in their command-line order,
12 // filling the table left to right first, then top to bottom ( "Z" order )
13 // - 2. Header items of a successive plot must be laid out starting from the
14 // the beginning of the next empty row
15 
16 class PlotMSPageHeaderDataModel : public QAbstractTableModel
17 {
18  Q_OBJECT
19 public:
20  static constexpr int physicalColumns = 3;
21  static constexpr int logicalColumns = 2;
22  PlotMSPageHeaderDataModel(PlotMSApp* app, QObject *parent=0);
23  int rowCount(const QModelIndex &parent = QModelIndex()) const ;
24  int columnCount(const QModelIndex &parent = QModelIndex()) const;
25  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
26  inline int lastColumnIndex() const { return physicalColumns -1 ; }
27  inline bool isLogicalColumn(int column) const;
28  inline int logicalColumn(int column) const;
29 
30 private:
32 };
33 
34 }
35 
36 
37 
38 
39 
40 #endif /* PLOTMSPAGEHEADERDATAMODEL_H_ */
PlotMSPageHeaderDataModel(PlotMSApp *app, QObject *parent=0)
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
bool isLogicalColumn(int column) const
Controller class for plotms.
Definition: PlotMS.h:55
A Qt Data Model for the table(view) displayed in PlotMS&#39;s page header Implements header items layout ...
int logicalColumn(int column) const
int rowCount(const QModelIndex &parent=QModelIndex()) const
int columnCount(const QModelIndex &parent=QModelIndex()) const