Hello,

I want to use QPainter to draw very simple lines and points. I checked the docs and wanted to copy the example, but the following code doesn't work:

Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication app(argc, argv);
  4. QWidget fenster1;
  5. fenster1.resize(400,400);
  6.  
  7.  
  8. QPainter achsen(&fenster1);
  9.  
  10. achsen.setPen(QPen(Qt::blue,2));
  11.  
  12. achsen.drawPoint(200,100);
  13.  
  14. achsen.drawLine(100,100,301,301);
  15.  
  16. fenster1.show();
  17.  
  18. return app.exec();
  19. }
To copy to clipboard, switch view to plain text mode 

It doesn't return an error, but I can neither see the line nor the point. It just displays an empty window. Where is the mistake?

Thanks.