fpujol
25th January 2007, 16:50
Hello,
Now I'm creating a ticket for my supermaket application, so I need to print. My objective is to setFullPage to print in (0,0) coordinate, but this don't have effect always there's 3 or 4 white lines. And in the next code I put QPrinter::A4 but when it shows me the dialog always there's letter format.
QTextDocument *document = qTextEdit->document();
QPrinter printer;
printer.setFullPage(TRUE);
printer.setPageSize(QPrinter::A4);
QPrintDialog *dialog = new QPrintDialog(&printer, this);
dialog->setWindowTitle(tr("Print Document from aklibs"));
if (dialog->exec() != QDialog::Accepted)
return;
document->print(&printer);
Thank you.
Now I'm creating a ticket for my supermaket application, so I need to print. My objective is to setFullPage to print in (0,0) coordinate, but this don't have effect always there's 3 or 4 white lines. And in the next code I put QPrinter::A4 but when it shows me the dialog always there's letter format.
QTextDocument *document = qTextEdit->document();
QPrinter printer;
printer.setFullPage(TRUE);
printer.setPageSize(QPrinter::A4);
QPrintDialog *dialog = new QPrintDialog(&printer, this);
dialog->setWindowTitle(tr("Print Document from aklibs"));
if (dialog->exec() != QDialog::Accepted)
return;
document->print(&printer);
Thank you.