[Interest] QEvent::FileOpen : opening single vs. multiple documents

René J.V. Bertin rjvbertin at gmail.com
Sat Jan 27 22:31:52 CET 2018

On Saturday January 27 2018 20:24:04 Jake Petroules wrote:

> What we should do instead is allow QFileOpenEvent to store a list of files instead of just a single one.

That probably should have been done from the onset, because introducing this now almost certainly means new API.
There's no time or serial stamp on QEvents that could be used for grouping?

> Trying to re-group the events after the fact is probably not a good idea.

At the least it's extra work that requires a certain amount of guessing which events go together (except those that are pending when you create the QApplication instance).

A rough outline of solution I could see for the current way QFileOpenEvents come in :

- store each incoming file URL in a QList
- set or restart a timer to empty that list after a time that's (much?) shorter than the average time after which the user could queued another request via LaunchServices

Not really difficult, but not really fun to write either and possibly brittle. But I don't see another way that's easier and/or more reliable - is there?


More information about the Interest mailing list