Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to run external QT program from PyQT5 on MacOS
Forum Updated to NodeBB v4.3 + New Features

How to run external QT program from PyQT5 on MacOS

Scheduled Pinned Locked Moved Unsolved Qt for Python
29 Posts 3 Posters 3.7k 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.
  • S SGaist
    21 Jan 2022, 19:33

    Did you try to use Popen with shell=True ?

    B Offline
    B Offline
    Benjamin Halko
    wrote on 22 Jan 2022, 19:01 last edited by Benjamin Halko
    #21

    @SGaist It gave the same error LSOpenURLsWithRole() failed with error -10810 for the file /Users/benjamin/Desktop/Dolphin.app.

    Oh and I tried starting the .app not executable in /Contents/MacOS/

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 22 Jan 2022, 20:04 last edited by
      #22

      Which version of Qt are your application and Dolphin using ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply 22 Jan 2022, 23:40
      0
      • S SGaist
        22 Jan 2022, 20:04

        Which version of Qt are your application and Dolphin using ?

        B Offline
        B Offline
        Benjamin Halko
        wrote on 22 Jan 2022, 23:40 last edited by Benjamin Halko
        #23

        @SGaist I am using PyQt5 (I think version 5.12.2) And I have been informed that Dolphin uses 5.15.0 (C++). Although it seems that Dolphin uses this custom version ...maybe???

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 24 Jan 2022, 19:25 last edited by
          #24

          You should try with both using the same version of Qt.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          B 1 Reply Last reply 26 Jan 2022, 19:56
          0
          • B Offline
            B Offline
            Benjamin Halko
            wrote on 25 Jan 2022, 22:20 last edited by Benjamin Halko
            #25

            My bad I was using PyQt5 version 5.15.5, but I will still try using Dolphins version.

            1 Reply Last reply
            0
            • S SGaist
              24 Jan 2022, 19:25

              You should try with both using the same version of Qt.

              B Offline
              B Offline
              Benjamin Halko
              wrote on 26 Jan 2022, 19:56 last edited by Benjamin Halko
              #26

              @SGaist Ok so I update PyQt5 and I used ['open', '/Users/benjamin/Desktop/Dolphin.app/Contents/MacOS/Dolphin'],shell=False and it worked!
              But then when I went to use ['open', '/Users/benjamin/Desktop/Dolphin.app/Contents/MacOS/Dolphin', '--args', '-e', gamePath],shell=False to try to load a game, it gave me the open command usage dialog. Is there something wrong with using --args?
              Also I tried things like opening with just /Users/benjamin/Desktop/Dolphin.app or using shell=True but they also didn't work...

              I wonder if the arguments for Dolphin only work when running from the Dolphin.app and not the /Contents.... one.
              Took a look and yep, the /Contents one doesn't support arguments...

              J 1 Reply Last reply 27 Jan 2022, 07:36
              0
              • B Benjamin Halko
                26 Jan 2022, 19:56

                @SGaist Ok so I update PyQt5 and I used ['open', '/Users/benjamin/Desktop/Dolphin.app/Contents/MacOS/Dolphin'],shell=False and it worked!
                But then when I went to use ['open', '/Users/benjamin/Desktop/Dolphin.app/Contents/MacOS/Dolphin', '--args', '-e', gamePath],shell=False to try to load a game, it gave me the open command usage dialog. Is there something wrong with using --args?
                Also I tried things like opening with just /Users/benjamin/Desktop/Dolphin.app or using shell=True but they also didn't work...

                I wonder if the arguments for Dolphin only work when running from the Dolphin.app and not the /Contents.... one.
                Took a look and yep, the /Contents one doesn't support arguments...

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 27 Jan 2022, 07:36 last edited by
                #27

                @Benjamin-Halko said in How to run external QT program from PyQT5 on MacOS:

                Is there something wrong with using --args?

                I don't know.
                What exactly does "command usage dialog" tell you? You're probably using --args wrongly.

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

                B 1 Reply Last reply 27 Jan 2022, 20:23
                0
                • J jsulm
                  27 Jan 2022, 07:36

                  @Benjamin-Halko said in How to run external QT program from PyQT5 on MacOS:

                  Is there something wrong with using --args?

                  I don't know.
                  What exactly does "command usage dialog" tell you? You're probably using --args wrongly.

                  B Offline
                  B Offline
                  Benjamin Halko
                  wrote on 27 Jan 2022, 20:23 last edited by Benjamin Halko
                  #28

                  @jsulm It is just what it gives you when you just type open.

                  Also, when launching the .app from Python, Dolphin starts then immediately crashes with this error message using Apples Crash Message Screen Thing: https://pastebin.com/NqBK0YvQ (It also shows LSOpenURLsWithRole() failed with error -10810 for the file /Users/benjamin/Desktop/Dolphin.app. in the terminal window)

                  J 1 Reply Last reply 28 Jan 2022, 07:27
                  0
                  • B Benjamin Halko
                    27 Jan 2022, 20:23

                    @jsulm It is just what it gives you when you just type open.

                    Also, when launching the .app from Python, Dolphin starts then immediately crashes with this error message using Apples Crash Message Screen Thing: https://pastebin.com/NqBK0YvQ (It also shows LSOpenURLsWithRole() failed with error -10810 for the file /Users/benjamin/Desktop/Dolphin.app. in the terminal window)

                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 28 Jan 2022, 07:27 last edited by
                    #29

                    @Benjamin-Halko As I said you first need to find out how to call Dolphin properly.
                    Try to pass it -h parameter to get more information.

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

                    1 Reply Last reply
                    0

                    21/29

                    22 Jan 2022, 19:01

                    • Login

                    • Login or register to search.
                    21 out of 29
                    • First post
                      21/29
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved