[Interest] OSX system services with Qt
Jason H
jhihn at gmx.com
Mon May 9 15:42:55 CEST 2016
> Sent: Monday, May 09, 2016 at 9:01 AM
> From: "Jani Tykka" <jtykka at broadsoft.com>
> To: "interest at qt-project.org Interest" <interest at qt-project.org>
> Subject: [Interest] OSX system services with Qt
>
> Hi,
>
> Has anyone experience in providing system service on OS X according
> https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/SysServices/introduction.html#//apple_ref/doc/uid/10000101-SW1
>
> Tried to follow the guide without success. Could there be something in
> the Qt app that prevents this to work? Please let me know what are the
> steps if you have managed to set the service provider.
>
> Thanks,
> Jani
No, but I've done other platform-specific tie-ins for OSX/Android without problem. I create a class (Derived from QObject) that is the shim for each platform. Then in a .mm file I add the obj-c code. Because my app is QML, I expose it as a root context property.
PlatformShimImpl *shim = new PlatformShimImpl(&app);
engine.rootContext()->setContextProperty(QStringLiteral("platformShim"), shim);
app.connect(&app, SIGNAL(applicationStateChanged(Qt::ApplicationState)), shim, SLOT(applicationStateChanged(Qt::ApplicationState)));
I would expect the same to work for services.
More information about the Interest
mailing list