Results 1 to 20 of 35

Thread: Big Problem search through huge amount of data ca 30 000 strings takes to long

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2015
    Posts
    67

    Default Big Problem search through huge amount of data ca 30 000 strings takes to long

    Hello,

    this is my Code:

    Qt Code:
    1. void SomeClass::searchIn_identifier_listWidget()
    2. {
    3. QList<Identifier*> tempList;
    4.  
    5. QString text0 = ui->identifier_lineEdit_search_0->text();
    6. QString text1 = ui->identifier_lineEdit_search_1->text();
    7. QString text2 = ui->identifier_lineEdit_search_2->text();
    8. QString text3 = ui->identifier_lineEdit_search_3->text();
    9. QString text4 = ui->identifier_lineEdit_search_4->text();
    10.  
    11. for (int i = 0; i < Storage::identifier.count(); i++) {
    12. if (Storage::identifier.at(i)->dataString.contains(text0,Qt::CaseInsensitive) &&
    13. Storage::identifier.at(i)->dataString.contains(text1,Qt::CaseInsensitive) &&
    14. Storage::identifier.at(i)->dataString.contains(text2,Qt::CaseInsensitive) &&
    15. Storage::identifier.at(i)->dataString.contains(text3,Qt::CaseInsensitive) &&
    16. Storage::identifier.at(i)->dataString.contains(text4,Qt::CaseInsensitive))
    17. {
    18. tempList << Storage::identifier.at(i);
    19. }
    20. }
    21.  
    22. ui->identifier_listWidget->clear();
    23. for (int i = 0; i < tempList.count(); i++) {
    24. QTest::qWait(1);
    25. listWidget_addItemPlusTooltip(ui->identifier_listWidget,tempList.at(i)->dataString);
    26. }
    27. }
    To copy to clipboard, switch view to plain text mode 

    So as you can see i want to search though someting in this case a QList and load the Strings into the ListWidget which match the search. The algorythm should stay like this I think. It takes like minutes until the Widget is filled with the new data. i have like 30 000 strings in this List. And all GUI should stay responsive to the user thats why the qWait is there. Maybe thats why it is so slow, but how can the GUI stay responsive without qwait?

    What can I do???

    Can somebody help me?

    edit: Without qwait the whole GUI in ther widget where this QListWidget is is locked. And it also takes like 1 minute to process all data into the QListWidget

    thx
    Last edited by Ini; 21st March 2016 at 03:22.

Similar Threads

  1. Replies: 9
    Last Post: 29th March 2011, 09:55
  2. QTextEdit loading takes long time
    By sreedhar in forum Qt Programming
    Replies: 12
    Last Post: 21st March 2011, 10:29
  3. Problem: the Application Takes very long time to build
    By Ma7moud El-Naggar in forum Qt Programming
    Replies: 5
    Last Post: 20th November 2010, 06:26
  4. [QTableWidget] clearing a big table takes so long!
    By punkypogo in forum Qt Programming
    Replies: 4
    Last Post: 5th August 2010, 13:52
  5. QImage::scaled takes long time
    By nrabara in forum Qt Programming
    Replies: 0
    Last Post: 15th December 2009, 12:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.