Qt Code:
  1. // draw plotter line using QPainter function drawPolyline
  2. void GenePlotter::drawPlotterLine(QPainter *painter)
  3. {
  4. QRect rect(Margin, Margin,
  5. width() - 2 * Margin, height() - 2 * Margin);
  6. if (!rect.isValid())
  7. return;
  8.  
  9. painter->setClipRect(rect.adjusted(+1, +1, -1, -1));
  10.  
  11. //draw best lines
  12. painter->setPen(QPen(Qt::red,1.0));
  13. const QPointF* point=bestPoints.data(); //bestPoints is a vector
  14. painter->drawPolyline(point,bestPoints.size());
  15.  
  16.  
  17.  
  18. //draw average line
  19. painter->setPen(QPen(Qt::blue,1.0)); //X is the same
  20. point=avgPoints.data(); //avgPoints is also a vector
  21. painter->drawPolyline(point,avgPoints.size());
To copy to clipboard, switch view to plain text mode 

Is that any problem in the above code? That's something wrong, But I cann't tell. It fails to draw the average line.

Thanks