Hi I am bit new to QT programming. I am working on server proxy related module where I need to store the result into the combobox. Here goes the example:
QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::systemProxyForQuery(npq);
{
qDebug() << "ProxyHostName_IP: " << loopItem.hostName();
qDebug()<< "Port: " << loopItem.port();
ui->comb_conf_box->addItem(loopItem.hostName()); //combo box for Host name IP
ui->comb_port_box->addItem(loopItem.port()); // combo box for POrt
}
QNetworkProxyQuery npq(QUrl(QLatin1String("http://www.google.com")));
QList<QNetworkProxy> listOfProxies = QNetworkProxyFactory::systemProxyForQuery(npq);
foreach ( QNetworkProxy loopItem, listOfProxies )
{
qDebug() << "ProxyHostName_IP: " << loopItem.hostName();
qDebug()<< "Port: " << loopItem.port();
ui->comb_conf_box->addItem(loopItem.hostName()); //combo box for Host name IP
ui->comb_port_box->addItem(loopItem.port()); // combo box for POrt
}
To copy to clipboard, switch view to plain text mode
I am able to receive Host Name IP but Port number doesnt appear. Please help!!!
Eroor thrown is: Invalid conversion from quint16 to const char*
Bookmarks