PDA

View Full Version : How to use Qt print preview?



tiaoweiliao
3rd June 2016, 08:34
hi all.

i use Print Preview , but I found some problems , I could not resolve this.

problem 1:
i use QPrintPreviewDialog has toolbar(Qt Provide), but i do not want run modally .
so i use QPrintPreviewWidget , this is not modal , but I can't find toolbar ,This makes me very disappointed.

problem 2:
how to set page width scale PrintPreview window width ? in QPrintPreviewDialog toolbar , i found "fit the page width" button ,but i don't know call in code.

ChrisW67
4th June 2016, 22:05
1. If you don't want a modal dialog then call show() instead of exec()
2. QPrintPreviewWidget::setZoomMode()

tiaoweiliao
7th June 2016, 07:14
thx , I seriously do not before. i use dialog show() is work.