D11074: Fix opening files via a file manager on Mac
René J.V. Bertin
noreply at phabricator.kde.org
Mon Mar 5 22:37:54 UTC 2018
rjvbb added a comment.
> The legacy argc,argv is handled by QCommandLineParser.
Only partly, the annoying bit where you loop over the array to see which options are there. For the rest it only handles Qt-specific arguments, and files to be opened end up in the `positionalArguments()` list.
QApplication cannot know if your application can (or should be able to) open files, even less how to open them.
All Qt can do is provide an integrated Qt'ish mechanism through which get informed when the user intends to open a document via LaunchServices. That mechanism encapsulates the ObjC implementation Sergio referred to, and such events can occur at any moment, also when the application is already running.
And so yes, every Qt application that wants to be able to open files through the Finder and other LaunchServices mechanisms must implement a handler (event filter) for QFileOpenEvents.
REPOSITORY
R223 Okular
REVISION DETAIL
https://phabricator.kde.org/D11074
To: sbragin
Cc: ltoscano, rjvbb, #okular, michaelweghorn, ngraham, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20180305/95625bd2/attachment-0001.html>
More information about the Okular-devel
mailing list