title: Qt: Cannot queue arguments of type 'QProcess::ProcessError' - QProcess::ProcessError(FailedToStart)
body: <p>I am trying to pass a serialized image to a process I started in my Qt program. 
  However when doing so I get this error message:</p>
  
  <pre><code>QObject::connect: Cannot queue arguments of type 'QProcess::ProcessError'
  (Make sure 'QProcess::ProcessError' is registered using qRegisterMetaType().)
  </code></pre>
  
  <p>The image I am trying to pass is a cv::Mat which I converted to a QImage which I afterwards converted to a QString.</p>
  
  <p>Could someone tell me what I am doing incorrectly when streaming my parameters to the variable params? My current guess is that the issue lies in the serialized form of the image ie it contains many double quotes which is why when inserting the value of matQStr in the line below (to stream it to params), there is a misinterpretation</p>
  
  <p>Everything else works perfectly fine, it is just now when trying to pass an image that something goes wrong.</p>
  
  <p>In case you may need this information, the process I am starting is a python function using openCV taking 1 parameter, ie the image I am trying to pass. Serializing the image to pass it to the function, apparently is the easiest solution.</p>
  
  <p>The code:</p>
  
  <pre><code>double myClass::runPythonScrypt()
  {
      cv::Mat imageParameter = cv::imread("/home/John/Desktop/image1.jpg", CV_LOAD_IMAGE_COLOR);
      QImage img((uchar*)imageParameter.data, imageParameter.cols, imageParameter.rows, imageParameter.step1(), QImage::Format_RGB32);
      std::string matStdString(imageParameter.begin&lt;unsigned char&gt;(), imageParameter.end&lt;unsigned char&gt;());
      QString matQStr = QString::fromStdString(matStdString);
  
      QProcess p;
      QStringList params;
      connect(&amp;p, &amp;QProcess::errorOccurred, qApp, &amp;QApplication::aboutQt );
      int a=55;
  //I added "this is the end in the string because in the beginning I thought maybe some overflow occured and therefor not the entire image was passed to the process, yet you can see that this sentence gets printed"
      params&lt;&lt; "-c" &lt;&lt; "import cv2; import imp; foo = imp.load_source('myTest', '/home/John/fw/demos/myTest.py'); from myTest import myClass; myClassObj = myClass(); print myClassObj.myTestFunction( "+ matQStr +" ) this isthe end;";
  
  
  
          qDebug()&lt;&lt;params;
          p.start("python2", params);
          if(! p.waitForFinished(-1))
          {qDebug()&lt;&lt;"it failedddd";}
  
          qDebug()&lt;&lt;"error that occured: "&lt;&lt;p.error();
  
          QString errors = p.readAllStandardError();
          qDebug()&lt;&lt;"occured errors:"&lt;&lt;errors;
  
          QString p_stdout = p.readAllStandardOutput();
  
  
  ...
  
  }
  </code></pre>
  
  <p>The generated output:</p>
  
  <pre><code>started recognition thread
  ("-c", "import cv2; import imp; foo = imp.load_source('myTest', '/home/John/fw/demos/myTest.py'); from myTest import myClass; myClassObj = myClass(); print myClassObj.myTestFunction(
  
  ...etc...
  
  ����������������������Ѧ����&lt;\u0013\u001B\u0014�������������������������������������������������������������������
  ����������������������������������������������������������������������u0011\u0017\u0005\b=
  *\u0007\u0005\u0016=/\"6=;&lt;@@;;&gt;AA@:311373//+1HcVFPs\u007FeH?z\u007FBY�f\\�oJV��������������������t?
  &gt;K\\`RJMTY`a[RSWQMJECBDDIEEEJKN
  KJGJHF&gt;@AGFHDC=&lt;89:AA&lt;0/4*%%+/../+##.657&gt;9;=@BBBA@A@&gt;&lt;:9&lt;?@@?&gt;?BB;;:88:;&lt;&gt;;;;&gt;&gt;=&lt;;&lt;@@&gt;=&lt;&lt;&lt;;:::;;&lt;998:7337:;&lt;;:
  88955555677;;956:954578887879::8533146764441/./0110/--0563/1220./2665420/011222147;FEA&gt;?&gt;;8&gt;=&lt;BGG;04,,-%$&amp;$ \")0
  1./3332/,))++)),.)
  
  etc...
  
  10210.,,,-.-/12/*'',-023432-%#')')/04;94:&lt;3.).51/1.((*.10,'1/23547702.0%#0+114; ) this isthe end;")
  
  started recognition thread
  QObject::connect: Cannot queue arguments of type 'QProcess::ProcessError'
  (Make sure 'QProcess::ProcessError' is registered using qRegisterMetaType().)
  it failedddd
  error that occured:  QProcess::ProcessError(FailedToStart)
  occured errors: ""
  name:  ""
  certitude:  0
  return value:  0
  2
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The used python script:</p>
  
  <pre><code>#!/usr/bin/env python2
  
  import cv2
  import os
  import numpy as np
  
  
  class myClass:
  
      def __init__(self): pass
  
      def myTestfunction2(self):     
          image= cv2.imread("/home/John/Desktop/image1.jpg")
          cv2.imshow("image", image)
  
      def myTestFunction(self, a):
          print('my test function showing passed image as parameter')
          cv2.imshow('a', a)        
          cv2.waitKey(0)
          return ('John', a)
  </code></pre>
  
  <p>Note that this line, to stream the parameters in stead of the one currently in my software works perfectly fine:</p>
  
  <pre><code>params&lt;&lt; "-c" &lt;&lt; "import cv2; import imp; foo = imp.load_source('myTest', '/home/John/fw/demos/myTest.py'); from myTest import myClass; myClassObj = myClass(); print myClassObj.myTestFunction(cv2.imread('/home/John/Desktop/image1.jpg'));";
  </code></pre>
  
  <p>But it doesn t do exactly what I need, I need to pass a cpp variable rather than using cv2.imread()</p>