Results 1 to 14 of 14

Thread: Calling external programs via QProcess on Mac OS

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Join Date
    May 2009
    Location
    Berlin
    Posts
    14
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Calling external programs via QProcess on Mac OS

    I just installed Qt 5.4.0 and rebuilt everything. Now the output after applying macdeployqt is slightly different:

    Qt Code:
    1. @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.4.0, current version 5.4.0)
    2. @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.4.0, current version 5.4.0)
    3. @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.4.0, current version 5.4.0)
    4. /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
    5. /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    6. /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    7. /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    8. /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
    9. /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
    To copy to clipboard, switch view to plain text mode 

    Now it's also using @executable_path, but when I start the bundle by double-clicking, the program still cannot call external programs. I tried something I didn't before and ran the bundle from the shell with "open Foo.app" and being started like that, the program can do everything. So, it's definitely the execution enviroment. When I use MuCommander to browse the bundle for the binary, that is hidden inside, and run that, then it also opens a shell window and everything is fine.

    Somehow I have to find out how to spawn a shell execution environment when running a bundle.

    Maybe that article points to the right direction: http://stupidpythonideas.blogspot.de...variables.html

    On OS X, Finder.app is a child of your launchd session, which is a child of the root launchd session, which is process 0. There's no shell anywhere. And when you double-click an app, it asks LaunchServices to run the app. So, your app doesn't inherit anything from Finder, and even if it did, Finder hasn't inherited anything from your login shell.
    He suggests defining an environment in the plist file with the LSEnvironment key. The question is, what has to be there in order to mimick a shell environment. Can be quite a lot I guess.
    Last edited by berliner; 11th December 2014 at 00:52.

Similar Threads

  1. QProcess & Working with External Programs
    By jstippey in forum Qt Programming
    Replies: 2
    Last Post: 20th December 2010, 20:04
  2. [QProcess] Calling console program
    By bgarisn in forum Newbie
    Replies: 3
    Last Post: 25th February 2010, 15:11
  3. Calling external programs?
    By Hossie in forum Qt Programming
    Replies: 12
    Last Post: 17th May 2008, 17:19
  4. QProcess and console programs
    By bond_e in forum Qt Programming
    Replies: 10
    Last Post: 13th July 2007, 08:39
  5. How to communicate with external programs?
    By deekayt in forum Qt Programming
    Replies: 7
    Last Post: 27th October 2006, 23:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.