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

finishinh xic viewer

parent 2e4a64c3
No related branches found
No related tags found
No related merge requests found
......@@ -648,6 +648,13 @@ void ProjectWindow::setProjectSp(ProjectSp project_sp) {
delete wItem;
}
if (_p_xic_window != nullptr) {
_p_xic_window->clear();
_p_xic_window->hide();
delete _p_xic_window;
_p_xic_window = nullptr;
}
qDebug() << " ProjectWindow::setProjectSp size=" << identification_list.size();
if (identification_list.size() == 1) {
ui->identifications_combobox->setVisible(false);
......@@ -768,9 +775,9 @@ void ProjectWindow::openInXicViewer(const PeptideEvidence * p_peptide_evidence)
if (_p_xic_window == nullptr) {
_p_xic_window = new XicWindow(this);
}
_p_xic_window->show();
_p_xic_window->addXic(p_peptide_evidence);
qDebug() << "ProjectWindow::openInXicViewer end";
}
......@@ -109,6 +109,11 @@ void XicBox::setXic(std::vector< pappso::XicSp> xic_sp_list) {
}
qDebug() << "XicBox::setXic xic_sp_list[i].size() " << xic_sp_list[i].get()->size();
ui->xic_widget->addXicSp(xic_sp_list[i]);
QString isotope_name = QString("+%1").arg(_isotope_mass_list[i].get()->getIsotopeNumber());
if (_isotope_mass_list[i].get()->getIsotopeRank() > 1) {
isotope_name = QString("+%1 [%2]").arg(_isotope_mass_list[i].get()->getIsotopeNumber()).arg(_isotope_mass_list[i].get()->getIsotopeRank());
}
ui->xic_widget->setName(xic_sp_list[i].get(), isotope_name);
if (_isotope_mass_list[i].get()->getIsotopeNumber() == 0) {
for (const PeptideEvidence * peptide_evidence:_peptide_evidence_list) {
......
......@@ -55,6 +55,16 @@ XicWindow::~XicWindow()
{
qDebug() << "XicWindow::~XicWindow";
}
void XicWindow::clear() {
QLayoutItem *wItem;
while (wItem = ui->xic_vertical_layout->layout()->takeAt(0)) {
wItem->widget()->setVisible(false);
ui->xic_vertical_layout->layout()->removeWidget(wItem->widget());
delete wItem->widget();
}
}
ProjectWindow * XicWindow::getProjectWindow() {
return _project_window;
}
......
......@@ -45,16 +45,18 @@ class XicBox;
class XicWindow: public QMainWindow {
Q_OBJECT
friend XicBox;
friend XicBox;
public:
explicit XicWindow(ProjectWindow * parent = 0);
~XicWindow();
void addXic(const PeptideEvidence * p_peptide_evidence);
pappso::PrecisionP getXicExtractPrecision() const;
void clear();
protected:
ProjectWindow * getProjectWindow();
void removeXicBox(XicBox * xic_box);
......
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