use new signals slots syntax
This commit is contained in:
@@ -36,10 +36,10 @@ HeaderBar::HeaderBar(QWidget* parent)
|
||||
layout->addWidget(btn);
|
||||
m_speedButtons.push_back(btn);
|
||||
mapper->setMapping(btn, i);
|
||||
connect(btn, SIGNAL(clicked()), mapper, SLOT(map()));
|
||||
connect(btn, &QPushButton::clicked, mapper, qOverload<>(&QSignalMapper::map));
|
||||
}
|
||||
connect(mapper, SIGNAL(mapped(int)), this, SLOT(onSpeedButton(int)));
|
||||
|
||||
connect(mapper, qOverload<int>(&QSignalMapper::mapped), this, &HeaderBar::onSpeedButton);
|
||||
|
||||
setFixedHeight(sizeHint().height());
|
||||
}
|
||||
|
||||
@@ -70,3 +70,4 @@ void HeaderBar::onSpeedButton(int index)
|
||||
emit speedChanged(kSpeeds[index]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user