diff --git a/src/gui/protein_list_view/proteintableproxymodel.cpp b/src/gui/protein_list_view/proteintableproxymodel.cpp index 3f5b2bb71b23eb7e5691e3101c270a2fe1c309b9..d1169018aeee231ac59299bf362393992dc1f11b 100644 --- a/src/gui/protein_list_view/proteintableproxymodel.cpp +++ b/src/gui/protein_list_view/proteintableproxymodel.cpp @@ -154,7 +154,7 @@ void ProteinTableProxyModel::onTableClicked(const QModelIndex &index) _p_protein_list_window->edited(); } else { - if ((col == 2)||(col == 3)) { + if ((col == (std::int8_t) ProteinListColumn::accession)||(col == (std::int8_t) ProteinListColumn::description)) { _p_protein_list_window->askProteinDetailView(p_protein_match); } else { diff --git a/src/gui/ptm_island_list_view/ptmislandlistwindow.cpp b/src/gui/ptm_island_list_view/ptmislandlistwindow.cpp index e2fba68303d11a8db546ef09a1fe7111c6d7f3db..699d5b0afb148919acb0e4dc95f8f404909abb5e 100644 --- a/src/gui/ptm_island_list_view/ptmislandlistwindow.cpp +++ b/src/gui/ptm_island_list_view/ptmislandlistwindow.cpp @@ -68,6 +68,7 @@ PtmIslandListWindow::PtmIslandListWindow(ProjectWindow *parent): connect (_project_window, SIGNAL(identificationPtmGroupGrouped(IdentificationGroup *)), this,SLOT(doIdentificationPtmGroupGrouped(IdentificationGroup *))); connect (_project_window, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), this,SLOT(doIdentificationGroupGrouped(IdentificationGroup *))); + connect(ui->ptm_island_tableview, SIGNAL(clicked(const QModelIndex &)), _ptm_table_model_p, SLOT(onTableClicked(const QModelIndex &))); #endif } diff --git a/src/gui/ptm_island_list_view/ptmislandproxymodel.cpp b/src/gui/ptm_island_list_view/ptmislandproxymodel.cpp index 7f7a3c034e496095c0b9b07e1b5b426e8ce5ea24..331995b8e52ceb9a0c39de45f97ce7c834692c0f 100644 --- a/src/gui/ptm_island_list_view/ptmislandproxymodel.cpp +++ b/src/gui/ptm_island_list_view/ptmislandproxymodel.cpp @@ -72,3 +72,27 @@ bool PtmIslandProxyModel::filterAcceptsRow(int source_row, //return true; } + + +void PtmIslandProxyModel::onTableClicked(const QModelIndex &index) +{ + qDebug() << "PtmIslandProxyModel::onTableClicked begin " << index.row(); + qDebug() << "PtmIslandProxyModel::onTableClicked begin " << this->mapToSource(index).row(); + + //_protein_table_model_p->onTableClicked(this->mapToSource(index)); + QModelIndex source_index(this->mapToSource(index)); + int row = source_index.row(); + int col = source_index.column(); + /* + ProteinMatch* p_protein_match = _p_ptm_island_table_model->getIdentificationGroup()->getProteinMatchList().at(row); + + if ((col == 2)||(col == 3)) { + _p_ptm_island_table_model->askPtmProteinDetailView(p_protein_match); + } + else { + _p_ptm_island_table_model->askPtmPeptideListView(p_protein_match); + } + */ + qDebug() << "PtmIslandProxyModel::onTableClicked end " << index.row(); + +} diff --git a/src/gui/ptm_island_list_view/ptmislandproxymodel.h b/src/gui/ptm_island_list_view/ptmislandproxymodel.h index f35e988ff22041b4438e701d0973281f19bdfc0a..c55ab77914f86b8e4f49c3ec3f8ac56526f0684b 100644 --- a/src/gui/ptm_island_list_view/ptmislandproxymodel.h +++ b/src/gui/ptm_island_list_view/ptmislandproxymodel.h @@ -45,6 +45,11 @@ public: ~PtmIslandProxyModel(); bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; + + +public slots: + void onTableClicked(const QModelIndex &index); + private: PtmIslandListWindow * _p_ptm_island_list_window; PtmIslandTableModel * _p_ptm_island_table_model; diff --git a/src/gui/ptm_island_list_view/ptmislandtablemodel.cpp b/src/gui/ptm_island_list_view/ptmislandtablemodel.cpp index 396fcff08788917b369cdb4d0d275758f78d43b2..893d35eba7500bd5344c58d186857b2d94161d5e 100644 --- a/src/gui/ptm_island_list_view/ptmislandtablemodel.cpp +++ b/src/gui/ptm_island_list_view/ptmislandtablemodel.cpp @@ -32,19 +32,6 @@ -PtmIslandTableModel::columnMap PtmIslandTableModel::_column_assignment = { - (std::int8_t)PtmIslandListColumn::ptm_island_id, - (std::int8_t)PtmIslandListColumn::accession, - (std::int8_t)PtmIslandListColumn::description, - (std::int8_t)PtmIslandListColumn::spectrum, - (std::int8_t)PtmIslandListColumn::sequence, - (std::int8_t)PtmIslandListColumn::ptm_position_list, - (std::int8_t)PtmIslandListColumn::multiptm, - (std::int8_t)PtmIslandListColumn::ptm_island_start, - (std::int8_t)PtmIslandListColumn::ptm_island_length -}; - - PtmIslandTableModel::PtmIslandTableModel(PtmIslandListWindow * p_ptm_island_list_window) { @@ -184,10 +171,10 @@ QVariant PtmIslandTableModel::headerData(int section, Qt::Orientation orientatio { 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; } @@ -204,7 +191,7 @@ QVariant PtmIslandTableModel::data(const QModelIndex &index, int role ) const { if (_p_identification_group == nullptr) { return QVariant(); } - switch (_column_assignment [col]) { + switch (col) { case (std::int8_t) PtmIslandListColumn::spectrum: return QVariant(getPtmGroupingExperiment()->getPtmIslandList().at(row).get()->getPtmIslandSubroup()->countSampleScan()); diff --git a/src/gui/ptm_island_list_view/ptmislandtablemodel.h b/src/gui/ptm_island_list_view/ptmislandtablemodel.h index d7e40067aea16cb510c22098a5ba93f861c48231..575b72479af5bd72063e155b22b0587e57b3e13d 100644 --- a/src/gui/ptm_island_list_view/ptmislandtablemodel.h +++ b/src/gui/ptm_island_list_view/ptmislandtablemodel.h @@ -40,16 +40,16 @@ * */ -enum class PtmIslandListColumn { - ptm_island_id, ///< ptm_island_id - accession, ///< protein accession - description, ///< protein description - ptm_position_list, ///< ptm position list - spectrum, ///< count sample scans - sequence, ///< unique sequence count - multiptm, ///< count multi ptm peptide match - ptm_island_start, ///< start position of the ptm island on the protein - ptm_island_length, ///< length of the ptm island +enum class PtmIslandListColumn: std::int8_t { + ptm_island_id=0, ///< ptm_island_id + accession=1, ///< protein accession + description=2, ///< protein description + ptm_position_list=3, ///< ptm position list + spectrum=4, ///< count sample scans + sequence=5, ///< unique sequence count + multiptm=6, ///< count multi ptm peptide match + ptm_island_start=7, ///< start position of the ptm island on the protein + ptm_island_length=8, ///< length of the ptm island }; @@ -74,8 +74,6 @@ public: const PtmGroupingExperiment * getPtmGroupingExperiment() const; - using columnMap = std::int8_t[20]; - public slots: void onPtmIslandDataChanged(); private : @@ -83,8 +81,6 @@ private : static const QString getDescription(std::int8_t column); private : IdentificationGroup * _p_identification_group=nullptr; - - static columnMap _column_assignment; }; #endif // PTMISLANDTABLEMODEL_H