ich bin noch Recht neu in Qt4 und habe ein kleines Problem mit der Konvertierung von QString zu const char*.
Code: Alles auswählen
Config* cfg = Config::getInstance();
QString ip = cfg->getHostIP();
QString network = cfg->getNetwork();
QString filter = QString(
"(src host %1 and not dst net %2) or "
"(dst host %1 and not src net %2) or "
"port 53").arg(ip, network);
const char* filter_exp = filter.toAscii().constData();
Code: Alles auswählen
QByteArray filter = QString(
"(src host %1 and not dst net %2) or "
"(dst host %1 and not src net %2) or "
"port 53"
).arg(ip, network).toAscii();
const char* filter_exp = filter.constData();