mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
Replace deprecated QSignalMapper class
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
#include <QSignalMapper>
|
||||
#include <QTimer>
|
||||
|
||||
#include <libtorrent/session_status.hpp>
|
||||
@@ -89,18 +88,13 @@ SpeedWidget::SpeedWidget(PropertiesWidget *parent)
|
||||
m_graphsMenu->addAction(tr("Tracker Download"));
|
||||
|
||||
m_graphsMenuActions = m_graphsMenu->actions();
|
||||
m_graphsSignalMapper = new QSignalMapper(this);
|
||||
|
||||
for (int id = SpeedPlotView::UP; id < SpeedPlotView::NB_GRAPHS; ++id) {
|
||||
QAction *action = m_graphsMenuActions.at(id);
|
||||
action->setCheckable(true);
|
||||
action->setChecked(true);
|
||||
connect(action, &QAction::changed, m_graphsSignalMapper
|
||||
, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
|
||||
m_graphsSignalMapper->setMapping(action, id);
|
||||
connect(action, &QAction::changed, this, [this, id]() { onGraphChange(id); });
|
||||
}
|
||||
connect(m_graphsSignalMapper, static_cast<void (QSignalMapper::*)(int)>(&QSignalMapper::mapped)
|
||||
, this, &SpeedWidget::onGraphChange);
|
||||
|
||||
m_graphsButton = new ComboBoxMenuButton(this, m_graphsMenu);
|
||||
m_graphsButton->addItem(tr("Select Graphs"));
|
||||
|
||||
Reference in New Issue
Block a user