Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to run an app on MacOS platform using QProcess in appliacation's Contents/MacOS?
Forum Updated to NodeBB v4.3 + New Features

How to run an app on MacOS platform using QProcess in appliacation's Contents/MacOS?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 553 Views
  • 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.
  • A Offline
    A Offline
    angelyouyou
    wrote on last edited by angelyouyou
    #1

    I want to run an application using QProcess(Qt6.1). But it does not work well. The application can not be run.
    The application's path is:
    /Applications/Wireshark.app/Contents/MacOS/text2pcap
    The code is:
    QProcess* process = new QProcess(this);
    QString text2capPath = WiresharkUtils::getRunningAppPath(APP_NAME_TEXT2CAP);
    QStringList argsList;
    argsList << tmpFilePath << storagePath;
    process->startDetached(text2capPath, argsList);
    process->waitForStarted();

    value of vars
    -->
    var : text2capPath
    /Applications/Wireshark.app/Contents/MacOS/text2pcap

    var tmpFilePath:
    /private/var/folders/2w/zcqw02ns0pv6ntfdn6gtp4rc0000gn/T/pcap_file__2021-06-24-14-29-00.txt

    var storagePath:
    /Applications/Wireshark.app/Contents/MacOS/text2cap

    J.HilkJ 1 Reply Last reply
    0
    • A angelyouyou

      I want to run an application using QProcess(Qt6.1). But it does not work well. The application can not be run.
      The application's path is:
      /Applications/Wireshark.app/Contents/MacOS/text2pcap
      The code is:
      QProcess* process = new QProcess(this);
      QString text2capPath = WiresharkUtils::getRunningAppPath(APP_NAME_TEXT2CAP);
      QStringList argsList;
      argsList << tmpFilePath << storagePath;
      process->startDetached(text2capPath, argsList);
      process->waitForStarted();

      value of vars
      -->
      var : text2capPath
      /Applications/Wireshark.app/Contents/MacOS/text2pcap

      var tmpFilePath:
      /private/var/folders/2w/zcqw02ns0pv6ntfdn6gtp4rc0000gn/T/pcap_file__2021-06-24-14-29-00.txt

      var storagePath:
      /Applications/Wireshark.app/Contents/MacOS/text2cap

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @angelyouyou

      But it does not work well

      • well what does that mean exactly?
      • also connect to the errorOccured signal to get more information about the error

      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        angelyouyou
        wrote on last edited by angelyouyou
        #3

        I mean the new outside program “/Applications/Wireshark.app/Contents/MacOS/text2pcap” can not be run.There is no error information reported.
        But if I change the another path "/Applications/Wireshark.app" to be called, it run ok.

        jsulmJ 1 Reply Last reply
        0
        • A angelyouyou

          I mean the new outside program “/Applications/Wireshark.app/Contents/MacOS/text2pcap” can not be run.There is no error information reported.
          But if I change the another path "/Applications/Wireshark.app" to be called, it run ok.

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

          @angelyouyou said in How to run an app on MacOS platform using QProcess in appliacation's Contents/MacOS?:

          There is no error information reported

          Please show how you use errorOccured

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

          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 Extensions
          • Unsolved