Apple System Services and Qt.
-
Hello, everybody.
I am using Qt to develop my desktop app on Windows, Linux Ubuntu and Mac Os X.
In all those platforms i need integration into file viewer context menu.
With Windows Explorer and Linux Nautilus it is easy (on linux i am just write plugin for Nautilus).
But on Mac Os X not possible use custom plugins with Mac Finder.
Apple present new interfase for this - System Services (http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/SysServices/introduction.html)
But i can handle System Services messages only with Cocoa in Oblective C project.
So my question: what is the best way to implement Qt app with Apple Sytem Services? -
Maybe it is interesting for somebody.
I fond solution. My solution not nice but i hope it work :)
Solution:
Create two app bundles:
First with sytem services - Objective C app that must handle Apple System Services messages.
Second with Qt app - main application.
Put second bundle to resources folder in first bundle.
Make first bundle LSUiElement-YES(in plist).
When user open app in first bundle, this app must only start second bundle.
And when app in second bundle receive Apple Secrvice Message - send this message to app in second bundle.
First budle only launch second bundle and send to it all Apple Service messages.This is my solution.
P.S. Sory for my bad english skill.
-
do you do service programming?
-
why not using sockets for transferring data between applications?
-
You can mix "regular" C/C++ with both Objective-C and Objective-C++.
-
bq. You can mix “regular” C/C++ with both Objective-C and Objective-C++
I thought about it. But how i know Objective C and Qt - bad mix.
And even if i deside to use Objective C and Qt in one app - there is some problems:
I need use NSApp to handle Apple Services messages. But also i need use QApplication -
to provide my Qt GUI functionality. And i do not know how i can work with both this classes in one Application. Maybe you have some examples?bq. Why not using sockets for transferring data between applications?
Interprocess communication is not a problem for me. My problem is How to properly unite the two applications in one bundle. But i think i found solution for this.
However - best solution is mix NSApp and QApplication in one executable file. But i do not know how i can do it.
-
I'm not an Mac expert but you can use QApplication::macEventFilter() to receive native events - there is no need to create another event loop (NSApplication). In addition, you can mix-match platform-specific code an Qt code to subscribe to those events.
-
If you want to include your App bundle into another one, just copy it there. See this "recent thread":/forums/viewthread/11058 for a similiar problem.
-
[quote author="Volker" date="1319803919"]If you want to include your App bundle into another one, just copy it there. See this "recent thread":/forums/viewthread/11058 for a similiar problem.[/quote]
Yes, I just have to do so.