QFileDialog with ShowDirsOnly works only in Qt4.5.3
To select a directory with QFileDialog I write the code bellow.
In Qt 4.5.3 it works but in a computer in QT 4.7 the vertical splitter is at the right of the file dialog. So you must drag and drop the splitter to the left to select a directory.
Could you help me please ?
QString path="";
QFileDialog dialog(
this);dialog.setLabelText(QFileDialog::LookIn,"Choose directory");
dialog.setFileMode(QFileDialog
irectory);
dialog.setOption(QFileDialog
howDirsOnly);
dialog.setDirectory(RecentPath);
if(dialog.exec())
{
QStringList list = dialog.selectedFiles();
path = list.at(0);
}