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

set size policy in peptide details status bar

parent 17c07767
No related branches found
No related tags found
No related merge requests found
......@@ -97,13 +97,16 @@ PeptideWindow::PeptideWindow(ProjectWindow *parent)
_mz_label = new QLabel("");
_mz_label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
ui->statusbar->addWidget(_mz_label);
QWidget *p_spacer = new QWidget();
p_spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
ui->statusbar->addWidget(p_spacer);
_peak_label = new QLabel("");
_peak_label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
ui->statusbar->addWidget(_peak_label);
_ion_label = new QLabel("");
_ion_label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
ui->statusbar->addWidget(_ion_label);
ui->spectrum_widget->setMaximumIsotopeNumber(3);
......@@ -111,31 +114,48 @@ PeptideWindow::PeptideWindow(ProjectWindow *parent)
#if QT_VERSION >= 0x050000
// Qt5 code
connect(_p_project_window, &ProjectWindow::identificationGroupGrouped, this,
connect(_p_project_window,
&ProjectWindow::identificationGroupGrouped,
this,
&PeptideWindow::doIdentificationGroupGrouped);
connect(this, &PeptideWindow::loadSpectrumSp, worker,
connect(this,
&PeptideWindow::loadSpectrumSp,
worker,
&SpectrumSpLoaderThread::doLoadSpectrumSp);
connect(worker, &SpectrumSpLoaderThread::spectrumSpReady, this,
connect(worker,
&SpectrumSpLoaderThread::spectrumSpReady,
this,
&PeptideWindow::doSpectrumSpReady);
connect(ui->spectrum_widget, &pappso::SpectrumWidget::mzChanged, this,
connect(ui->spectrum_widget,
&pappso::SpectrumWidget::mzChanged,
this,
&PeptideWindow::setMz);
connect(ui->spectrum_widget, &pappso::SpectrumWidget::peakChanged, this,
connect(ui->spectrum_widget,
&pappso::SpectrumWidget::peakChanged,
this,
&PeptideWindow::setPeak);
connect(ui->spectrum_widget, &pappso::SpectrumWidget::ionChanged, this,
connect(ui->spectrum_widget,
&pappso::SpectrumWidget::ionChanged,
this,
&PeptideWindow::setIon);
#else
// Qt4 code
connect(_p_project_window,
SIGNAL(identificationGroupGrouped(IdentificationGroup *)), this,
SIGNAL(identificationGroupGrouped(IdentificationGroup *)),
this,
SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
connect(this, SIGNAL(loadSpectrumSp(PeptideMatch *)), worker,
connect(this,
SIGNAL(loadSpectrumSp(PeptideMatch *)),
worker,
SLOT(doLoadSpectrumSp(PeptideMatch *)));
connect(worker, SIGNAL(spectrumSpReady(pappso::SpectrumSp, QString, QString)),
this, SLOT(doSpectrumSpReady(pappso::SpectrumSp, QString, QString)));
connect(_p_spectrum_overlay, SIGNAL(mzChanged(double)), this,
SLOT(setMz(double)));
connect(worker,
SIGNAL(spectrumSpReady(pappso::SpectrumSp, QString, QString)),
this,
SLOT(doSpectrumSpReady(pappso::SpectrumSp, QString, QString)));
connect(
_p_spectrum_overlay, SIGNAL(mzChanged(double)), this, SLOT(setMz(double)));
// connect(_protein_table_model_p, SIGNAL(layoutChanged()), this,
// SLOT(updateStatusBar()));
#endif
......@@ -230,7 +250,8 @@ PeptideWindow::updateDisplay()
ui->mz_label->setText(
QString::number(_p_peptide_evidence->getPeptideXtpSp().get()->getMz(
_p_peptide_evidence->getCharge()),
'f', 4));
'f',
4));
ui->expmz_label->setText(
QString::number(_p_peptide_evidence->getExperimentalMz(), 'f', 4));
ui->delta_label->setText(
......@@ -242,13 +263,14 @@ PeptideWindow::updateDisplay()
}
catch(pappso::PappsoException exception_pappso)
{
QMessageBox::warning(this, tr("Unable to display peptide details :"),
QMessageBox::warning(this,
tr("Unable to display peptide details :"),
exception_pappso.qwhat());
}
catch(std::exception exception_std)
{
QMessageBox::warning(this, tr("Unable to display peptide details :"),
exception_std.what());
QMessageBox::warning(
this, tr("Unable to display peptide details :"), exception_std.what());
}
}
......@@ -259,9 +281,11 @@ PeptideWindow::chooseDefaultMzDataDir()
QSettings settings;
QString default_location = settings.value("path/mzdatadir", "").toString();
QString filename = QFileDialog::getExistingDirectory(
this, tr("Choose default mz data directory"), default_location,
QFileDialog::ShowDirsOnly);
QString filename =
QFileDialog::getExistingDirectory(this,
tr("Choose default mz data directory"),
default_location,
QFileDialog::ShowDirsOnly);
if(filename.isEmpty())
{
......@@ -307,7 +331,8 @@ PeptideWindow::openInXicViewer()
}
void
PeptideWindow::doSpectrumSpReady(pappso::SpectrumSp spectrum_sp, QString error,
PeptideWindow::doSpectrumSpReady(pappso::SpectrumSp spectrum_sp,
QString error,
QString fatal_error)
{
qDebug() << "PeptideWindow::doSpectrumSpReady begin error=" << error
......@@ -347,7 +372,8 @@ PeptideWindow::doSpectrumSpReady(pappso::SpectrumSp spectrum_sp, QString error,
// fatal_error
QMessageBox::warning(
this, tr("Oops! an error occurred in XTPCPP. Dont Panic :"),
this,
tr("Oops! an error occurred in XTPCPP. Dont Panic :"),
fatal_error);
ui->statusbar->showMessage(tr("ERROR reading spectrum"));
QSettings settings;
......@@ -436,9 +462,11 @@ PeptideWindow::doSaveSvg()
.arg(_p_peptide_evidence->getScan());
}
QString filename = QFileDialog::getSaveFileName(
this, tr("Save SVG file"), proposed_filename,
tr("Scalable Vector Graphic (*.svg)"));
QString filename =
QFileDialog::getSaveFileName(this,
tr("Save SVG file"),
proposed_filename,
tr("Scalable Vector Graphic (*.svg)"));
if(filename.isEmpty())
{
......@@ -449,8 +477,10 @@ PeptideWindow::doSaveSvg()
ui->spectrum_widget->toSvgFile(
filename, tr("%1 SVG spectrum generator").arg(SOFTWARE_NAME),
tr("This is an annotated SVG spectrum"), QSize(1200, 500));
filename,
tr("%1 SVG spectrum generator").arg(SOFTWARE_NAME),
tr("This is an annotated SVG spectrum"),
QSize(1200, 500));
// emit operateXpipFile(filename);
}
catch(pappso::PappsoException &error)
......
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