summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-10-14 20:57:13 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-20 03:51:11 -0400
commitfdfcbd0315d04580bf10d7b9129fa32665dfeaae (patch)
tree8a7beb3796f6d6f4289c502ef95e31cf652351d3 /profile-widget
parent39c36af808047833cd6e4a9b7ab3567e41887766 (diff)
downloadsubsurface-fdfcbd0315d04580bf10d7b9129fa32665dfeaae.tar.gz
Cleanup: use pointer-to-member-function in addAction() calls
Since requiring Qt >= 5.9.1, we can use the pointer-to-member-function overloads of addAction (introduced in Qt 5.6). This has the advantage of compile-time checking of the signal/slot parameters. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/profilewidget2.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index bde470fd7..9389eaaeb 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -1432,10 +1432,10 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
return;
// create menu to show when right clicking on dive computer name
if (dc_number > 0)
- m.addAction(tr("Make first dive computer"), this, SLOT(makeFirstDC()));
+ m.addAction(tr("Make first dive computer"), this, &ProfileWidget2::makeFirstDC);
if (count_divecomputers(current_dive) > 1) {
- m.addAction(tr("Delete this dive computer"), this, SLOT(deleteCurrentDC()));
- m.addAction(tr("Split this dive computer into own dive"), this, SLOT(splitCurrentDC()));
+ m.addAction(tr("Delete this dive computer"), this, &ProfileWidget2::deleteCurrentDC);
+ m.addAction(tr("Split this dive computer into own dive"), this, &ProfileWidget2::splitCurrentDC);
}
m.exec(event->globalPos());
// don't show the regular profile context menu
@@ -1457,11 +1457,11 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
gasChange->addAction(action);
}
}
- QAction *setpointAction = m.addAction(tr("Add setpoint change"), this, SLOT(addSetpointChange()));
+ QAction *setpointAction = m.addAction(tr("Add setpoint change"), this, &ProfileWidget2::addSetpointChange);
setpointAction->setData(event->globalPos());
- QAction *action = m.addAction(tr("Add bookmark"), this, SLOT(addBookmark()));
+ QAction *action = m.addAction(tr("Add bookmark"), this, &ProfileWidget2::addBookmark);
action->setData(event->globalPos());
- QAction *splitAction = m.addAction(tr("Split dive into two"), this, SLOT(splitDive()));
+ QAction *splitAction = m.addAction(tr("Split dive into two"), this, &ProfileWidget2::splitDive);
splitAction->setData(event->globalPos());
const struct event *ev = NULL;
enum divemode_t divemode = UNDEF_COMP_TYPE;
@@ -1564,7 +1564,7 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
}
}
if (some_hidden) {
- action = m.addAction(tr("Unhide all events"), this, SLOT(unhideEvents()));
+ action = m.addAction(tr("Unhide all events"), this, &ProfileWidget2::unhideEvents);
action->setData(event->globalPos());
}
m.exec(event->globalPos());