I'm working with the QT Example "image viewer". Now I open an image like this:

Qt Code:
  1. QString fileName = QFileDialog::getOpenFileName(this,
  2. tr("Open File"), tr("C:"));
  3. if (!fileName.isEmpty()) {
  4. QImage image(fileName);
  5. if (image.isNull()) {
  6. QMessageBox::information(this, tr("Image Viewer"),
  7. tr("Cannot load %1.").arg(fileName));
  8. return;
  9. }
  10. imageLabel->setPixmap(QPixmap::fromImage(image));
  11. }
To copy to clipboard, switch view to plain text mode 
imageLabel is QLabel.

Well, I want to draw something (circle, ellipse...) on the image every time I clicked (at mouse position). I have the mouse position (x, y). But I can't draw nothing. I would still see the image.

What I've done?
Qt Code:
  1. void SubQLabel::paintEvent(QPaintEvent *event){
  2. painter.begin(this);
  3. painter.setBackgroundMode(Qt::TransparentMode);
  4. painter.setCompositionMode(QPainter::CompositionMode_DestinationOver);
  5. painter.drawEllipse(10,10,10,10);
  6. painter.end();
  7. }
To copy to clipboard, switch view to plain text mode 
I subclased the QLabel I I override the paintEvent. But the image dissapears and it shows the Ellipse with white background.

I would like to put a lot of points and delete this points on image.

How can I do that?