What is the difference between running a Mac OS X application through Finder / open and directly executing a binary application?

I am having a problem with a Qt application on Mac OS X 10.10.5, which QFileDialogwill not close properly when canceled. Although this may be an error in Qt, I see this error only when starting the application, as a regular user, for example, opening it in Finder (or through the command line open). If I run the application through Xcode or directly call the binary code, the problem does not occur.

  • Launch the application by calling the binary directly on the command line or in Xcode, for example. ./MyApp.app/Contents/MacOS/MyApp

  • Launch the application through the Finder or open, for example.open ./MyApp.app

What are the differences between the two methods and how does this affect the running application?

+4
source share
1 answer

The main difference is the working folder. You have no control over what it is, but between these two challenges it will be different.

What directory are you showing in QFileDialog? You should probably start at a specific location, such as the user's home.

0
source

Source: https://habr.com/ru/post/1607539/


All Articles