I found several clues there days, maybe it is not the problem of antialias,
I tried to draw an image and an text and then printed them to a pdf file,
Here is the part of the test code:
void MyWidget
::slotPaintRequested(QPrinter *printer
)
{
painter.
drawImage(QPoint(0,
10), image1
);
font.setPointSize(10);
painter.setFont(font);
painter.
drawText(QPoint(20,
30),
"Hello World");
painter.
drawImage(QPoint(100,
10), image2
);
}
void MyWidget::slotPaintRequested(QPrinter *printer)
{
QPainter painter( printer );
QImage image1("E:/aaa.png");
painter.drawImage(QPoint(0, 10), image1);
QFont font;
font.setPointSize(10);
painter.setFont(font);
painter.drawText(QPoint(20, 30), "Hello World");
QImage image2("E:/aaa.png");
painter.drawImage(QPoint(100, 10), image2);
}
To copy to clipboard, switch view to plain text mode
here is the picture:
preview.jpgpdf.jpg
The first pic is the one showed in preview dialog, the second is the one in the pdf file(both zoom out to 800%).
We can see the image in pdf file is blured and the text near to the image was affected too.
In some complex situations(some images in the scene), these images would affected the most area.
I could not find the solution yet, is there any method to avoid there problem?
Bookmarks