Question

I use QProcess to run other non Qt based programs and they all work fine. App1 tries to call App2 which is located in App1.app/Contents/deps. The other programs it calls are also located in that directory. If I run App2 from finder or QtCreator it works just fine. But when I try to run it with QProcess I get this error:

objc[7817]: Class NotificationReceiver is implemented in both /Users/USER/gui/App1Bin/App1.app/Contents/deps/App2.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets and /Users/USER/Qt5.2.1/5.2.1/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets. One of the two will be used. Which one is undefined.

QObject::moveToThread: Current thread (0x1013000c0) is not the object's thread (0x101210d60).
Cannot move to target thread (0x1013000c0)

On Mac OS X, you might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
This application failed to start because it could not find or load the Qt platform plugin "cocoa".

Available platform plugins are: cocoa, minimal, offscreen.

Reinstalling the application may fix this problem.

I am using macdeployqt to deploy both App1 and App2.

I use process->start(cmd, options) to call it.

Was it helpful?

Solution

I could not figure out why I could not open App2 with QProcess but I figured out that I can open it with the open command which is called by QProcess.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top