I am emitting a signal from a worker thread and connecting it to a slot in GUI thread of MainWindow.
In the slot I am invoking a QMessageBox and displaying some error message.
Now I want the worker thread to stop working until I click OK on the QMessageBox.
Here is how I am doing it:
//worker thread
emit CameraDisconnectSignal("no camera present");
emit CameraDisconnectSignal("no camera present");
To copy to clipboard, switch view to plain text mode
//GUI thread
void MainWindow
::CameraDisconnectSlot(QString q
) {
messageBox.critical(0,"Error",q);
messageBox.setFixedSize(500,200);
}
void MainWindow::CameraDisconnectSlot(QString q)
{
QMessageBox messageBox;
messageBox.critical(0,"Error",q);
messageBox.setFixedSize(500,200);
}
To copy to clipboard, switch view to plain text mode
First of all I am not able to get any MessageBox and secondly I want to stop worker thread till the user clicks OK on GUI thread.
How can I acheive this??
Bookmarks