I am trying to use a textbox that searches as you type. I have written some basic code that works perfect for smaller list, but not for big ones. I just connect this to the test edits changed signal. Is there anything I can do to speed this up?
Qt Code:
int listWidgetSize = ui->listWidget->count(); for (int k1 = 0; k1 < listWidgetSize; k1++) { if (ui->listWidget->item(k1)->text().startsWith(searchText)) { ui->listWidget->item(k1)->setHidden(false) } else { ui->listWidget->item(k1)->setHidden(true); } }To copy to clipboard, switch view to plain text mode
Thanks guys!
Bookmarks