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

using QCPbars

parent 62fe8978
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,6 @@
#include "../workerthread.h"
#include "../../core/labeling/labelingmethod.h"
#include "../../../utils/utils.h"
#include <qcustomplot.h>
......@@ -78,14 +77,7 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
//setLocale(QLocale(QLocale::English, QLocale::UnitedKingdom));
setFocusPolicy(Qt::ClickFocus);
QCPGraph * p_graph = ui->mass_histogram_widget->addGraph();
//p_graph->setName("raw xic");
//QPen pen;
//pen.setColor(getNewColors());
//graph()->setPen(pen);
//graph()->setName(lineNames.at(i-QCPGraph::lsNone));
p_graph->setLineStyle(QCPGraph::LineStyle::lsStepCenter);
//p_graph->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssDisc, 2.0));
_p_bars = new QCPBars(ui->mass_histogram_widget->xAxis, ui->mass_histogram_widget->yAxis);
#if QT_VERSION >= 0x050000
......@@ -310,10 +302,17 @@ void ProjectWindow::computeMassPrecision() {
y.push_back(mass_pair.second);
}
QCPGraph * p_graph = ui->mass_histogram_widget->graph();
p_graph->setData(x,y);
p_graph->rescaleAxes(true);
ui->mass_histogram_widget->rescaleAxes();
//delete _p_bars;
//_p_bars = new QCPBars(ui->mass_histogram_widget->xAxis, ui->mass_histogram_widget->yAxis);
_p_bars->clearData();
_p_bars->setWidth((x[0] - x[x.size()-1])/x.size());
_p_bars->setData(x, y);
_p_bars->rescaleAxes(true);
ui->mass_histogram_widget->yAxis->setRange(0, *std::max(y.begin(), y.end()));
ui->mass_histogram_widget->xAxis->setRange(x[0], x[x.size()-1]);
//QCPGraph * p_graph = ui->mass_histogram_widget->graph();
//p_graph->setData(x,y);
//ui->mass_histogram_widget->rescaleAxes();
ui->mass_histogram_widget->replot();
}
catch (pappso::PappsoException exception_pappso) {
......
......@@ -37,6 +37,7 @@
#include "../peptide_detail_view/peptidewindow.h"
#include "gui/project_view/automatic_filter_widget/automaticfilterwidget.h"
#include "../waiting_message_dialog/waitingmessagedialog.h"
#include <qcustomplot.h>
class MainWindow;
......@@ -131,6 +132,7 @@ private:
QStandardItemModel * _p_fasta_str_li;
std::vector<FastaFileSp> _fastafile_list;
WaitingMessageDialog * _p_waiting_message_dialog;
QCPBars *_p_bars;
};
......
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