PDA

View Full Version : Network interface, combo box problem



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());
}

sulliwk06
5th May 2014, 17:07
Are you even using the new QComboBox you are making?

QComboBox *box = new QComboBox(this);
It looks like you are populating comboBox_Interface.
I would just take out the first line.