Hi
I need to mixed shader render opengl with QPainter that render on QwtPolarPlot that is inside of draw function of QwtPolarItem!!!
but how can do this?
I do that but don't see anything with follow code:
Qt Code:
  1. class Item :public QwtPolarItem
  2. {
  3.  
  4.  
  5. void draw(QPainter *painter, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap,
  6. const QPointF &pole, double radius, const QRectF &canvasRect)
  7. {
  8. Q_UNUSED(center);
  9. Q_UNUSED(elapsed);
  10.  
  11. painter->scale(0.1, 0.1);
  12. painter->setPen(...);
  13.  
  14. painter->setRenderHint(QPainter::HighQualityAntialiasing);
  15.  
  16. painter->drawPie(...);
  17.  
  18. painter->setPen(...);
  19. painter->drawEllipse(...);
  20. painter->setPen(...);
  21. painter->drawLine(...);
  22.  
  23. painter->setPen(...);
  24. painter->drawEllipse(...);
  25.  
  26. painter->save();
  27.  
  28. QMatrix mx;
  29. mx.reset();
  30. painter->setMatrix(mx);
  31.  
  32. painter->beginNativePainting();
  33. glClearColor(0, 0, 0, 1);
  34. glClear(GL_COLOR_BUFFER_BIT);
  35. glLoadIdentity();
  36. //glTranslatef(center.x(), center.y(), 0);
  37. glColor3b(255, 255, 255);
  38.  
  39. glBegin(GL_LINES);
  40. glVertex2d(0, 0);
  41. glVertex2d(100, 0);
  42. glVertex2d(0, 100);
  43. glVertex2d(100, 100);
  44. glEnd();
  45. glFlush();
  46. painter->endNativePainting();
  47.  
  48. painter->restore();
  49. }
  50. ...
  51. }
To copy to clipboard, switch view to plain text mode 

Also I know some mistake for example don't set clear color and clear color buffer and flush buffer.
Also I must render first painter then opengl.
please answer me for this code and typical way to render and please say any problem you see in my code.
thanks.