title: QImage and QPixmap image display incorrect
body: <p>I am running OpenCV with QT on Ubuntu and have hit a problem with displaying an image using a QLabel.
  If I use the code:( where 'image' is a Mat created by dcraw):</p>
  
  <pre><code>Mat img_display;
  
  cv::cvtColor(image,img_display,CV_BGR2RGB); 
  
  imwrite("test.jpg",img_display);
  
  QImage img=QImage("test.jpg");  // QImage assignment
  
  QPixmap pixmap(QPixmap::fromImage(img));
  
  widget.image_label-&gt;setPixmap(pixmap); 
  </code></pre>
  
  <p>The image is output in colour and exactly as I would expect.</p>
  
  <p>However, when I replace the QImage assignment to use 'img_display' rather than the .jpg file, my image display starts to the right of the origin and has a triangle  overwriting the bottom right of the displayed image.  This triangle looks like it is half of the missing bit from the LHS of the image. The assignment code I am trying to use is:</p>
  
  <pre><code>QImage img=QImage(
      (uchar*)(img_display.data),
      img_display.cols,
      img_display.rows,
      QImage::Format_RGB888); 
  </code></pre>
  
  <p>image comes from a raw 18.2mb cr2 file and it was created by dcraw. test.jpg is 3.1mb</p>
  
  <p>Any feedback would be appreciated.</p>