[Qt-interest] Mac: Accessing filenames when started with "open -a"

Christian Lackas delta at lackas.net
Thu Feb 10 18:24:54 CET 2011


Hi everybody,

I have a question on I can see the filenames my Application should open
when called with

    open -a /Application/MyApp file1.dcm file2.dcm file3.dcm

Unfortunately, I don't see these files in QCoreApplication::arguments()
(just contains app name and path) nor in QProcess::systemEnvironments().

If I replace my app with a small shell script, I see that I do actually
get one command line argument (something like '-psn_0_19075632').
However, I don't know what to do with that, e.g. if this is a filename
(but then where, already checked /tmp).

BTW: My goal is to be able to start my program from a browser (that
works already) and open the downloaded file (does not work, since I
the program is not told the filename).
On Linux and Windows this works as expected, as does calling
    /Application/MyApp/Contents/MacOS/MyApp file1.dcm file2.dcm ...

Any input is highly appreciated.

Thanks,
 Christian

-- 
http://www.inviCRO.com



More information about the Qt-interest-old mailing list