title: Qt and OpenCV 2.0 integration problems
body: <p>I have a Qt application that uses OpenCV for image processing.</p>
  
  <p>Everything was working fine with OpenCV 1.0 but when I upgraded to
  OpenCV 2.0 it started crashing.
  I noticed that it only crashes whenever OpenCV functions are called
  inside Qt slots.</p>
  
  <p>For instance, the following slot:</p>
  
  <pre><code>void TestClass::on_testButton_clicked() {
     IplImage* src = cvLoadImage("test.jpg");
     IplImage* dst = cvCreateImage(cvGetSize(src), src-&gt;depth, src-&gt;nChannels);
     cvThreshold(src, dst, 100, 255, CV_THRESH_BINARY);
  }
  </code></pre>
  
  <p>crashes when testButton is clicked.</p>
  
  <p>However, if I call the same cvThreshold function in any other place,
  such as inside the main() function
  or inside the Widget constructor, it works fine. Also, if I put the
  same code in a separate function and
  call that function with QtConcurrent::run() inside the same slot, it
  works fine too.</p>
  
  <p>Why this behaviour? Are there any restrictions about the operations
  that can be done inside Qt slots? Which changes in OpenCV 2.0 functions
  may be causing the conflict?</p>
  
  <p>Thanks in advance</p>