#include <qsegraphscansmodel.h>


Public Slots | |
| void | dataChanged () |
Public Member Functions | |
| QseGraphScansModel (QseDataSet *dataSet, QObject *parent=0) | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| QVariant | data (const QModelIndex &index, int role) const |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
Private Types | |
| typedef QAbstractTableModel | inherited |
Private Attributes | |
| QseDataSet * | m_DataSet |
Definition at line 8 of file qsegraphscansmodel.h.
typedef QAbstractTableModel QseGraphScansModel::inherited [private] |
Definition at line 10 of file qsegraphscansmodel.h.
| QseGraphScansModel::QseGraphScansModel | ( | QseDataSet * | dataSet, | |
| QObject * | parent = 0 | |||
| ) |
Definition at line 6 of file qsegraphscansmodel.cpp.
00007 : QAbstractTableModel(parent), 00008 m_DataSet(dataSet) 00009 { 00010 connect(dataSet, SIGNAL(dataChanged()), 00011 this, SIGNAL(modelReset())); 00012 }
| int QseGraphScansModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() |
) | const |
Definition at line 20 of file qsegraphscansmodel.cpp.
References m_DataSet.
00021 { 00022 if (parent.column() > 0) { 00023 return 0; 00024 } 00025 00026 int res = m_DataSet -> scanCount(); 00027 00028 return res; 00029 }
| int QseGraphScansModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() |
) | const |
| QVariant QseGraphScansModel::data | ( | const QModelIndex & | index, | |
| int | role | |||
| ) | const |
Definition at line 38 of file qsegraphscansmodel.cpp.
References columnCount(), m_DataSet, and QseDataSet::scan().
00039 { 00040 if (!index.isValid()) { 00041 return QVariant(); 00042 } 00043 00044 int row = index.row(); 00045 int col = index.column(); 00046 00047 QseScan *scan = m_DataSet->scan(row); 00048 00049 switch (role) { 00050 case Qt::DisplayRole: 00051 switch (col) { 00052 case 0: 00053 return scan -> maxRowCount(); 00054 break; 00055 case 1: 00056 return scan -> columnCount(); 00057 break; 00058 case 2: 00059 return scan -> name(); 00060 break; 00061 default: 00062 return QVariant(); 00063 } 00064 break; 00065 00066 // case Qt::BackgroundRole: 00067 // return QColor(255,255,192); 00068 // break; 00069 00070 case Qt::ForegroundRole: 00071 return QBrush(Qt::red); 00072 break; 00073 00074 default: 00075 return QVariant(); 00076 } 00077 }

| QVariant QseGraphScansModel::headerData | ( | int | section, | |
| Qt::Orientation | orientation, | |||
| int | role = Qt::DisplayRole | |||
| ) | const |
Definition at line 81 of file qsegraphscansmodel.cpp.
00082 { 00083 if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { 00084 switch (section) { 00085 case 0: 00086 return "NR"; 00087 break; 00088 case 1: 00089 return "NC"; 00090 break; 00091 case 2: 00092 return "Scan"; 00093 break; 00094 default: 00095 return QVariant(); 00096 } 00097 } 00098 00099 if (orientation == Qt::Vertical && role == Qt::DisplayRole) { 00100 return section; 00101 } 00102 00103 return QVariant(); 00104 }
| void QseGraphScansModel::dataChanged | ( | ) | [slot] |
QseDataSet* QseGraphScansModel::m_DataSet [private] |
1.5.5