title: MouseCallback Function OpenCV
body: <p>I have a problem with OpenCV. I have tried the implementation from in other questions but problem remains again. I have a class called <strong>MainWindow</strong> and at some point in that class it creates a <strong>NamedWindow</strong> called "rectified". In my main function Im trying to add a listener to catch click events on that <strong>cvNamedWindow</strong> instance. The problem is that on_mouse function has no response. Here is my main method:</p>
  
  <pre><code>static void on_mouse( int event, int x, int y, int flags, void *param)
  {
       qDebug("hjhv00");
       MainWindow * mw=(MainWindow*)param;
       if(mw-&gt;getMyVision()-&gt;getCalibrationDone())
       {
          if(event==CV_EVENT_LBUTTONDOWN){
             qDebug("%d&lt;----&gt;%d",x,y);
          }
       }
  }
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      MainWindow w;
      int mouseParam=5;
  
      w.show();
      cvSetMouseCallback("rectified",on_mouse,&amp;w);
  
      return a.exec();
      // test svn
      // test from google
  }
  </code></pre>