Hi.

Is there any way that we can get points (or polygons) from outline strokePath, generated by QPainter::strokePath function?

I Was able to get access to points inline stroke (marked as green,yellow lines on attached screen) by doing this:

Qt Code:
  1. QPolygonF polygon = path.toFillPolygon();
  2. for(int i=0;i < polygon.count(); i++)
  3. {
  4. QLineF lineEdge;
  5. if(i != (polygon.count() - 1))
  6. {
  7. lineEdge.setPoints(polygon.at(i),polygon.at(i+1));
  8. }
  9. else
  10. {
  11. lineEdge.setPoints(polygon.at(i),polygon.at(0));
  12. }
  13.  
  14. if (i%2 == 0)
  15. {
  16. QPen pen(Qt::yellow, 4);
  17. painter->setPen(pen);
  18. }
  19. else
  20. {
  21. QPen pen(Qt::green, 4);
  22. painter->setPen(pen);
  23. }
  24. painter->drawLine(lineEdge);
  25. }
To copy to clipboard, switch view to plain text mode 

But how about outline point (marked as black line on attached screen) ? How can we get this?

qt-quest1.jpg