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

Jason H scorp1us at yahoo.com
Thu Feb 10 18:37:37 CET 2011


QCoreApplication gobbles up the command line parameters for itself sometimes. 
I'd say change "-a" if you can or manually parse the command line. I forget what 
-a might be for...



----- Original Message ----
From: Christian Lackas <delta at lackas.net>
To: qt-interest at qt.nokia.com
Sent: Thu, February 10, 2011 12:24:54 PM
Subject: [Qt-interest] Mac: Accessing filenames when started with "open -a"

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
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest



      



More information about the Qt-interest-old mailing list