Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.4, 4.8.x, 5.0.0, 5.0.1, 6.0
-
Kubuntu 12.04 LTS (32-bit)
-
Qt 5: b6ccdfa4823d4608f5cb94797b48fc82b8833581 Qt 4: e3cc56d532edc97291b4f5a6c95db8b0ed8b3fe8
Description
According to http://userbase.kde.org/Dolphin/File_Management#Introduction_to_Dolphin page, we can select multiple items using few methods mentioned.
When you click the plus-sign, this file or folder will be added to your selection. You can select multiple files in the same way. Selection can be done also by dragging a rectangle (sometimes called the "rubber band" method), and selection and deselection with Ctrl + click for one at a time and Shift + click for a consecutive range.
However, QFileDialog does not have the same behavior on the default file explorer to select multiple items. The only and strange way to select multiple items is by using the (optional, ctrl) click and drag, or sometimes called the "rubber band" method, to select multiple files.
Test code:
#if 1 QFileDialog fooFileDialog; fooFileDialog.setDirectory(QDir::homePath()); fooFileDialog.setFileMode(QFileDialog::ExistingFiles); QStringList fooFilters; fooFilters << "Any files (*)" << "Image files (*.png *.xpm *.jpg)" << "Text files (*.txt)"; fooFileDialog.setNameFilters(fooFilters); if(fooFileDialog.exec()) { //qDebug() << "File dialog closed. Selected files are listed below."; QStringList fooSelectedFiles = fooFileDialog.selectedFiles(); foreach(QString fooFileName, fooSelectedFiles) { qDebug() << "fooFileName:" << fooFileName; } } #else QStringList fooSelectedFiles = QFileDialog::getOpenFileNames(0, "Select one or more files to open...", QDir::homePath(), "Any files (*)", 0, QFileDialog::DontUseNativeDialog); foreach(QString fooFileName, fooSelectedFiles) { qDebug() << "fooFileName:" << fooFileName; } #endif
Attachments
Issue Links
- relates to
-
QTBUG-40013 ExtendedSelection not working properly in QFileDialog::getOpenFileNames
- Closed