Make line 11 read:
Qt Code:
  1. QVBoxLayout *layout = new QVBoxLayout(central);
To copy to clipboard, switch view to plain text mode 
and the warning should go away.

The access violation is probably related to the buffer pointer; using it while it is NULL, accessing the "buffer+1" memory location, or trying to use the storage for the buffer pointer itself after it goes out of scope.