title: Qt+ OpenCV video doesn't show on Qt Gui, but does in OpenCV show application
body: <p>I am attaching some parts of my code, </p>
  
  <pre><code>#include "mainwindow.h"
  #include "ui_mainwindow.h"
  #include "colorrecognition.h"
  
  
  MainWindow::MainWindow(QWidget *parent) :
  QMainWindow(parent),
  ui(new Ui::MainWindow)
   {
  
  ui-&gt;setupUi(this);
  //this-&gt;setStyleSheet("background-color: black;"); // set the background
  //capture = 0;
  // frame = 0;
  
  
  //interface
  //tabWidget = new QTabWidget;
  
  
  
  //start capturing a video
  //capture = cvCaptureFromCAM(0);
  //capture = cvCaptureFromAVI("videoExample.avi");
  
  
  
  
  //frame = cvQueryFrame(capture);
  
  tabWidget = new QTabWidget(ui-&gt;centralWidget);
  tabWidget-&gt;setObjectName(QString::fromUtf8("tabWidget"));
  tabWidget-&gt;setGeometry(QRect(20, 0, 801, 571));
  tabWidget-&gt;addTab(new ColorRecognition(), tr("Color Recognition"));
  
  Contour contour1;
  
  
  
  }
  
  
  MainWindow::~MainWindow()
  {
      delete ui;
  }
  
  
  //========================================================
  
  
  ColorRecognition::ColorRecognition(QWidget *parent){
  
  storage1 = cvCreateMemStorage(0);
  
  storage2 = cvCreateMemStorage(0);
  
   /*QFrame* frame1 = new QFrame(this);
   frame1-&gt;setObjectName(QString::fromUtf8("frame1"));
   frame1-&gt;setGeometry(QRect(20, 20, 761, 501));
   frame1-&gt;setFrameShape(QFrame::StyledPanel);
   frame1-&gt;setFrameShadow(QFrame::Raised);*/
  
   //start capturing a video
   capture = cvCaptureFromCAM(0);
   //capture = cvCaptureFromAVI("videoExample.avi");
  
   //print an error message in case you can't grab the frame
   if (!cvGrabFrame(capture)) { // capture a frame
           printf("couldn't grab a frame");
   }
  
  
   //First screen --- Color Identification ---
  
  //QObject::connect(ui-&gt;tabWidget, SIGNAL(currentChanged(int)), this, SLOT(color_Recoginition()));
  
  
   //set timer for 50ms intervals
  
   QTimer* m_timer = new QTimer(this);
  
   connect(m_timer, SIGNAL(timeout()), this, SLOT(color()));
  
   m_timer-&gt;start(100);
  }
  
      void ColorRecognition::paintEvent(QPaintEvent* e) {
  
      QPainter painter(this);
  
      painter.drawImage(10,10, qt_img);
  }
  
  
  
  void ColorRecognition::color(){
  
     frame = cvQueryFrame(capture);
  
     //CvSize imageSize = cvSize(frame-&gt;width,frame-&gt;height);
  
    //IplImage* resultImage = cvCreateImage(imageSize, 8, 3);
  
    //qDebug("Befroe manipulation");
  
    cvCvtColor(frame, frame, CV_BGR2RGB);
  
  //CvSize imageSize = cvSize(frame-&gt;width, frame-&gt;height);
  
  IplImage  **thresholdedImage = contour1.GetThresholdedImage(frame);
  
  //insert the resulted frame from the above function into the find contour function
  
  cvFindContours(thresholdedImage[0], storage1, &amp;contours1, sizeof(CvContour),
              CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0));
  
  cvFindContours(thresholdedImage[1], storage2, &amp;contours2, sizeof(CvContour),
              CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0));
  
  contour1.drawContour(contours1, storage1, frame, CV_RGB(255, 0, 0));
  
  contour1.drawContour(contours2, storage2, frame, CV_RGB(0, 255, 0));
  
  
  qt_img = QImage((unsigned char *)frame-&gt;imageDataOrigin,frame-&gt;width,frame-&gt;height,QImage::Format_RGB888);
  
  
      //release temp memory
  
      //cvReleaseMemStorage(&amp;storage1);
  
      //cvReleaseMemStorage(&amp;storage2);
  
      //cvReleaseMemStorage(&amp;contours1-&gt;storage); // check if that is correct
  
      //cvReleaseMemStorage(&amp;contours2-&gt;storage);*/
  
  
  //resultImage = contour1.colorIdentification(frame);
  
  //cvCvtColor(resultImage, resultImage, CV_BGR2RGB);
  
  //qDebug("After manipulation");
  
  
  
  this-&gt;update();
  
  }
  </code></pre>
  
  <p>the problem is that when I run this code I don't get anything on the screen, however when I run the code out Qt (only in OpenCV) the code was working with no problems </p>
  
  <p>Can anyone know what is the deal ?</p>