Cannot run TWO QListWidget in same function
Unsolved
General and Desktop
-
The attached TEST code snippet will not update TWO QListWidget in same function.
What is the reason for such behavior?
Is there a reasonable way to make it work ?
update and sleep does not work
#ifdef BYPASS
ui->list_2->insertItem(1,itemString);
ui->list_2->update();
//ui->list_2->insertItem(1,item);
ui->list_2->addItem(item);
ui->list_2->update();
#endif
//sleep(5);
// original add to bluetooth devices found list
ui->list->addItem(item);
ui->list->update(); -
@AnneRanch
Theupdate()
s won't have any visible effect. You will see the updates as & when you allow Qt to return to its event loop. If you uncomment thesleep(5)
you will not see any update during the sleep. You should never usesleep()
in a Qt UI application.