Can you show us the code from both threads that accesses the mutex?
Here is a mutex-free implementation, by the way:
connect(worker,
SIGNAL(newImage
(QImage)), widget,
SLOT(drawPic
(QImage)), Qt
::BlockingQueuedConnection);
//...
void Widget
::drawPic(QImage img
){ m_image = img;
update();
}
p.drawImage(m_image, ...);
}
connect(worker, SIGNAL(newImage(QImage)), widget, SLOT(drawPic(QImage)), Qt::BlockingQueuedConnection);
//...
void Widget::drawPic(QImage img){
m_image = img;
update();
}
void Widget::paintEvent(QPaintEvent *pe){
QPainter p(this);
p.drawImage(m_image, ...);
}
To copy to clipboard, switch view to plain text mode
Bookmarks