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. [SOLVED] QProcess hell
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QProcess hell

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 5.5k Views 1 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.
  • D Offline
    D Offline
    dword
    wrote on last edited by
    #1

    Hi all,
    I'm trying to have something like this:

    • a REST service is handling requests in a thread per request
    • a Process Pool Manager (QObject child class) is responsible for starting processes, and storing processes output of finite kind of processes.
    • Request Handlers may use the Process Pool Manager (via queued signals) to start a process and get the process output.
    • To avoid the super nerves killing:
      @"QObject: Cannot create children for a parent that is in a different thread"@
      the Process Pool Manager is started in his own thread, processes are started only from this thread.

    At this point I've got this killing message #2 when trying to connect signals emitted from my QProcess(es) to my Process Pool Manager slots:
    @Warning: QObject::connect: Cannot queue arguments of type 'QProcess::ProcessError'@
    Ok, so I've try to add
    @
    Q_ENUMS(QProcess::ProcessError);
    Q_ENUMS(QProcess::ExitStatus);
    @
    in my Process Pool Manager Class declaration, but still have the message...
    Any clue?
    Thank you for your help.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      You should read the QMetaType documentation...

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

        [quote author="dword" date="1315839798"]At this point I've got this killing message #2 when trying to connect signals emitted from my QProcess(es) to my Process Pool Manager slots:[/quote]
        You most probably got this message:
        @
        QObject::connect: Cannot queue arguments of type 'QProcess::ProcessError'
        (Make sure 'QProcess::ProcessError' is registered using qRegisterMetaType().)
        @
        @
        ...
        qRegisterMetaTypeQProcess::ProcessError("QProcess::ProcessError");
        ...
        @

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dword
          wrote on last edited by
          #4

          Thank you very much Lukas it worked just fine.
          @Andre: I did search and those are the first lines from my Qt documentation:

          bq. Registers the type name typeName for the type T. Returns the internal ID used by QMetaType. Any class or struct that has a public default constructor, a public copy constructor and a public destructor can be registered.

          So I don't see how, based on that, I can guess that it allows me to register an enum from another class. But maybe it's just my understanding...

          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