mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop-widgets: replace QSignalMapper for set_deco_mode
QSignalMapper had a parameter convert problem, when mapping to set_deco_mode in plannerShared. Use lambda function in connect to avoid parameter convert problem. Signed-off-by: Jan Iversen <jan@casacondor.com>
This commit is contained in:
parent
f1bb2a81ca
commit
e2d568acc1
1 changed files with 3 additions and 4 deletions
|
@ -459,14 +459,13 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
|||
ui.rebreathermode->insertItems(0, rebreather_modes);
|
||||
|
||||
modeMapper = new QSignalMapper(this);
|
||||
connect(modeMapper, SIGNAL(mapped(int)) , plannerShared::instance(), SLOT(set_planner_deco_mode(int)));
|
||||
modeMapper->setMapping(ui.recreational_deco, int(RECREATIONAL));
|
||||
modeMapper->setMapping(ui.buehlmann_deco, int(BUEHLMANN));
|
||||
modeMapper->setMapping(ui.vpmb_deco, int(VPMB));
|
||||
|
||||
connect(ui.recreational_deco, SIGNAL(clicked()), modeMapper, SLOT(map()));
|
||||
connect(ui.buehlmann_deco, SIGNAL(clicked()), modeMapper, SLOT(map()));
|
||||
connect(ui.vpmb_deco, SIGNAL(clicked()), modeMapper, SLOT(map()));
|
||||
connect(ui.recreational_deco, &QAbstractButton::clicked, [=] { plannerShared::set_planner_deco_mode(RECREATIONAL); });
|
||||
connect(ui.buehlmann_deco, &QAbstractButton::clicked, [=] { plannerShared::set_planner_deco_mode(BUEHLMANN); });
|
||||
connect(ui.vpmb_deco, &QAbstractButton::clicked, [=] { plannerShared::set_planner_deco_mode(VPMB); });
|
||||
|
||||
connect(ui.lastStop, SIGNAL(toggled(bool)), plannerShared::instance(), SLOT(set_last_stop(bool)));
|
||||
connect(ui.lastStop, SIGNAL(toggled(bool)), this, SLOT(disableBackgasBreaks(bool)));
|
||||
|
|
Loading…
Add table
Reference in a new issue