PDA

View Full Version : QFiledialog directory of selected file



seifhatem
27th January 2011, 20:01
hey all
i did a qfiledialog and here is it's code

QFileDialog dialog(this);
dialog.setFileMode(QFileDialog::AnyFile);
dialog.setNameFilter(tr("IMG3 File (*.img3)"));
dialog.setViewMode(QFileDialog::Detail);
QStringList fileNames;
if (dialog.exec())
fileNames = dialog.selectedFiles();
I want to get the directory of the selected file with filename and extension "C:/1.img3" and write this dir in lineedit
I tried qfileinfo but no success
Thanks in advance

high_flyer
27th January 2011, 21:05
I tried qfileinfo but no success
Post the code you tried.