I'm trying to capture live view from camera, and redirecting it to show up on QLabel.
But only half view comes (see below):

The left hand side window, is shown using cv::imshow(), which works perfectly. I'm capturing the Mat in a different thread, and then emitting a signal with a Qimage as a parameter, and then setting the image to the QLabel in the slot.
here's the code:
while(true){
cam >> mat;
cv::imshow("name",mat);
emit send_UIupdate(mat2qimage(mat));
}
and in the slot setting the image to Qlabel:
void Dialog::updateUI(const QImage &img){
label->setPixmap(QPixmap::fromImage(img));
}
using the below to convert Mat to QImage:
QImage camera::mat2qimage(const cv::Mat& mat) {
cv::Mat rgb;
cv::cvtColor(mat, rgb, CV_BGR2RGB);
return QImage((const unsigned char*)(rgb.data), rgb.cols, rgb.rows, QImage::Format_RGB888);
}
Any suggestions, to solve this problem ??