After spending around 10 working day, I figured out the problem. I have done two things:
1) Add this qtextream.h and qdatastream.h(if it complaints about this file as well) in a file which has this error.
2) There were some other errors as well like "None=0 where None is not defined". For this errors just move your platform dependent X11 header files after all qt headers.
I did it in file qeglpbuffer_p.h and moved #include <EGL/egl.h> after all other qt header files (kept it as last include file).
That made it working.
Cheers..