1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor(nexus): replace deprecated QSignalMapper with lambda

This commit is contained in:
jenli669 2019-07-11 21:21:32 +02:00
parent 8a0197b37f
commit 8373e3abf3
No known key found for this signature in database
GPG Key ID: 8267F9F7C2BF7E5E
2 changed files with 1 additions and 6 deletions

View File

@ -138,9 +138,6 @@ void Nexus::start()
quitAction->setMenuRole(QAction::QuitRole);
connect(quitAction, &QAction::triggered, qApp, &QApplication::quit);
windowMapper = new QSignalMapper(this);
connect(windowMapper, SIGNAL(mapped(QObject*)), this, SLOT(onOpenWindow(QObject*)));
retranslateUi();
#endif
showMainGUI();
@ -392,8 +389,7 @@ void Nexus::updateWindowsArg(QWindow* closedWindow)
QAction* action = windowActions->addAction(windowList[i]->title());
action->setCheckable(true);
action->setChecked(windowList[i] == activeWindow);
connect(action, SIGNAL(triggered()), windowMapper, SLOT(map()));
windowMapper->setMapping(action, windowList[i]);
connect(action, &QAction::triggered, [=] { onOpenWindow(windowList[i]);});
windowMenu->addAction(action);
dockMenu->insertAction(dockLast, action);
}

View File

@ -77,7 +77,6 @@ public slots:
private:
void updateWindowsArg(QWindow* closedWindow);
QSignalMapper* windowMapper;
QActionGroup* windowActions = nullptr;
#endif
signals: