PDA

View Full Version : QPainterPath cannot work with OpenGL?



superwave
25th June 2011, 22:44
For a simple OpenGL code:

void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);

glColor3f (0.0, 1.0, 0.0);
glPushMatrix();
glRotatef(-rotAngle, 0.0, 0.0, 0.1);
glBegin (GL_LINES);
glVertex2f (-0.5, 0.5);
glVertex2f (0.5, -0.5);
glEnd ();
glPopMatrix();

glColor3f (0.0, 0.0, 1.0);
glPushMatrix();
glRotatef(rotAngle, 0.0, 0.0, 0.1);
glBegin (GL_LINES);
glVertex2f (0.5, 0.5);
glVertex2f (-0.5, -0.5);
glEnd ();
glPopMatrix();

glFlush();
}

I mean, whether I could add the lines drawn by OpenGL as a path defined by QPainterPath ?

Then I could operate using the "path" more easily.

Thanks a lot

wysota
26th June 2011, 11:35
I think what you really want is a vector (e.g. a QVector) of coordinates and not a painter path.