Unsolved Anyone added a protocol handler on OSX to their Qt application?
-
This is trivial to do on Windows thankfully (the protocol string comes in via the startup arguments), but on OSX it doesn't appear to work that way.
In the old days you'd use a callback in the Carbon framework's event handler system - is that still the modern method of protocol handling on OSX when using Qt?
I'm curious if any one has a Qt app that gets triggered via url schema on OSX.
Thx!
-
@VRHans Can you please explain what you mean? What do you mean by "protocol"?
-
@jsulm A protocol handler meaning you can create a custom protocol (rather than http or https in a URL like schema) such as "myapp://commands/and/arguments/can/go/here"
-
Recent,I am coding on Mac OS, I find it is very diffenent with on Windows OS in some system events and application concept. i am confused about Mac OS.
eg: I want to automatic associate data file(
*.xyz
) with my app when it install, so the user can double clicked data file(*.xyz
) to open my app directly,not to right click to chose open way.I tried many ways,
QFileOpenEvent
, setInfo.plist
,pack my app to *.dmg
to simulate the installation environment. They are both failed. -
@VRHans said in Anyone added a protocol handler on OSX to their Qt application?:
@jsulm A protocol handler meaning you can create a custom protocol (rather than http or https in a URL like schema) such as "myapp://commands/and/arguments/can/go/here"
In OSX you talking about NSURLProtocol, right ?
I don't know something similar with QUrl.
The only alternative could be QWebEngineUrlSchemeHandler in the WebEngine framework. -
@joeQ said in Anyone added a protocol handler on OSX to their Qt application?:
I want to automatic associate data file(
*.xyz
) with my app when it install, so the user can double clicked data file(*.xyz
) to open my app directly,not to right click to chose open way.I tried many ways,
QFileOpenEvent
, setInfo.plist
,pack my app to *.dmg
to simulate the installation environment. They are both failed.Have a look at this topic: create-an-executable-file-with-own-fileextension
-
@mpergand
%> _ <%,successed, Thank u very much. I guess i wrote wrong format and content of Info.plist. This time, I only copy the Info.plist content from theQFileOpenEvent
help manual. It worked. Every Thank u.