Convert that QString to QByteArray and use QByteArray::data() (remember that the returned pointer will be valid only while that QByteArray exists).