davidrhcp
5th May 2014, 16:48
Hi there i got my combo box working and showing all available network interfaces. however the gui keeps showing an extra combo box at the top left. i understand the code has added a new box, so i have tried to manipulate the code to recognize that the box should be the one i already made. unfortunately i seem to make the coding worse :/ any ideas
QComboBox *box = new QComboBox(this);
QList<QNetworkInterface> list = QNetworkInterface::allInterfaces();
foreach (QNetworkInterface iface, list)
{
ui->comboBox_Interface->addItem(iface.name());
}
QComboBox *box = new QComboBox(this);
QList<QNetworkInterface> list = QNetworkInterface::allInterfaces();
foreach (QNetworkInterface iface, list)
{
ui->comboBox_Interface->addItem(iface.name());
}