#include "../../headers/test_headers/dialog.h"#include "ui_dialog.h"#include <QtCore>#include <QtGui>Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog){ ui->setupUi(this);}Dialog::~Dialog(){ delete ui;}void Dialog::paintEvent(QPaintEvent *){ QGraphicsScene* scene; scene = new QGraphicsScene(this); scene->setBackgroundBrush( Qt::white ); QPen pen( Qt::black ); pen.setWidth( 1 ); QBrush br( Qt::white ); qreal w = 80.0; int numbers = 10000; for(int i = 0; i < numbers; i++){ scene->addRect(QRectF(0.0, 100.0 + i*100, 80.0, 80.0),pen, br); if(i != numbers - 1) scene->addLine(QLineF(40.0, w + (i+1)*100, 40.0, w + (i+1)*100 + 20),pen); scene->addRect(QRectF(150.0, 100.0 + i*100, 80.0, 80.0),pen, br); if(i != numbers - 1) scene->addLine(QLineF(190.0, w + (i+1)*100, 190.0, w + (i+1)*100 + 20),pen); scene->addRect(QRectF(300.0, 100.0 + i*100, 80.0, 80.0),pen, br); if(i != numbers - 1) scene->addLine(QLineF(340.0, w + (i+1)*100, 340.0, w + (i+1)*100 + 20),pen); scene->addRect(QRectF(450.0, 100.0 + i*100, 80.0, 80.0),pen, br); if(i != numbers - 1) scene->addLine(QLineF(490.0, w + (i+1)*100, 490.0, w + (i+1)*100 + 20),pen); } ui->graphicsView->setScene(scene);}
C++ (Qt)void Dialog::paintEvent(QPaintEvent *){ QGraphicsScene* scene; scene = new QGraphicsScene(this);