I haven't looked at all your code but are you sure that
Qt Code:
  1. printf("o %d\n", o);
To copy to clipboard, switch view to plain text mode 
prints to stdout and not the current console/shell/...?