I need to display an IplImage (OpenCV structure) I can’t use QPixmap because I am updating from another thread which gives me an error that it’s unsafe.Now I am using paintEvent
I am using Signals and Slots , Here is the Slot where I receive the image:
void MainWindow::Show(IplImage *frame)
{
img = QImage(QSize(frame->width,frame->height),QImage::Format_RGB888);
// I need to show img now on ui->frame
// if I use this->update it show a strange image !!
}
Here is the paint event:
void MainWindow::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.drawImage(QPoint(ui->frame->x(),ui->frame->y()),img);
}
but I don’t know how to call the paint event.
↧