QPrinter does not print anything
Hi all,
is the first time I use QPrinter, what I want is a simple print test using QPrintDialog to setup printer properties (my qt version is 4.2 and CUPS as printing system).
The problem is that after press 'Print' button in the setup dialog nothing happen and printer queue are always empty. It works only if print program (like lpr) is set with printer->setPrintProgram("lpr"). I'm confused about this because I supposed that print program was automatically defined by printing system... but it seems not.
In Kde application I can print with no problem.
Thanks to all for suggestion,
Marco
Code:
void MainWindow::printScore()
{
if (!printer)
printer->setPrintProgram("lpr"); // without this line no print!
if (printDialog.
exec() == QDialog::Accepted) {
pp.drawLine( 10, 10, 100, 100 );
pp.end();
}
}