QString转换成char * 的时候,一定要定义一个QBateArray的变量.不能连写 How can I convert a QString to char* and vice versa ?(trolltech)Answer:In order to convert a QString to a char*, then you first need to get a latin1 representation of the string by calling toLatin1() on…
字符串有如下几个操作符 QString提供了一个二元的"+"操作符用于组合两个字符串,并提供了一个"+="操作符用于将一个字符串追加到另一个字符串的末尾,例如: QString str1="welcome"; str1=str1+"to you !";//str1="welcome to you !" QString str2="hello ,"; str2+="world!&…