#include <qsegraphscansmodel.h>
|
| QseGraphScansModel (QseDataSet *dataSet, QTableView *table, 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 |
|
QModelIndex | indexOfScan (int n) |
|
Definition at line 9 of file qsegraphscansmodel.h.
QseGraphScansModel::QseGraphScansModel |
( |
QseDataSet * |
dataSet, |
|
|
QTableView * |
table, |
|
|
QObject * |
parent = 0 |
|
) |
| |
int QseGraphScansModel::columnCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
QVariant QseGraphScansModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role |
|
) |
| const |
Definition at line 194 of file qsegraphscansmodel.cpp.
References columnCount(), QseScan::columnCount(), m_DataSet, min(), QseDataSet::scan(), QseScan::scanColumnCountLine(), QseScan::scanColumnNamesLine(), QseScan::scanCommand(), and QseScan::scanDateLine().
196 if (!index.isValid()) {
200 int row = index.row();
201 int col = index.column();
206 case Qt::DisplayRole:
209 return scan -> name();
212 return scan -> maxRowCount();
230 case Qt::ToolTipRole:
232 const int maxlines = 15;
233 const int maxlength = 80;
240 QStringList hdr = scan -> header();
241 int nlines =
min(hdr.size(),maxlines);
242 for (
int i=0; i<nlines; i++) {
244 if (l.size()>maxlength) {
245 res += l.mid(0,maxlength) +
" ...\n";
250 if (hdr.size()>maxlines) {
256 if (l.size()>maxlength) {
257 res += l.mid(0,maxlength) +
" ...\n";
266 case Qt::SizeHintRole:
269 return QSize(200,15);
QseScan * scan(int n) const
QString scanDateLine() const
QString scanCommand() const
QString scanColumnNamesLine() const
int columnCount(const QModelIndex &parent=QModelIndex()) const
QString scanColumnCountLine() const
static int min(int a, int b)
QVariant QseGraphScansModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
Definition at line 293 of file qsegraphscansmodel.cpp.
295 if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
311 if (orientation == Qt::Vertical && role == Qt::DisplayRole) {
QModelIndex QseGraphScansModel::indexOfScan |
( |
int |
n | ) |
|
void QseGraphScansModel::operationCompleted |
( |
| ) |
|
|
slot |
Definition at line 31 of file qsegraphscansmodel.cpp.
References m_DataSet, m_PrevColumnCount, m_PrevRowCount, m_TableView, and scanSelected().
50 QItemSelectionModel *m =
m_TableView -> selectionModel();
53 m -> select(index(nrows-1,0),
54 QItemSelectionModel::Current | QItemSelectionModel::Rows |
55 QItemSelectionModel::Select);
58 ss.select(index(nrows-1,0),index(nrows-1,0));
60 QItemSelectionModel::Current | QItemSelectionModel::Rows |
61 QItemSelectionModel::Toggle);
73 QModelIndex topLeft = createIndex(0,0);
76 emit dataChanged(topLeft, botRight);
int QseGraphScansModel::rowCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
bool QseGraphScansModel::scanSelected |
( |
int |
s | ) |
|
|
private |
int QseGraphScansModel::m_PrevColumnCount |
|
mutableprivate |
int QseGraphScansModel::m_PrevRowCount |
|
mutableprivate |
QTableView* QseGraphScansModel::m_TableView |
|
private |
The documentation for this class was generated from the following files: