Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Anyone added a protocol handler on OSX to their Qt application?
Qt 6.11 is out! See what's new in the release blog

Anyone added a protocol handler on OSX to their Qt application?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 3.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VRHans
    wrote on last edited by
    #1

    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!

    jsulmJ joeQJ 2 Replies Last reply
    0
    • V VRHans

      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!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @VRHans Can you please explain what you mean? What do you mean by "protocol"?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      V 1 Reply Last reply
      0
      • jsulmJ jsulm

        @VRHans Can you please explain what you mean? What do you mean by "protocol"?

        V Offline
        V Offline
        VRHans
        wrote on last edited by
        #3

        @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"

        M 1 Reply Last reply
        0
        • V VRHans

          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!

          joeQJ Offline
          joeQJ Offline
          joeQ
          wrote on last edited by
          #4

          @VRHans

          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, set Info.plist, pack my app to *.dmg to simulate the installation environment. They are both failed.

          Just do it!

          M 1 Reply Last reply
          0
          • V VRHans

            @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"

            M Offline
            M Offline
            mpergand
            wrote on last edited by
            #5

            @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.

            1 Reply Last reply
            2
            • joeQJ joeQ

              @VRHans

              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, set Info.plist, pack my app to *.dmg to simulate the installation environment. They are both failed.

              M Offline
              M Offline
              mpergand
              wrote on last edited by
              #6

              @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, set Info.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

              joeQJ 1 Reply Last reply
              3
              • M mpergand

                @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, set Info.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

                joeQJ Offline
                joeQJ Offline
                joeQ
                wrote on last edited by
                #7

                @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 the QFileOpenEvent help manual. It worked. Every Thank u.

                Just do it!

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt
                • Unsolved