Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
4.4.0
-
None
Description
It would be useful with a files() member in QFileOpenEvent which returns a list of all selected files. Currently, only the file() method is available and one event is received for each file. It would be better to have a single event for all selected files. This matches the underlying Mac OS event system which provides an array of all files. It also seems consistent with the Qt4 style of returning lists such as QFileDialog::filesSelected().
The reason for this enhancement is to examine all files before performing an action. For example, when wanting to process certain file types before other file types. Using the existing QFileOpenEvent, there is no way of knowing how many more, if any, files events are still pending so it is not possible to simply store the filenames as they arrive and wait for the final event before doing something.
For backward compatibility when multiple files are selected, additional events could be returned (as happens today) if the user calls only file(). If the user calls the proposed files(), however, the additional Qt open events would be suppressed because the user retrieved the complete file list