[Kst] branches/work/kst/kst1kde4/kst/src/libkstapp
Zongyi Zhang
freebody.kst at gmail.com
Thu Apr 15 00:26:02 CEST 2010
SVN commit 1114938 by zhang:
qprinter
M +8 -8 kstviewwindow.cpp
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstviewwindow.cpp #1114937:1114938
@@ -155,23 +155,23 @@
void KstViewWindow::immediatePrintToFile(const QString &filename) {
-/* xxx
- KPrinter printer(true, QPrinter::HighResolution);
- printer.setPageSize(KPrinter::Letter);
- printer.setOrientation(KPrinter::Landscape);
- printer.setOutputToFile(true);
+
+ QPrinter printer(QPrinter::HighResolution);
+ printer.setPageSize(QPrinter::Letter);
+ printer.setOrientation(QPrinter::Landscape);
+ printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(filename);
KstPainter p(KstPainter::P_PRINT);
p.begin(&printer);
- QPaintDeviceMetrics metrics(&printer);
- const QSize size(metrics.width(), metrics.height());
+ const QSize size(printer.width(), printer.height());
+
view()->resizeForPrint(size);
view()->paint(p, QRegion());
view()->revertForPrint();
p.end();
-*/
+
}
More information about the Kst
mailing list