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

connecting peptide list OK

parent 252e3a2f
No related branches found
No related tags found
No related merge requests found
......@@ -71,9 +71,11 @@ PeptideListWindow::~PeptideListWindow()
void PeptideListWindow::setProteinMatch(Project * p_project, ProteinMatch * p_protein_match) {
_peptide_table_model_p->setProteinMatch(p_project, p_protein_match);
_p_proxy_model->setSourceModel(_peptide_table_model_p);
ui->proteinLabel->setText(p_protein_match->getProteinXtpSp().get()->getDescription());
if (_p_protein_match != p_protein_match) {
_p_protein_match = p_protein_match;
_peptide_table_model_p->setProteinMatch(p_project, p_protein_match);
_p_proxy_model->setSourceModel(_peptide_table_model_p);
}
}
......@@ -54,6 +54,7 @@ private:
Ui::PeptideView *ui;
PeptideTableModel * _peptide_table_model_p = nullptr;
PeptideTableProxyModel * _p_proxy_model = nullptr;
ProteinMatch* _p_protein_match;
};
......
......@@ -84,8 +84,9 @@ void PeptideTableModel::setProteinMatch(Project * p_project, ProteinMatch * p_pr
QModelIndex topLeft = createIndex(0,0);
QModelIndex bottomRight = createIndex(rowCount(),columnCount());
emit dataChanged(topLeft, bottomRight);
emit dataChanged(topLeft, topLeft);
emit headerDataChanged(Qt::Horizontal, 0,3);
qDebug() << "PeptideTableModel::setProteinMatch end " ;
}
int PeptideTableModel::rowCount(const QModelIndex &parent ) const {
......
......@@ -83,7 +83,7 @@ void ProjectWindow::connectNewProteinListWindow() {
*/
#else
// Qt4 code
connect (_p_current_protein_list_window, SIGNAL(proteinMatchClicked(ProteinMatch *)), this,SLOT(doProteinMatchClicked(ProteinMatch *)));
connect (_p_current_protein_list_window, SIGNAL(proteinMatchClicked(ProteinMatch *)), this,SLOT(doViewPeptideList(ProteinMatch *)));
connect (_p_current_protein_list_window, SIGNAL(identificationGroupEdited(IdentificationGroup *)), this,SLOT(doIdentificationGroupEdited(IdentificationGroup *)));
connect (this, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), _p_current_protein_list_window,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
......@@ -93,6 +93,30 @@ void ProjectWindow::connectNewProteinListWindow() {
}
void ProjectWindow::connectNewPeptideListWindow() {
qDebug() << "ProjectWindow::connectNewPeptideListWindow begin";
_p_current_peptide_list_window = new PeptideListWindow(this);
_peptide_list_window_collection.push_back(_p_current_peptide_list_window);
#if QT_VERSION >= 0x050000
// Qt5 code
/*
connect(&workerThread, &QThread::finished, worker, &QObject::deleteLater);
connect(this, &PtSpectrumViewer::operateMsDataFile, worker, &PwizLoaderThread::doMsDataFileLoad);
connect(worker, &PwizLoaderThread::msDataReady, this, &PtSpectrumViewer::handleMsDataFile);
*/
#else
// Qt4 code
//connect (_p_current_peptide_list_window, SIGNAL(proteinMatchClicked(ProteinMatch *)), this,SLOT(doViewPeptideList(ProteinMatch *)));
connect (_p_current_peptide_list_window, SIGNAL(identificationGroupEdited(IdentificationGroup *)), this,SLOT(doIdentificationGroupEdited(IdentificationGroup *)));
connect (this, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), _p_current_peptide_list_window,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
#endif
qDebug() << "ProjectWindow::connectNewPeptideListWindow end";
}
void ProjectWindow::doIdentificationGroupEdited(IdentificationGroup * p_ident_group) {
qDebug() << "ProjectWindow::doIdentificationGroupEdited begin";
p_ident_group->startGrouping(_project_sp.get()->getGroupingType());
......@@ -103,10 +127,22 @@ void ProjectWindow::doIdentificationGroupEdited(IdentificationGroup * p_ident_gr
qDebug() << "ProjectWindow::doIdentificationGroupEdited end";
}
void ProjectWindow::doProteinMatchClicked(ProteinMatch * protein_match) {
PeptideListWindow * peptide_window = new PeptideListWindow(this);
peptide_window->setProteinMatch(_project_sp.get(), protein_match);
peptide_window->show();
void ProjectWindow::doViewPeptideList(ProteinMatch * protein_match) {
qDebug() << "ProjectWindow::doViewPeptideList begin";
if (_peptide_list_window_collection.size() == 0) {
connectNewPeptideListWindow();
}
Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
if (modifier == Qt::ControlModifier) {
connectNewPeptideListWindow();
}
_p_current_peptide_list_window->setProteinMatch(_project_sp.get(), protein_match);
_p_current_peptide_list_window->show();
qDebug() << "ProjectWindow::doViewPeptideList end";
}
void ProjectWindow::doViewProteinList(IdentificationGroup* p_identification_group) {
......
......@@ -27,6 +27,7 @@
#include <QMainWindow>
#include "../../core/project.h"
#include "../protein_list_view/proteinlistwindow.h"
#include "../peptide_list_view/peptidelistwindow.h"
class MainWindow;
......@@ -46,7 +47,7 @@ public:
public slots:
void doViewProteinList(IdentificationGroup* p_identification_group =nullptr);
void doProteinMatchClicked(ProteinMatch * protein_match);
void doViewPeptideList(ProteinMatch * protein_match);
void doIdentificationGroupEdited(IdentificationGroup * p_identification_group);
void setDefaultProteinListWindow(ProteinListWindow* p_protein_list_window);
// void setColor(const QColor &color);
......@@ -57,11 +58,14 @@ signals:
private :
void connectNewProteinListWindow();
void connectNewPeptideListWindow();
private:
Ui::ProjectView *ui;
MainWindow * main_window;
std::list <ProteinListWindow *> _protein_list_window_collection;
ProteinListWindow * _p_current_protein_list_window = nullptr;
std::list <PeptideListWindow *> _peptide_list_window_collection;
PeptideListWindow * _p_current_peptide_list_window = nullptr;
ProjectSp _project_sp;
......
......@@ -135,7 +135,7 @@ void ProteinTableModel::setIdentificationGroup(IdentificationGroup * p_identific
QModelIndex topLeft = createIndex(0,0);
QModelIndex bottomRight = createIndex(rowCount(),columnCount());
emit dataChanged(topLeft, bottomRight);
emit dataChanged(topLeft, topLeft);
emit headerDataChanged(Qt::Horizontal, 0,3);
}
......
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