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. Qprocess not returning the correct state()
Forum Updated to NodeBB v4.3 + New Features

Qprocess not returning the correct state()

Scheduled Pinned Locked Moved Unsolved General and Desktop
statestartqprocess
3 Posts 2 Posters 1.3k 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.
  • D Offline
    D Offline
    dummys
    wrote on 21 Oct 2015, 12:08 last edited by
    #1

    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
    0
    • J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 21 Oct 2015, 12:27 last edited by
      #2

      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 21 Oct 2015, 13:52
      0
      • J jsulm
        21 Oct 2015, 12:27

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

        D Offline
        D Offline
        dummys
        wrote on 21 Oct 2015, 13:52 last edited by dummys
        #3

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

        3/3

        21 Oct 2015, 13:52

        • Login

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