So I'm trying to print a window from my application, and use the following code:
QPrinter *printer = new QPrinter;
printer->setResolution(1200);
QPrintDialog *printDialog = new QPrintDialog(printer, this);
if (printDialog->exec() == QDialog::Accepted) {
QPainter p(printer);
QPixmap pm = QPixmap::grabWidget(this);
p.drawPixmap(0,0,pm);
}
To test it I export the image to PDF, but what I get is very low resolution file. Any idea on how to make a high resolution zoomable image? Cause I am printing a graph which should be readable, as it has some small size values on it.