Skip to content
Snippets Groups Projects
Commit 2ca5d045 authored by Olivier Langella's avatar Olivier Langella
Browse files

background colors

parent f9d95989
No related branches found
No related tags found
No related merge requests found
......@@ -107,8 +107,8 @@ void ProteinTableModel::onProteinSearchEdit(QString protein_search_string) {
QModelIndex bottomRight = createIndex(rowCount(),columnCount());
emit dataChanged(topLeft, bottomRight);
_p_protein_list_window->updateStatusBar();
}
void ProteinTableModel::setIdentificationGroup(IdentificationGroup * p_identification_group) {
qDebug() << "ProteinTableModel::setIdentificationGroup begin " << p_identification_group->getProteinMatchList().size();
_p_identification_group = p_identification_group;
......@@ -177,6 +177,20 @@ QVariant ProteinTableModel::data(const QModelIndex &index, int role ) const {
}
}
break;
case Qt::BackgroundRole:
if (_p_identification_group->getProteinMatchList().at(row)->isValid() == false)
{
return QVariant(QColor("grey"));
}
if (_p_identification_group->getProteinMatchList().at(row)->getProteinXtpSp().get()->isDecoy() == true)
{
return QVariant(QColor("orange"));
}
if (_p_identification_group->getProteinMatchList().at(row)->getProteinXtpSp().get()->isContaminant() == true)
{
return QVariant(QColor("orange"));
}
break;
case Qt::DisplayRole:
if (_p_identification_group == nullptr) {
return QVariant();
......@@ -186,9 +200,9 @@ QVariant ProteinTableModel::data(const QModelIndex &index, int role ) const {
}
if (col == 1) {
pappso::GrpProtein * p_grp_prot = _p_identification_group->getProteinMatchList().at(row)->getGrpProteinSp().get();
if (p_grp_prot != nullptr) return p_grp_prot->getGroupingId();
return QVariant();
pappso::GrpProtein * p_grp_prot = _p_identification_group->getProteinMatchList().at(row)->getGrpProteinSp().get();
if (p_grp_prot != nullptr) return p_grp_prot->getGroupingId();
return QVariant();
}
if (col == 2) {
......@@ -252,7 +266,7 @@ bool ProteinTableModel::acceptRow(int source_row) {
}
}
if (protein_match->isValid()) {
return true;
//return true;
}
return false;
return true;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment