I still trying to find the fastest way to draw line with outline. Currently it work with next code:

Qt Code:
  1. void TestWidget::paintEvent(QPaintEvent *)
  2. {
  3. QPainter painter(this);
  4. painter.setRenderHints(QPainter::Antialiasing);
  5. path.moveTo(100,50);
  6. path.lineTo(600,50);
  7. path.lineTo(700,400);
  8. path.lineTo(50,400);
  9. path.moveTo(300,50);
  10. path.lineTo(300,450);
  11. QPen pen(QColor(255, 0, 0));
  12. painter.setPen(pen);
  13. QBrush brush(QColor(255,255,0));
  14. painter.setBrush(brush);
  15. stroker.setWidth(10);
  16. stroker.setCapStyle(Qt::RoundCap);
  17. stroker.setJoinStyle(Qt::RoundJoin);
  18. path = stroker.createStroke(path);
  19. painter.drawPath(path);
  20. }
To copy to clipboard, switch view to plain text mode 

But how can I remove artefacts inside the lines at connection points? It have to look like roads on a map? without inner cross lines.
path.pngpath.png