Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Qprocess not returning the correct state()

    General and Desktop
    state start qprocess
    2
    3
    971
    Loading More Posts
    • 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.
    • D
      dummys last edited by

      Hi,

      I'm using pyqt5.
      My code:
      self.myprocess = QProcess()
      self.myprocess.start(self.mycommandline)
      print self.myprocess.state()

      When I ps -aux I see the process has been launched and is working but when I call the state() method it returns 0.
      When the process start I get a "1" but after I get a 0.
      Several other process is launched correctly with this technics and I get "2" in the state.
      what can I do to debug this issue ?
      Thanks for help.

      1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion last edited by

        Did you try to use absolute path to the ps command?
        Like: "/bin/ps -aux"

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

        D 1 Reply Last reply Reply Quote 0
        • D
          dummys @jsulm last edited by dummys

          @jsulm Hmm I'm not trying to launch ps... I launch /usr/bin/asterisk. I do the ps in a terminal just to check if the process has been created and is running.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post