Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    [SOLVED] Fast search method

    General and Desktop
    2
    2
    519
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      Jyang772 last edited by

      Does Qt provide a fast way to search specific strings through multiple files containing hex data? If not, what algorithm is best suited for this kind of search?

      Right now I am using indexof.

      @

             if(temp.toHex().indexOf("564952555300") != -1){
      
             return item.name;
             qDebug() << "FOUND";
             qDebug() << filetoOpen;
              file.close();
             }
      
             if(temp.toHex().indexOf("563252555300") != -1){
              qDebug() << "FOUND";
              qDebug() << filetoOpen;
              file.close();
             }
      
             if(temp.toHex().indexOf("5642324555300") != -1){
              qDebug() << "FOUND";
              qDebug() << filetoOpen;
              file.close();
             }
      

      @

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Not directly no. You can have a look at the Qt Concurrent module. With it you can run your function several times in parallel.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post