QPainter painter(&printer);scene.render(&painter);
QGraphicsView tmp_view(this); QGraphicsScene tmp_scene(this); tmp_view.setScene(&tmp_scene); QPrinter printer; QPainter painter(&printer); QSize s(1024, 768); scene.setSceneRect(QRectF(QPointF(0,0), s)); scene.addRect(QRectF(QPointF(0,0), s), QPen(), QBrush(Qt::white)); //Вариант 1. 693 Кб //scene.addRect(QRectF(QPointF(100,100), QPoint(1000, 690)), QPen(Qt::DotLine)); //Вариант 2. 1,62 Кб scene.addRect(QRectF(QPointF(100,100), QPoint(1000, 690)), QPen(Qt::SolidLine)); tmp_view.show(); scene.render(&painter);