Qt 4.6.0 (SDK for Windows with MinGW)
Hello!
Here is the minimum example:
mainwindow.cpp :
Qt Code:
  1. #include <QGraphicsView>
  2. #include "mainwindow.h"
  3. #include "myscene.h"
  4.  
  5. MainWindow::MainWindow(QWidget *parent)
  6. : QMainWindow(parent)
  7. {
  8. MyScene* s = new MyScene(this);
  9. s->setSceneRect(-1000,-1000,3000,3000);
  10. setCentralWidget(v);
  11. }
To copy to clipboard, switch view to plain text mode 
myscene.cpp:
Qt Code:
  1. #include <QGraphicsEllipseItem>
  2. #include <QGraphicsSceneMouseEvent>
  3. #include "myscene.h"
  4.  
  5. MyScene::MyScene(QObject *parent) :
  6. {
  7. }
  8. void MyScene::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent * e )
  9. {
  10. QRectF circleRect(0,0,600,600);
  11. circleRect.moveCenter(e->scenePos());
  12. el->setPen(QPen(Qt::red, 4, Qt::DashLine));
  13. addItem(el);
  14. }
To copy to clipboard, switch view to plain text mode 
main.cpp, myscene.h and mainwindow.h are the default as generated by QtCreator (except that I added mouseDoubleClickEvent declaration to myscene.h).
When I double click in the corner of the view, the ellipse appears (Only part of it fits in the view and that's OK), and when I scroll the view to the right, I see this:

If I use Qt::SolidLine, everything is fine, but with Qt:ashLine and all other styles I see this painting artefact.
Thanks in advance.