QXRD  0.11.16
Public Member Functions | Private Attributes | List of all members
QcepIntegratedDataSpreadsheetModel Class Reference

#include <qcepintegrateddataspreadsheetmodel.h>

Inheritance diagram for QcepIntegratedDataSpreadsheetModel:
Inheritance graph
[legend]
Collaboration diagram for QcepIntegratedDataSpreadsheetModel:
Collaboration graph
[legend]

Public Member Functions

 QcepIntegratedDataSpreadsheetModel (QcepIntegratedDataWPtr integ)
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const
 
- Public Member Functions inherited from QcepSpreadsheetModel
 QcepSpreadsheetModel ()
 

Private Attributes

QcepIntegratedDataWPtr m_Integrated
 

Detailed Description

Definition at line 7 of file qcepintegrateddataspreadsheetmodel.h.

Constructor & Destructor Documentation

QcepIntegratedDataSpreadsheetModel::QcepIntegratedDataSpreadsheetModel ( QcepIntegratedDataWPtr  integ)

Definition at line 5 of file qcepintegrateddataspreadsheetmodel.cpp.

6  : m_Integrated(integ)
7 {
8 
9 }

Member Function Documentation

int QcepIntegratedDataSpreadsheetModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const

Definition at line 22 of file qcepintegrateddataspreadsheetmodel.cpp.

23 {
24  return 2;
25 }
QVariant QcepIntegratedDataSpreadsheetModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const

Definition at line 27 of file qcepintegrateddataspreadsheetmodel.cpp.

References m_Integrated.

28 {
29  QVariant res = QVariant();
30 
31  if (role == Qt::DisplayRole) {
32  if (index.isValid()) {
34 
35  if (integ) {
36  if (index.column() == 0) {
37  res = integ->x(index.row());
38  } else if (index.column() == 1) {
39  res = integ->y(index.row());
40  }
41  }
42  }
43  }
44 
45  return res;
46 }
QSharedPointer< QcepIntegratedData > QcepIntegratedDataPtr
QVariant QcepIntegratedDataSpreadsheetModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const

Definition at line 48 of file qcepintegrateddataspreadsheetmodel.cpp.

49 {
50  QVariant res = QVariant();
51 
52  if (role == Qt::DisplayRole) {
53  if (orientation == Qt::Horizontal) {
54  if (section == 0) {
55  res = "x";
56  } else if (section == 1) {
57  res = "y";
58  }
59  } else {
60  res = section;
61  }
62  }
63 
64  return res;
65 }
int QcepIntegratedDataSpreadsheetModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const

Definition at line 11 of file qcepintegrateddataspreadsheetmodel.cpp.

References m_Integrated.

12 {
14 
15  if (integ) {
16  return integ->size();
17  } else {
18  return 0;
19  }
20 }
QSharedPointer< QcepIntegratedData > QcepIntegratedDataPtr

Member Data Documentation

QcepIntegratedDataWPtr QcepIntegratedDataSpreadsheetModel::m_Integrated
private

Definition at line 18 of file qcepintegrateddataspreadsheetmodel.h.

Referenced by data(), and rowCount().


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