Hello everyone I am new to this forum and I enjoy a bit of time with QT 5.7 I've created a first graphical interface, but now I have a problem where I'm stuck printing LineEdit.
I post the code I was able to print in the textEdit text but if you want to print in a LineEdit simply replacing the previous me error:


void MainWindow:n_actionPrint_triggered()
{
QPrinter printer;
printer.setPrinterName("desierd printer name");
QPrintDialog dialog(&printer,this);
if(dialog.exec() == QDialog::Rejected) return;
ui->textEdit->print(&printer);
}


If as I said now I replace the textEdit the LineEdit me error will be changed because of something that row but do not know how ...

And also I should print various LineEdit not only so do not know even then how to assemble the various LineEdit because they are printed in the correct position.

If anyone has a solution thank you in advance.