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

only show label column if project has labeling method

parent ef3100bb
No related branches found
No related tags found
No related merge requests found
...@@ -102,7 +102,9 @@ PeptideListWindow::~PeptideListWindow() ...@@ -102,7 +102,9 @@ PeptideListWindow::~PeptideListWindow()
void PeptideListWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identification_group) { void PeptideListWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identification_group) {
} }
ProjectWindow * PeptideListWindow::getProjectWindow() {
return _project_window;
}
void PeptideListWindow::setProteinMatch(IdentificationGroup * p_identification_group, ProteinMatch * p_protein_match) { void PeptideListWindow::setProteinMatch(IdentificationGroup * p_identification_group, ProteinMatch * p_protein_match) {
if (_p_protein_match != p_protein_match) { if (_p_protein_match != p_protein_match) {
_p_identification_group = p_identification_group; _p_identification_group = p_identification_group;
......
...@@ -48,6 +48,7 @@ public: ...@@ -48,6 +48,7 @@ public:
~PeptideListWindow(); ~PeptideListWindow();
void setProteinMatch(IdentificationGroup * p_identification_group, ProteinMatch * p_protein_match); void setProteinMatch(IdentificationGroup * p_identification_group, ProteinMatch * p_protein_match);
void edited(); void edited();
ProjectWindow * getProjectWindow();
public slots: public slots:
//void peptideEdited(QString peptideStr); //void peptideEdited(QString peptideStr);
......
...@@ -26,12 +26,22 @@ ...@@ -26,12 +26,22 @@
#include "peptidetableproxymodel.h" #include "peptidetableproxymodel.h"
#include "peptidetablemodel.h" #include "peptidetablemodel.h"
#include "peptidelistwindow.h" #include "peptidelistwindow.h"
#include "../project_view/projectwindow.h"
PeptideTableProxyModel::PeptideTableProxyModel(PeptideListWindow * p_peptide_list_window, PeptideTableModel * peptide_table_model_p): QSortFilterProxyModel(peptide_table_model_p) PeptideTableProxyModel::PeptideTableProxyModel(PeptideListWindow * p_peptide_list_window, PeptideTableModel * peptide_table_model_p): QSortFilterProxyModel(peptide_table_model_p)
{ {
_peptide_table_model_p = peptide_table_model_p; _peptide_table_model_p = peptide_table_model_p;
_p_peptide_list_window = p_peptide_list_window; _p_peptide_list_window = p_peptide_list_window;
} }
bool PeptideTableProxyModel::filterAcceptsColumn(int source_column, const QModelIndex & source_parent) const {
if (source_column == 8) {
if (_p_peptide_list_window->getProjectWindow()->getProjectP()->getLabelingMethodSp().get() == nullptr) {
return false;
}
}
return true;
}
bool PeptideTableProxyModel::filterAcceptsRow(int source_row, bool PeptideTableProxyModel::filterAcceptsRow(int source_row,
const QModelIndex &source_parent) const { const QModelIndex &source_parent) const {
try { try {
...@@ -54,9 +64,9 @@ bool PeptideTableProxyModel::filterAcceptsRow(int source_row, ...@@ -54,9 +64,9 @@ bool PeptideTableProxyModel::filterAcceptsRow(int source_row,
return false; return false;
} }
unsigned int subgroup = _peptide_search_string.toUInt(); unsigned int subgroup = _peptide_search_string.toUInt();
return false; return false;
} else if (_search_on == "modification") { } else if (_search_on == "modification") {
return false; return false;
} }
} }
...@@ -144,10 +154,24 @@ bool PeptideTableProxyModel::lessThan(const QModelIndex & left, const QModelInde ...@@ -144,10 +154,24 @@ bool PeptideTableProxyModel::lessThan(const QModelIndex & left, const QModelInde
return leftData.toString() < rightData.toString(); return leftData.toString() < rightData.toString();
} }
QVariant PeptideTableProxyModel::headerData(int section, Qt::Orientation orientation,
int role) const { QVariant PeptideTableProxyModel::headerData(int section, Qt::Orientation orientation, int role) const
return sourceModel()->headerData(section, orientation, {
role); if (role == Qt::DisplayRole)
{
if (orientation == Qt::Horizontal) {
if (_p_peptide_list_window->getProjectWindow()->getProjectP()->getLabelingMethodSp().get() == nullptr) {
if (section > 7) {
section = section+1;
}
return sourceModel()->headerData(section, orientation, role);
}
else {
return sourceModel()->headerData(section, orientation, role);
}
}
}
return QVariant();
} }
void PeptideTableProxyModel::hideNotValid(bool hide) { void PeptideTableProxyModel::hideNotValid(bool hide) {
......
...@@ -38,6 +38,7 @@ public: ...@@ -38,6 +38,7 @@ public:
PeptideTableProxyModel(PeptideListWindow * p_peptide_list_window, PeptideTableModel* peptide_table_model_p); PeptideTableProxyModel(PeptideListWindow * p_peptide_list_window, PeptideTableModel* peptide_table_model_p);
bool filterAcceptsRow(int source_row, bool filterAcceptsRow(int source_row,
const QModelIndex &source_parent) const override; const QModelIndex &source_parent) const override;
bool filterAcceptsColumn(int source_column, const QModelIndex & source_parent) const override;
QVariant headerData(int section, Qt::Orientation orientation, QVariant headerData(int section, Qt::Orientation orientation,
int role) const override; int role) const override;
......
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