hi i use Qt and i want to know how much file are in a folder (include subfolder)
i find some code in internet but all of them only count file in a folder and not its subfolder

like this codes

```cpp
#include <stdio.h>
#include <dirent.h>

int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        printf("Usage: ./count \"<path>\"\n");
        return 1;
    }

    struct dirent *de;
    DIR *dir = opendir(argv[1]);
    if(!dir)
    {
        printf("opendir() failed! Does it exist?\n");
        return 1;
    }

    unsigned long count=0;
        while(de = readdir(dir))
     {
          ++count;
     }

    closedir(dir);
    printf("%lu\n", count);

    return 0;
}

```

i find this code [here](https://vpsboard.com/threads/c-extreme-fast-counting-of-files-in-directory.3741/), it only count file in a folder and not its subfoler

anyone can help me

*edit 1*

i test this code from [this](https://stackoverflow.com/a/67336/14369026) page, it working but it can edit for less cpu usage?