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:
parent
8a0197b37f
commit
8373e3abf3
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -77,7 +77,6 @@ public slots:
|
|||
private:
|
||||
void updateWindowsArg(QWindow* closedWindow);
|
||||
|
||||
QSignalMapper* windowMapper;
|
||||
QActionGroup* windowActions = nullptr;
|
||||
#endif
|
||||
signals:
|
||||
|
|
Loading…
Reference in New Issue
Block a user