NSApplicationDelegate has a method which is called when a request to open 
multiple files is made.

https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428742-application?language=objc

Qt does indeed enumerate the files in this list and issue a separate file open 
event for each: 
https://github.com/qt/qtbase/blob/5.10/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm#L297

What we should do instead is allow QFileOpenEvent to store a list of files 
instead of just a single one. Trying to re-group the events after the fact is 
probably not a good idea.

> On Jan 27, 2018, at 10:34 AM, René J.V. Bertin <[email protected]> wrote:
> 
> Hi,
> 
> Judging from the behaviour of native Mac applications like Preview.app there 
> must be a distinction in the LaunchServices messages being sent when the user 
> requests the opening of a single document vs. a collection of documents. 
> Preview.app for instance will open a new window for each request, containing 
> all the documents of that request in individual tabs.
> 
> Qt doesn't seem to allow that but sends QFileOpenEvents for each individual 
> document. In my experience one can typically do a 
> QCoreApplication::processEvents() immediately after installing the event 
> filter to catch all documents "with which" the application was launched. Has 
> anyone found a simple way to regroup subsequent QFileOpenEvents?
> 
> Thanks,
> R.
> _______________________________________________
> Interest mailing list
> [email protected]
> http://lists.qt-project.org/mailman/listinfo/interest

-- 
Jake Petroules - [email protected]
The Qt Company - Silicon Valley
Qbs build tool evangelist - qbs.io

_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to