Hi,
I am try to run GL commands inn QGraphicsitem in paint event using beginnavitepaining.But its not working.
when I try GLwidet its work which shows gl support in my system.I need to paint in my graphicsitem.
Please help
Hi,
I am try to run GL commands inn QGraphicsitem in paint event using beginnavitepaining.But its not working.
when I try GLwidet its work which shows gl support in my system.I need to paint in my graphicsitem.
Please help
Did you create rendering context by your self within the beginNativePainting()? I guess it's not working because QGraphicsItem does not prepare OpenGL rendering context while QGLWidget does for you.
If you can describe bit more about what is not working (i.e. no refresh) it might be easier to find out the reason.
Regards,
Dong Back Kim
moh.gup@gmail.com (15th August 2011)
Hi,
I am trying to paint in item using garphicssitem
Qt Code:
{ painter->fillRect(0, 0, 128, 128, Qt::green); painter->beginNativePainting(); // Set background clearing color to blue glClearColor(0.0f, 0.0f, 1.0f, 1.0f); // Clear the window with current clearing color glClear(GL_COLOR_BUFFER_BIT); // Set drawing color to red, and draw rectangle at // current position. glColor3f(1.0f, 0.0f, 0.0f); glRectf(128, 128, 200, 200); //glFlush(); painter->endNativePainting(); }To copy to clipboard, switch view to plain text mode
Can any body have idea abt my problem.Its urgent for me
Bookmarks