or you could do

Qt Code:
  1. QString foo("bar");
  2. char *baz = foo.toStdString().c_str()
To copy to clipboard, switch view to plain text mode