如何让QString和char互换
如何令QString跟char*互换?(How can I convert a QString to char* and vice versa ?(trolltech))
答:(Answer:)
要将QString换成char*,首先得要获得这个QString的latin1表示。可以通过调用QString.toLatin1()来得到表示成latin1的QByteArray对象。然后调用QByteArray.data()去获得指向储存在bytearray里面的数据的指针。(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 it which will return a QByteArray. Then call data() on the QByteArray to get a pointer to the data stored in the byte array. See the documentation:)
[......]

