This is because there are two QListWidget::addItem() methods, and the compiler doesn't know which one you want to use. So you have to be explicit in these cases, and there are two versions, one which works in C++11 or newer, then other requires C++14 or newer:
// New style, C++11 and up version
QObject::connect(ui
->list,
//object &QListWidget::itemClicked, //signal
ui->list_2, //object
// New style, C++14 and up version
QObject::connect(ui
->list,
//object &QListWidget::itemClicked, //signal
ui->list_2, //object
// New style, C++11 and up version
QObject::connect(ui->list, //object
&QListWidget::itemClicked, //signal
ui->list_2, //object
QOverload< QListWidgetItem * >::of( &QListWidget::addItem ) ); //slot
// New style, C++14 and up version
QObject::connect(ui->list, //object
&QListWidget::itemClicked, //signal
ui->list_2, //object
qOverload< QListWidgetItem * >( &QListWidget::addItem ) ); //slot
To copy to clipboard, switch view to plain text mode
Bookmarks