QByteArray bh = hostname.toLatin1(); QByteArray bp = password.toLatin1(); const char* cHostname = bh.data(); const char* cPassword = bp.data();