Im using QListWidget to show names as a type of dropdown when someone types entries in another QLineEdit field. It hits the database and shows all possibilities to choose from. As they type, the list changes, so I want it to delete all entries and re-fill the QListWidget.
When I call the following code, it indeed empties the QListWidget list, but the screen elements are still visible. Can someone help me figure out why they arent being removed from the display? Im using Qt 4.8.4. Thank you!
void myClass::clearListWidget()
{
QListWidget * lw = m_ui->db_listWidget;
while(lw->selectedItems().size())
{
delete lw->takeItem(0);
}
lw->update();
lw->repaint();
qApp->processEvents();
}