I finally noticed that the tar_widget
was a QGLWidget, That was the problem.
I've learned that the QGLWidget would attach an openGL context, as I moved it into another widget, the context could not move to the new parent widget(on Windows), as the document said.
The solution is to use a dummy widget as the parent of tar_widget
and move the dummy widget into another widget.