hi!.
I'm using Qt 4.6 in GNU/Linux. i'm working with QGLWidget with kind of easiness but i've a problem when i want to change the color of the Lines.
I've tried all the combinations that i could think.
i've put the glColor after and befor de glBegin, use the qglColor, and glColor3f (and others glColors functions). But always it's a random color between blue and green (never red (i don't know why)).
What am i missing?

Qt Code:
  1. glBegin(GL_LINES);
  2. glColor3f(1.0f,0.0,0.0);
  3. glVertex2f(50,1);
  4. glVertex2f(120,1);
  5. glEnd()
  6. ;
To copy to clipboard, switch view to plain text mode 

this very basic code doesn't work

Qt Code:
  1. void Plot::paintGL()
  2. {
  3. glBegin(GL_LINES);
  4. glColor3f(1.0f,0.0,0.0);
  5. glVertex2f(50,1);
  6.  
  7. glVertex2f(120,1);
  8. glEnd();
  9. }
  10.  
  11. void Plot::initializeGL()
  12. {
  13. // Also i've tried a lot of combinations here. GL_FLAT and others.
  14. glClearColor(1.0, 1.0 , 1.0, 0.0);
  15. glLoadIdentity();
  16. glTranslatef(0,0.0,0);
  17. glDisable(GL_TEXTURE_2D);
  18. glDisable(GL_LIGHTING);
  19. glShadeModel(GL_SMOOTH);
  20.  
  21. }
  22.  
  23.  
  24. void Plot::resizeGL(int w, int h)
  25. {
  26. glViewport( 0, 0, (GLint)w, (GLint)h );
  27. glMatrixMode( GL_PROJECTION );
  28. glLoadIdentity();
  29.  
  30. glOrtho( 0, 800, yMin, yMax, -5.0, 1.0 );
  31. glMatrixMode( GL_MODELVIEW );
  32.  
  33. }
To copy to clipboard, switch view to plain text mode