It seems the highgui library is the problem. I modified the qtIPL code to only use the cxcore library and the problem went away. This I think solves your problem, but I'm using too many highgui functions to get rid of them so it doesn't really help me. So I guess then that when integrating OpenCV with Qt one should stay away from the highgui functions. Here is the modified code:

Qt Code:
  1. #ifndef QTIPL_H
  2. #define QTIPL_H
  3. #include <QImage>
  4. #include <cxcore.h>
  5.  
  6. IplImage qtToCv(QImage* qImage);
  7. QImage cvToQt(IplImage* iplImage);
  8.  
  9. #endif // QTIPL_H
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. #include "qtIPL.h"
  2.  
  3. IplImage qtToCv(QImage* qImage)
  4. {
  5. IplImage* cvImage;
  6. cvImage = cvCreateImageHeader(cvSize(qImage->width(), qImage->height()), IPL_DEPTH_8U, 4);
  7. cvImage->imageData = (char*)qImage->bits();
  8. IplImage* colorImage = cvCreateImage( cvGetSize(cvImage), 8, 3 );
  9. cvCopy( cvImage, colorImage ); //cvConvertImage was just doing a copy
  10.  
  11. return *colorImage;
  12. }
  13.  
  14. QImage cvToQt(IplImage* iplImage)
  15. {
  16. cvSave( "tmpImg.bmp", iplImage );
  17. //do something to check if succesful
  18. QImage img("tmpImg.bmp");
  19.  
  20. return img;
  21. }
To copy to clipboard, switch view to plain text mode