I have sent the pixel data using QImage as follows:
for (int x=0;x<400;x++)
for (int y=0;y<700;y++)
myImage.setPixel(x,y,qRgb(Buffer_in[y][x*3],Buffer_in[y][x*3+1],Buffer_in[y][x*3+2]));
emit ImageRefreshSignal(myImage.copy(0,0,400,700));
QImage myImage(400,700,QImage::Format_RGB888);
for (int x=0;x<400;x++)
for (int y=0;y<700;y++)
myImage.setPixel(x,y,qRgb(Buffer_in[y][x*3],Buffer_in[y][x*3+1],Buffer_in[y][x*3+2]));
emit ImageRefreshSignal(myImage.copy(0,0,400,700));
To copy to clipboard, switch view to plain text mode
and used the slot as follows:
void Dialog_user
::ImageRefreshSlot(QImage img
) {
qDebug()<<"inside slot";
ui
->label
->setPixmap
(QPixmap::fromImage(img
));
}
void Dialog_user::ImageRefreshSlot(QImage img )
{
qDebug()<<"inside slot";
ui->label->setPixmap(QPixmap::fromImage(img));
}
To copy to clipboard, switch view to plain text mode
still the label containg the image is not getting refreshed.
The slot is being called correctly and the debug message "Inside slot" is being printed.
Bookmarks