00001 /****************************************************************************************************** 00002 * (C) 2016 markummitchell@github.com. This file is part of Engauge Digitizer, which is released * 00003 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file * 00004 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. * 00005 ******************************************************************************************************/ 00006 00007 #include "FittingModel.h" 00008 #include "Logger.h" 00009 #include <QTableView> 00010 00011 const int COLUMN_POLYNOMIAL_TERMS = 1; 00012 00013 FittingModel::FittingModel () 00014 { 00015 } 00016 00017 FittingModel::~FittingModel() 00018 { 00019 } 00020 00021 QVariant FittingModel::data(const QModelIndex &index, int role) const 00022 { 00023 // LOG4CPP_DEBUG_S ((*mainCat)) << "FittingModel::data" 00024 // << " index=(row=" << index.row() << ",col=" << index.column() << ",role=" << role << ")=" 00025 // << " rows=" << rowCount() 00026 // << " cols=" << columnCount(); 00027 00028 if (role == Qt::BackgroundRole && 00029 index.row() == rowCount() - 1 && 00030 index.column() == COLUMN_POLYNOMIAL_TERMS) { 00031 00032 // Bottom right cell would be empty so we gray it out 00033 return QVariant::fromValue (QColor (Qt::lightGray)); 00034 } 00035 00036 // Standard behavior 00037 return QStandardItemModel::data (index, role); 00038 }