Important: Please read the Qt Code of Conduct -

Searching for a particular keyword in the each QList entry.

  • Hi Friends,

    I am a beginner in QT and I stuck up with an issue and not able to proceed further hope somebody can help me on this.

    I have two QList<QString>, one contains the FileNames and the other list contains the FilePaths.
    Now the issue is I have to take the first entry form FileName List and search for the file in the FilePaths list and open the files for reading.

    For example:
    my fileNameList has following entries {1.txt,2.txt,3.txt} and my filePathsList has following entries {C:\projects\qt\1.txt, C:\projects\qt\2.txt, C:\projects\qt\3.txt, C:\projects\1.txt, C:\projects\qt\1.txt}.

    NOTE: my filePathsList consist of different paths.

    Now if I read the first entry form fileNmeList i.e.1.txt and search in filePathsList and if found I have to open both the files for reading or writing.

    Thanks in advance!!!

  • If you would use "QStringList": directly, there are methods for filtering available. Look for filter.

Log in to reply