baluk
4th November 2010, 14:30
Hi,
In my app, I want to read the media files with extension *.avi and *.mkv from the directory. But i am not able to filter them when reading through QDir. If I remove the filter I can get all the files listed in the directory. Here is my code..
QString path = QFileDialog::getExistingDirectory (this, tr("Directory"), directory[i].path());
if ( path.isNull() == false )
{
directory[i].setPath(path);
qDebug() << directory[i].entryList().filter("Media files (*.mkv *avi)");
}
If i Just use
directory[i].entryList(), I get all the files. Can any one please correct me If I am fallowing wrong filter format.
Thank You,
Baluk
In my app, I want to read the media files with extension *.avi and *.mkv from the directory. But i am not able to filter them when reading through QDir. If I remove the filter I can get all the files listed in the directory. Here is my code..
QString path = QFileDialog::getExistingDirectory (this, tr("Directory"), directory[i].path());
if ( path.isNull() == false )
{
directory[i].setPath(path);
qDebug() << directory[i].entryList().filter("Media files (*.mkv *avi)");
}
If i Just use
directory[i].entryList(), I get all the files. Can any one please correct me If I am fallowing wrong filter format.
Thank You,
Baluk