I will rename this function to swapGl(), because it is only needed for GL widgets. With normal widgets we cannot control manually swap. The dynamic cast is already done in WaveformWidgetFactory::swap().