qstring to char*

qstring str = "Hello, World!"; char *cstr = new char[str.length() + 1]; std::strcpy(cstr, str.toStdString().c_str());