PDA

View Full Version : QPrintPreviewDialog.



cydside
19th June 2009, 08:53
Hi to all,
how can I run a QPrintPreviewDialog "maximized" and "Fit To Width" (without create a my own QPrintPreviewWidget) ?
thanks!!!

Lykurg
19th June 2009, 11:37
Hi,

you could use:

QPrintPreviewDialog dlg(&printer, this);
dlg.showMaximized();
QList<QPrintPreviewWidget *> list = dlg.findChildren<QPrintPreviewWidget *>();
if(!list.isEmpty()) // paranoiac safety check
list.first()->setZoomMode(QPrintPreviewWidget::FitToWidth);

Lykurg

cydside
19th June 2009, 18:31
Great!!!!!!!!!!!!!!!!!!!
Please Lykurg send me your snapshot, I will replace the one on my desktop :D

Thanks!