Skip to content

Commit

Permalink
[FIX] fixed the tic button toggling
Browse files Browse the repository at this point in the history
  • Loading branch information
azmat committed Feb 10, 2021
1 parent 5408a7c commit 8fa5dcd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
7 changes: 7 additions & 0 deletions src/gui/mzroll/eicwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,11 @@ void EicWidget::print(QPaintDevice* printer) {
render(&painter);
}

void EicWidget::showTicLine(bool f) {
_showTicLine = f;
optionTicChecked(f);
}

void EicWidget::contextMenuEvent(QContextMenuEvent * event)
{
event->ignore();
Expand Down Expand Up @@ -1843,9 +1848,11 @@ void EicWidget::contextMenuEvent(QContextMenuEvent * event)
QAction* o3 = options.addAction("Show TIC");
o3->setCheckable(true);
o3->setChecked(_showTicLine);

connect(o3, SIGNAL(toggled(bool)), SLOT(showTicLine(bool)));
connect(o3, SIGNAL(toggled(bool)), SLOT(replot()));


//TODO: Sahil, added this action while merging eicwidget
QAction* o31 = options.addAction("Show BIC");
o31->setCheckable(true);
Expand Down
7 changes: 3 additions & 4 deletions src/gui/mzroll/eicwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ public Q_SLOTS:
void showPeaks(bool f) {
_showPeaks = f;
}
void showTicLine(bool f) {
_showTicLine = f;
}
void showTicLine(bool f);
void showBicLine(bool f) { //TODO: Sahil Added while mergin eicWidget
_showBicLine=f;
}
Expand Down Expand Up @@ -192,7 +190,8 @@ public Q_SLOTS:
void peakMarkedEicWidget();
void groupSet(shared_ptr<PeakGroup>);
void compoundSet(Compound*);

void optionTicChecked(bool);

private:
EICLogic* eicParameters;
float _focusLineRt; // 0
Expand Down
10 changes: 4 additions & 6 deletions src/gui/mzroll/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4207,15 +4207,13 @@ QWidget* MainWindowWidgetAction::createWidget(QWidget *parent) {

QToolButton *btnShowTic = new QToolButton(parent);
btnShowTic->setCheckable(true);
btnShowTic->setChecked(false);
btnShowTic->setChecked(false);
btnShowTic->setIcon(QIcon(rsrcPath + "/tic.png"));
btnShowTic->setToolTip(tr("Show TICs"));
connect(btnShowTic, SIGNAL(toggled(bool)), mw->getEicWidget(),
SLOT(showTicLine(bool)));
connect(btnShowTic, SIGNAL(toggled(bool)), mw->getEicWidget(), SLOT(replot()));

connect(btnShowTic, &QToolButton::toggled, mw->getEicWidget(), &EicWidget::showTicLine);
connect(btnShowTic, SIGNAL(toggled(bool)), mw->getEicWidget(), SLOT(replot()));
connect(mw->getEicWidget(), &EicWidget::optionTicChecked, btnShowTic, &QToolButton::setChecked);
return btnShowTic;

}
else if (btnName == "btnShowBarplot") {

Expand Down

0 comments on commit 8fa5dcd

Please sign in to comment.