Display a pricture from the MainWidow's slot function
General and Desktop
1
Posts
1
Posters
744
Views
1
Watching
-
Dear All,
I have a thread for the image capturing and whenever new image is captured, MainWindow's SLOT method (newImageReceivedInformed()) is called. SIGNAL and SLOT connection works well, i have tested already.
Now I am testing with offline image and when plot() is called from newImageReceivedInformed(), test.png is not displayed. Only displayed when plot() is called from MainWindow's any other methods. What could be the problem?
@
void MainWindow::newImageReceivedInformed(imageData receiveImage)
{
plot();
}void MainWindow::plot()
{
QImage *qImg;
QPixmap pixma;qImg = new QImage(); if(!(qImg->load("/home/user/Desktop/test.png"))) { qWarning("ERROR"); } pixma = QPixmap::fromImage(*qImg); pixmaItem->setPixmap(pixma); scene->addItem(pixmaItem); view->setScene(scene); scene->setSceneRect(0,0,300,200); view->setRenderHints(QPainter::Antialiasing); view->show(); delete qImg;
}@
[Edit: Added @ tags for formatting -- mlong]