Hi,

I am trying to get printing service to work in my simple program. I am doing it in this way:

Qt Code:
  1. #include <QtPrintSupport/QPrintDialog>
  2. #include <QtPrintSupport/QPrinter>
To copy to clipboard, switch view to plain text mode 

And than I get the code in my print button.

Qt Code:
  1. void MainWindow::on_printButton_clicked()
  2. {
  3. QPrinter printer;
  4. QPrintDialog printDialog(&printer, this);
  5. if (printDialog.exec() == QDialog::Accepted) {
  6. ui->textBox->print(&printer);
  7. }
  8. }
To copy to clipboard, switch view to plain text mode 

I get a lot of "undefined reference" errors to QPrintDialog and QPrinter.
If You could drop me some hint.