From 20f9863c1d15fa4ea6d9ff5a6991a140c6a735d1 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 26 Dec 2017 18:31:44 +0100 Subject: Get rid of QSignalMapper mOpenTimesFSMapper and replace it with a lambda. --- shemov.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index 3aeec9d..fde5a0f 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -387,15 +387,12 @@ void SheMov::createActions(){ mPlaySelectedFSA = new QAction(tr("Play selected movies..."), this); connect(mPlaySelectedFSA, SIGNAL(triggered()), mFSWidget, SLOT(playSelected())); mOpenTimesFSAG = new QActionGroup(this); - mOpenTimesFSMapper = new QSignalMapper(this); for(int i = 2; i < 6; ++i){ QString actString = QString("Play %1 times...").arg(i); QAction *playTimesA = new QAction(actString, this); - mOpenTimesFSMapper->setMapping(playTimesA, i); - connect(playTimesA, SIGNAL(triggered()), mOpenTimesFSMapper, SLOT(map())); + connect(playTimesA, &QAction::triggered, [=] { mFSWidget->playSelectedRepeat(i); }); mOpenTimesFSAG->addAction(playTimesA); } - connect(mOpenTimesFSMapper, SIGNAL(mapped(int)), mFSWidget, SLOT(playSelectedRepeat(int))); mOpenTimesFSAG->addAction(createSeparator()); QString infiniteTimes = QString(tr("Play %1 times")).arg(QChar(0x221E)); // infinite mPlaySelectedInfTimesA = new QAction(infiniteTimes, this); -- cgit v1.2.3-70-g09d2