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

multi ptm peptide menu works ./src/xtpcpp !

parent c4bb6ded
No related branches found
No related tags found
No related merge requests found
......@@ -56,8 +56,10 @@ void PtmPeptideMenuQicon::paint(QPainter *painter, const QRect &rect, Qt::Alignm
}
PtmPeptideMenuQaction::PtmPeptideMenuQaction(PtmPeptideTableProxyModel * parent, const PtmGroupingExperiment * p_ptm_grouping_experiment, const PtmSampleScan * p_ptm_sample, const PeptideMatch * p_peptide_match):QAction(parent) {
PtmPeptideMenuQaction::PtmPeptideMenuQaction(PtmPeptideTableProxyModel * parent, const PtmGroupingExperiment * p_ptm_grouping_experiment, const PtmSampleScan * p_ptm_sample, PeptideMatch * p_peptide_match):QAction(parent) {
_p_ptm_peptide_table_proxy_model = parent;
_p_peptide_match = p_peptide_match;
this->setIcon(PtmPeptideMenuQicon(p_ptm_sample, p_peptide_match));
//this->setText(p_peptide_match->getPeptideXtpSp().get()->getSequence());
......@@ -78,9 +80,12 @@ PtmPeptideMenuQaction::PtmPeptideMenuQaction(PtmPeptideTableProxyModel * parent,
*/
#else
// Qt4 code
connect (this, SIGNAL(toggled(bool)), this,SLOT(doToggled(bool)));
connect (this, SIGNAL(triggered(bool)), this,SLOT(doTriggered(bool)));
#endif
}
void PtmPeptideMenuQaction::doTriggered(bool triggered) {
_p_ptm_peptide_table_proxy_model->getPtmPeptideListWindowP()->askPeptideDetailView(_p_peptide_match);
}
PtmPeptideMenuQaction::~PtmPeptideMenuQaction()
{
......@@ -98,6 +103,9 @@ PtmPeptideTableProxyModel::~PtmPeptideTableProxyModel()
{
}
PtmPeptideListWindow * PtmPeptideTableProxyModel::getPtmPeptideListWindowP() {
return _p_ptm_peptide_list_window;
}
bool PtmPeptideTableProxyModel::lessThan(const QModelIndex &left,
const QModelIndex &right) const
......@@ -150,8 +158,9 @@ void PtmPeptideTableProxyModel::onTableClicked(const QModelIndex &index)
if (sp_ptm_sample_scan.get()->getPeptideMatchList().size() == 1) {
_p_ptm_peptide_list_window->askPeptideDetailView(sp_ptm_sample_scan.get()->getPeptideMatchList().at(0));
}
this->showContextMenu(index);
else {
this->showContextMenu(index);
}
qDebug() << "PtmPeptideTableProxyModel::onTableClicked end " << index.row();
}
......@@ -57,10 +57,15 @@ class PtmPeptideMenuQaction: public QAction {
Q_OBJECT
public:
explicit PtmPeptideMenuQaction(PtmPeptideTableProxyModel * parent, const PtmGroupingExperiment * p_ptm_grouping_experiment, const PtmSampleScan * p_ptm_sample, const PeptideMatch * p_peptide_match);
explicit PtmPeptideMenuQaction(PtmPeptideTableProxyModel * parent, const PtmGroupingExperiment * p_ptm_grouping_experiment, const PtmSampleScan * p_ptm_sample, PeptideMatch * p_peptide_match);
~PtmPeptideMenuQaction();
public slots:
void doTriggered(bool triggered);
private:
PeptideMatch * _p_peptide_match;
PtmPeptideTableProxyModel * _p_ptm_peptide_table_proxy_model;
};
......@@ -70,6 +75,8 @@ class PtmPeptideTableProxyModel: public QSortFilterProxyModel
public:
PtmPeptideTableProxyModel(PtmPeptideListWindow * p_ptm_peptide_list_window, PtmPeptideTableModel* ptm_table_model_p);
~PtmPeptideTableProxyModel();
PtmPeptideListWindow * getPtmPeptideListWindowP();
public slots:
void onTableClicked(const QModelIndex &index);
......
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