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

fixed column numbers

parent 0cb2e536
No related branches found
No related tags found
No related merge requests found
......@@ -29,27 +29,6 @@
#include "../../core/labeling/label.h"
PeptideTableModel::columnMap PeptideTableModel::_column_assignment = {
(std::int8_t)PeptideListColumn::checked,
(std::int8_t)PeptideListColumn::peptide_grouping_id,
(std::int8_t)PeptideListColumn::sample,
(std::int8_t)PeptideListColumn::scan,
(std::int8_t)PeptideListColumn::rt,
(std::int8_t)PeptideListColumn::charge,
(std::int8_t)PeptideListColumn::sequence,
(std::int8_t)PeptideListColumn::modifs,
(std::int8_t)PeptideListColumn::label,
(std::int8_t)PeptideListColumn::start,
(std::int8_t)PeptideListColumn::length,
(std::int8_t)PeptideListColumn::used,
(std::int8_t)PeptideListColumn::subgroups,
(std::int8_t)PeptideListColumn::Evalue,
(std::int8_t)PeptideListColumn::theoretical_mhplus,
(std::int8_t)PeptideListColumn::delta_mhplus,
(std::int8_t)PeptideListColumn::hyperscore
};
PeptideTableModel::PeptideTableModel(QObject *parent)
:QAbstractTableModel(parent)
{
......@@ -94,10 +73,10 @@ QVariant PeptideTableModel::headerData(int section, Qt::Orientation orientation,
if (orientation == Qt::Horizontal) {
switch (role) {
case Qt::DisplayRole :
return QVariant(getTitle(_column_assignment [section]));
return QVariant(getTitle(section));
break;
case Qt::ToolTipRole :
return QVariant(getDescription(_column_assignment [section]));
return QVariant(getDescription(section));
break;
}
......@@ -138,7 +117,7 @@ QVariant PeptideTableModel::data(const QModelIndex &index, int role ) const {
pappso::GrpPeptide * p_grp_peptide;
const Label * p_label;
GroupingGroup * p_grp;
switch (_column_assignment[col]) {
switch (col) {
case (std::int8_t)PeptideListColumn::checked:
return QVariant();
break;
......@@ -239,6 +218,9 @@ void PeptideTableModel::onPeptideDataChanged() {
PeptideListColumn PeptideTableModel::getPeptideListColumn(std::int8_t column){
return static_cast<PeptideListColumn>(column);
}
const QString PeptideTableModel::getTitle(PeptideListColumn column) {
qDebug() << "PeptideTableModel::getTitle begin ";
return PeptideTableModel::getTitle((std::int8_t) column);
......
......@@ -31,24 +31,24 @@
*
*/
enum class PeptideListColumn {
checked, ///< manual checked
peptide_grouping_id, ///< manual checked
sample,
scan,
rt,
charge,
sequence,
modifs,
label,
start,
length,
used,
subgroups,
Evalue,
theoretical_mhplus,
delta_mhplus,
hyperscore
enum class PeptideListColumn: std::int8_t {
checked=0, ///< manual checked
peptide_grouping_id=1, ///< manual checked
sample=2,
scan=3,
rt=4,
charge=5,
sequence=6,
modifs=7,
label=8,
start=9,
length=10,
used=11,
subgroups=12,
Evalue=13,
theoretical_mhplus=14,
delta_mhplus=15,
hyperscore=16
};
class PeptideTableModel;
......@@ -65,10 +65,10 @@ public:
static const QString getTitle(PeptideListColumn column);
static const QString getDescription(PeptideListColumn column);
static PeptideListColumn getPeptideListColumn(std::int8_t column);
void setProteinMatch(ProteinMatch * p_protein_match);
ProteinMatch * getProteinMatch();
using columnMap = std::int8_t[30];
signals:
void peptideMatchClicked(PeptideMatch * p_peptide_match);
......@@ -82,7 +82,6 @@ private :
static const QString getDescription(std::int8_t column);
private :
ProteinMatch * _p_protein_match= nullptr;
static columnMap _column_assignment;
};
#endif // PEPTIDETABLEMODEL_H
......@@ -34,8 +34,8 @@ PeptideTableProxyModel::PeptideTableProxyModel(PeptideListWindow * p_peptide_lis
_p_peptide_list_window = p_peptide_list_window;
}
bool PeptideTableProxyModel::filterAcceptsColumn(int source_column, const QModelIndex & source_parent) const {
if (source_column == (std::int8_t)PeptideListColumn::label) {
bool PeptideTableProxyModel::filterAcceptsColumn(int source_column, const QModelIndex & source_parent) const {
if (_peptide_table_model_p->getPeptideListColumn(source_column) == PeptideListColumn::label) {
if (_p_peptide_list_window->getProjectWindow()->getProjectP()->getLabelingMethodSp().get() == nullptr) {
return false;
}
......
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