I want paint some circle by press the mouse button.
Qt Code:
  1. void GraphArea::mousePressEvent1(QMouseEvent *event)
  2. {
  3. if (event->button() == Qt::LeftButton) {
  4. show = true;
  5. }
  6. }
  7.  
  8. void GraphArea::paintEvent(QPaintEvent * /*event*/)
  9. {
  10. QPainter painter(this);
  11. if (show)
  12. paintCircle1(painter);
  13. }
To copy to clipboard, switch view to plain text mode 

It works...
...but my plan/problem is: if i press mouse button 2nd time, then paint 2nd circle, to third press clear the whole widget - I don't know how to do it!

PS.: sorry for my english...