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:

Qt Code:
  1. // New style, C++11 and up version
  2.  
  3. QObject::connect(ui->list, //object
  4. &QListWidget::itemClicked, //signal
  5. ui->list_2, //object
  6. QOverload< QListWidgetItem * >::of( &QListWidget::addItem ) ); //slot
  7.  
  8.  
  9. // New style, C++14 and up version
  10.  
  11. QObject::connect(ui->list, //object
  12. &QListWidget::itemClicked, //signal
  13. ui->list_2, //object
  14. qOverload< QListWidgetItem * >( &QListWidget::addItem ) ); //slot
To copy to clipboard, switch view to plain text mode