Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
4.4.2
-
None
Description
When implementing a slot connected to QPrintPreviewWidget::paintRequested(), you would assume that you can use the same painting commands you use to create printed output. However, for some reason, the scale of graphics in the print preview depends on the resolution of the screen: output shown on a low resolution screen will overflow the page boundaries, for example.
See this thread for more information:
http://lists.trolltech.com/pipermail/qt-interest/2008-December/000305.html
The user's implementation of the slot:
void ReportTest::print(QPrinter *printer)
{
QPainter painter(printer);
painter.setRenderHints(QPainter::Antialiasing |
QPainter::TextAntialiasing |
QPainter::SmoothPixmapTransform, true);
QRect rect(QPoint(30, 30), QSize(750, 30));
painter.drawRect(rect);
//printer->newPage();
}