title: c++ QT and OpenCV. setMouseCallBack in QLabel?
body: <p>I'm using the function setMouseCallback to extract the information about pixel coordinates at every mouse event. The program I created works perfectly if I use openCV windows. Precisely:</p>
  
  <p>image is cv::Mat;</p>
  
  <pre><code>cv::namedWindow("Original", WINDOW_NORMAL);
  cv::imshow("Original", image);
  
  cv::setMouseCallback("Original", mouseWrapper, NULL);
  </code></pre>
  
  <p>where</p>
  
  <pre><code>void esempio::onMouse(int event, int x, int y, int flags, void *param)
  {
  //---------------------------------------------------------
  // Code to read the mouse event in the identification of a point
  //---------------------------------------------------------
      if (event == CV_EVENT_LBUTTONDOWN)
          {
              std::cout &lt;&lt; "1: " &lt;&lt; x &lt;&lt; "," &lt;&lt; y &lt;&lt; std::endl;
              pp_m.x=x;
              pp_m.y=y;
          }
  }
  
  void mouseWrapper( int event, int x, int y, int flags, void* param )
  {
      esempio * mainWin = (esempio *)(param);
      mainWin-&gt;onMouse(event,x,y,flags,0);
  }
  </code></pre>
  
  <p>Now, I would like to use the same code in a QLabel created in my interface. I tried to use the function setWindowTitle to change the name of the QLabel in this way:</p>
  
  <pre><code>ui-&gt;label_show-&gt;setWindowTitle("Test");
  cv::setMouseCallback("Test", mouseWrapper, NULL); 
  </code></pre>
  
  <p>but this approach seems not adequate. </p>
  
  <p>How can I indicate to the function setMouseCallback to work on the desired QLabel?</p>
  
  <p>Thanks</p>