Hi,
I am trying to get printing service to work in my simple program. I am doing it in this way:
#include <QtPrintSupport/QPrintDialog>
#include <QtPrintSupport/QPrinter>
#include <QtPrintSupport/QPrintDialog>
#include <QtPrintSupport/QPrinter>
To copy to clipboard, switch view to plain text mode
And than I get the code in my print button.
void MainWindow::on_printButton_clicked()
{
if (printDialog.
exec() == QDialog::Accepted) { ui->textBox->print(&printer);
}
}
void MainWindow::on_printButton_clicked()
{
QPrinter printer;
QPrintDialog printDialog(&printer, this);
if (printDialog.exec() == QDialog::Accepted) {
ui->textBox->print(&printer);
}
}
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.
Bookmarks