One way to initialize a QString is simply to pass a const char * to its constructor. For example, the following code creates a QString of size 5 containing the data "Hello":
QString str = "Hello";
QString converts the const char * data into Unicode using the [backcolor=#ffff00]fromUtf8()[/backcolor] function.
[static] QString QString::fromLocal8Bit(const char *str, int size = -1) Returns a QString initialized with the first size characters of the 8-bit string str. If size is -1 (default), it is taken to be strlen(str). [backcolor=#ffff00]QTextCodec::codecForLocale() is used to perform the conversion.[/backcolor]