I hope that 'll be useful .
That's Code I use to filter JPG & set the path @ a Label :
tr("Open"),
formTwo.lblSelectedFilePath->text(),
tr("JPEG (*.JPG)"),
&selectedFilter,
options);
if (!fileName.isEmpty())
formTwo.lblSelectedFilePath->setText(fileName);
QFileDialog::Options options;
options |= QFileDialog::DontUseNativeDialog;
QString selectedFilter;
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open"),
formTwo.lblSelectedFilePath->text(),
tr("JPEG (*.JPG)"),
&selectedFilter,
options);
if (!fileName.isEmpty())
formTwo.lblSelectedFilePath->setText(fileName);
To copy to clipboard, switch view to plain text mode
Bookmarks