Engauge Digitizer
2
Loading...
Searching...
No Matches
Fitting
FittingModel.cpp
Go to the documentation of this file.
1
/******************************************************************************************************
2
* (C) 2016 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3
* under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4
* LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5
******************************************************************************************************/
6
7
#include "
FittingModel.h
"
8
#include "
Logger.h
"
9
#include <QTableView>
10
11
const
int
COLUMN_POLYNOMIAL_TERMS
= 1;
12
13
FittingModel::FittingModel
()
14
{
15
}
16
17
FittingModel::~FittingModel
()
18
{
19
}
20
21
QVariant
FittingModel::data
(
const
QModelIndex &index,
int
role)
const
22
{
23
// LOG4CPP_DEBUG_S ((*mainCat)) << "FittingModel::data"
24
// << " index=(row=" << index.row() << ",col=" << index.column() << ",role=" << role << ")="
25
// << " rows=" << rowCount()
26
// << " cols=" << columnCount();
27
28
if
(role == Qt::BackgroundRole &&
29
index.row() == rowCount() - 1 &&
30
index.column() ==
COLUMN_POLYNOMIAL_TERMS
) {
31
32
// Bottom right cell would be empty so we gray it out
33
return
QVariant::fromValue (QColor (Qt::lightGray));
34
}
35
36
// Standard behavior
37
return
QStandardItemModel::data (index, role);
38
}
COLUMN_POLYNOMIAL_TERMS
const int COLUMN_POLYNOMIAL_TERMS
Definition
FittingModel.cpp:11
FittingModel.h
Logger.h
FittingModel::FittingModel
FittingModel()
Single constructor.
Definition
FittingModel.cpp:13
FittingModel::~FittingModel
virtual ~FittingModel()
Definition
FittingModel.cpp:17
FittingModel::data
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Override for special processing.
Definition
FittingModel.cpp:21
Generated on
for Engauge Digitizer by
1.14.0