Several days ago I posted this question(I don't know if it's proper to open a new thread... however when I get the answer from this post I will close that one): QGLWidget not working correctly under Mac OS X Lion .
I grabbed some example code online, compared them with mine, and confirmed the problem is raised by:
gluOrtho2D(0, w, 0, h);
and after changing it to:
glOrtho(0, w, 0, h, -1, 1);
and removed glu as dependency, my program worked. why? what's the difference?