Hello all,

I am experience a problem where if I try to draw with pen/tablet input, the widget will draw a line along with circles at points periodically. Such as the following:
problem.png
The code(in context of QTabletEvent, QMouseEvent is coded the same way):
Qt Code:
  1. bool deviceDown = false;
  2. QPoint drawPath[3];
  3.  
  4. void Editor::TabletEvent(QTabletEvent* event)
  5. {
  6. if(event->type() == QEvent::TabletPress)
  7. {
  8. deviceDown = true;
  9. drawPath[2] = drawPath[1] = drawPath[0] = event->pos();
  10. }
  11. if(event->type() == QEvent::TabletRelease)
  12. {
  13. if(deviceDown == true){deviceDown = false;}
  14. }
  15.  
  16. if(event->type() == QEvent::TabletMove)
  17. {
  18. drawPath[2] = drawPath[1];
  19. drawPath[1] = drawPath[0];
  20. drawPath[0] = event->pos();
  21.  
  22. /* DRAW CODE - Commented out due to actual code residing in another class/function.
  23.   QPainter painter(&pixmap);
  24.   painter.drawLine(drawPath[1], event->pos());
  25.   */
  26. }
  27. }
To copy to clipboard, switch view to plain text mode 

I have attempted to use a single point as the last known point, but that failed. Using a QPoint array seams to be the only way to get the widget to draw any lines correctly.