You can always put a breakpoint in the line printing the error and look at the call stack to see where is it coming from. It could be a repaint called from non-ui thread or a direct call to paintEvent from somewhere.