I manage to solve the problem by using OpenGL to draw the viewport borders using Ortho projection instead of Widget style. Still it seems more correct to draw using Widget style. Is there a way to draw the border of OGLWidget-derived widget using Widget style?
Bookmarks