This should take a QWidget -- not all waveform renderers are QGLWidgets. You should do the dynamic_cast inside this method and call swapBuffers() if it's a QGLWidget. (For example -- the #else block of this is not QGLWidget-specific).