Use Qt5 connect syntax

This commit is contained in:
Chocobo1 2017-08-24 20:12:17 +08:00
parent b47c90f0e0
commit ccd3b305c2
No known key found for this signature in database
GPG key ID: 210D9C873253A68C

View file

@ -72,7 +72,8 @@ SpeedWidget::SpeedWidget(PropertiesWidget *parent)
m_periodCombobox->addItem(tr("30 Minutes"));
m_periodCombobox->addItem(tr("6 Hours"));
connect(m_periodCombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(onPeriodChange(int)));
connect(m_periodCombobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged)
, this, &SpeedWidget::onPeriodChange);
m_graphsMenu = new QMenu(this);
m_graphsMenu->addAction(tr("Total Upload"));
@ -93,10 +94,12 @@ SpeedWidget::SpeedWidget(PropertiesWidget *parent)
QAction *action = m_graphsMenuActions.at(id);
action->setCheckable(true);
action->setChecked(true);
connect(action, SIGNAL(changed()), m_graphsSignalMapper, SLOT(map()));
connect(action, &QAction::changed, m_graphsSignalMapper
, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
m_graphsSignalMapper->setMapping(action, id);
}
connect(m_graphsSignalMapper, SIGNAL(mapped(int)), this, SLOT(onGraphChange(int)));
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"));