You can cast inline:
QObject::connect(comboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::highlighted), [&]()-> void {
insertWidgetToMapAndSend(listView);
});
But starting with Qt 5.7, use qOverload:
QObject::connect(comboBox, qOverload<int>(&QComboBox::highlighted), [&]()-> void {
insertWidgetToMapAndSend(listView);
});
or QOverload
in pre C++14:
QObject::connect(comboBox, QOverload<int>::of(&QComboBox::highlighted), [&]()-> void {
insertWidgetToMapAndSend(listView);
});