Reputation: 315
I am a beginner in Qt creator, so my question is how to load the path of a directory into an array, for example :
If I want to load all the video paths in an array by order, how can I make it? I want an array called video[ ]
, then video[0]
is the video2017-05-03-13:54:41B
in the image, then video[1]
is video2017-05-03-14:01:58B
etc. And then show the paths in a label or a listWidget.
Upvotes: 1
Views: 383
Reputation: 705
QDir recoredDir(path);
QStringList dirs = recoredDir.entryList(QDir::NoDotAndDotDot
| QDir::Dirs);
This will get you all the directories in path to the list 'dirs'
Upvotes: 3