If you are using the QFileDialog static methods, then you call QFileDialog::getExistingDirectory() to select directories only and QFileDialog::getOpenFileName() for files only. If you are using the non-static method (ie. via QFileDialog::exec()) than you set the option QFileDialog::ShowDirsOnly and use QFileDialog::Directory file mode.
The original post is 13 years old, during Qt 3 or Qt 4 days. Qt is three major revisions past that now.
Bookmarks