Printing: check for different printing modes

Add PRINT/PREVIEW print modes, check for printing modes before
casting.

We must pass a QPaintDevice with type QPixmap for previewing and
with type QPrinter for actual printing.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Gehad elrobey 2015-07-10 21:30:18 +02:00 committed by Lubomir I. Ivanov
parent 142fd950c8
commit 3a69638366
3 changed files with 17 additions and 4 deletions

View file

@ -45,7 +45,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f
optionsWidget = new PrintOptions(this, &printOptions, &templateOptions);
// create a new printer object
printer = new Printer(&qprinter, &printOptions, &templateOptions);
printer = new Printer(&qprinter, &printOptions, &templateOptions, Printer::PRINT);
QVBoxLayout *layout = new QVBoxLayout(this);
setLayout(layout);