Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Searching for a particular keyword in the each QList entry.
Forum Updated to NodeBB v4.3 + New Features

Searching for a particular keyword in the each QList entry.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.1k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    agupta
    wrote on last edited by
    #1

    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!!!
    Aditya

    Thank You,
    Aditya Gupta

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      If you would use "QStringList":http://developer.qt.nokia.com/doc/qt-4.7/qstringlist.html directly, there are methods for filtering available. Look for filter.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved