Skip to content

Commit

Permalink
[FIX] fixed the show bar plot button toggling
Browse files Browse the repository at this point in the history
  • Loading branch information
azmat committed Feb 11, 2021
1 parent 8fa5dcd commit bf9862d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/gui/mzroll/eicwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,11 @@ void EicWidget::showTicLine(bool f) {
optionTicChecked(f);
}

void EicWidget::showBarPlot(bool f) {
_showBarPlot = f;
optionBarPlotChecked(f);
}

void EicWidget::contextMenuEvent(QContextMenuEvent * event)
{
event->ignore();
Expand Down
6 changes: 3 additions & 3 deletions src/gui/mzroll/eicwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ public Q_SLOTS:
f ? setCursor(Qt::SizeHorCursor) : setCursor(Qt::ArrowCursor);
}

void showBarPlot(bool f) {
_showBarPlot = f;
}
void showBarPlot(bool f);

void showBoxPlot(bool f) {
_showBoxPlot = f;
}
Expand Down Expand Up @@ -191,6 +190,7 @@ public Q_SLOTS:
void groupSet(shared_ptr<PeakGroup>);
void compoundSet(Compound*);
void optionTicChecked(bool);
void optionBarPlotChecked(bool);

private:
EICLogic* eicParameters;
Expand Down
3 changes: 2 additions & 1 deletion src/gui/mzroll/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4222,8 +4222,9 @@ QWidget* MainWindowWidgetAction::createWidget(QWidget *parent) {
btnShowBarplot->setToolTip(tr("Show bar-plot"));
btnShowBarplot->setCheckable(true);
btnShowBarplot->setChecked(true);
connect(btnShowBarplot,SIGNAL(toggled(bool)), mw->getEicWidget(), SLOT(showBarPlot(bool)));
connect(btnShowBarplot,&QToolButton::toggled, mw->getEicWidget(), &EicWidget::showBarPlot);
connect(btnShowBarplot,SIGNAL(toggled(bool)), mw->getEicWidget(), SLOT(replot()));
connect(mw->getEicWidget(), &EicWidget::optionBarPlotChecked, btnShowBarplot, &QToolButton::setChecked);
return btnShowBarplot;
}
else if (btnName == "btnShowIsotopeplot") {
Expand Down

0 comments on commit bf9862d

Please sign in to comment.