There are 3 places in your code in which you pick an item at certain cell:
Qt Code:
  1. ...
  2. itemArchive = ui.tableWidget->item(row,0);
  3. ...
  4. itemRestore = ui.tableWidget->item(row,0);
  5. ...
  6. itemRestore = ui.tableWidget->item(row,0);
  7. ...
To copy to clipboard, switch view to plain text mode 
On the other hand, you have created an item only into cells (0,0), (1,0) and (2,0). If "row" is anything else than 0-2, you'll get a crash. This is most likely the case of yours.