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. checking files in all sub-directories 2.0
Forum Update on Monday, May 27th 2025

checking files in all sub-directories 2.0

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 562 Views
  • 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.
  • QT_QT_QTQ Offline
    QT_QT_QTQ Offline
    QT_QT_QT
    wrote on last edited by
    #1

    Hi all! i think I asked the same question as the same as tile . Here is the link :Click Here

    If you browse the link above , you will see , i already posted 2 solution. But the solution doesn't meet my requirement. All I want for my program is just list all the sub directories , perform a checking operation , and then return an absolute path for the result. The logic and concept on how to list all sub directories, perform checking operation , and return an absolute path for the result is provided in the solution . Please go through it once, and then guide me from there . Running out from ideas on how to solve this issues. Your help will be appreciated !

    1 Reply Last reply
    0
    • QT_QT_QTQ Offline
      QT_QT_QTQ Offline
      QT_QT_QT
      wrote on last edited by
      #2

      Dear all, After hour of struggling . Finally i have come out with a solution , Feel free to take a look.
      credits :@SGaist @the_ @mrjj

      //This is the fliters
      QDir::Filters df = QDir::Dirs |QDir::NoDotAndDotDot;
      QDirIterator::IteratorFlag dff = QDirIterator::Subdirectories;

      QString root = "C:/Users/USER/Desktop/FileA/";
      QDirIterator it(root,df,dff);
       while(it.hasNext())
      {
          //performing checking operation
         //QString str = "fileE";
           QString str2 = it.next();
      
           if(str2.contains("fileE"))
           {
              qDebug()<<str2;
           }
      
      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