I do this because I do the calculations behind the data display in a worker thread, and call replot() when they are done. I use a Qt::BlockingQueuedConnection for this and have an assert() statement which guarantees that replot() is only ever getting called from the main thread.
I did try setAutoReplot(), and commented out my call to replot(), but the program crashed immediately, segfaulting in QwtPlot::drawItems. I also got this warning: "QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread".
Bookmarks