I hope that 'll be useful .
That's Code I use to filter JPG & set the path @ a Label :

Qt Code:
  1. QFileDialog::Options options;
  2.  
  3. options |= QFileDialog::DontUseNativeDialog;
  4. QString selectedFilter;
  5.  
  6. QString fileName = QFileDialog::getOpenFileName(this,
  7. tr("Open"),
  8. formTwo.lblSelectedFilePath->text(),
  9. tr("JPEG (*.JPG)"),
  10. &selectedFilter,
  11. options);
  12.  
  13.  
  14. if (!fileName.isEmpty())
  15. formTwo.lblSelectedFilePath->setText(fileName);
To copy to clipboard, switch view to plain text mode