I use in my project QString but In some cases I have to transfer this to an external SDK, that expect null terminated const char*. For this I use:
QByteArray folderName = ((QDataItem*)(*it))->GetName().toUtf8();
folderName.append('\0');
dir.lpszDir = folderName;
Is casting the right way here? I assume I have to cast it with dynamic cast? Or is there a better way to bring the "GetName()" to a const char*?