Attaching/detaching items from a different thread is definitely not thread safe !

To make it safe you would have at least to introduce a mutex to avoid that attaching/detaching and iterating over the items in the replot operation do conflict.

For guarding the replot it is probably best to overload QwtPlot::replot(), where you do the mutex stuff before calling the base class.

Uwe