I have such a code, according to my logic, it must assign what is entered in QLineEdit - serialNumberText , the variable serialnumberPDF .
But I get the error:
"C ++ cannot convert QLineEdit to char"
Code:
QLineEdit *serialNumberText; char serialnumberPDF[3]; void Main::finish(){ strcpy(serialNumberText, serialnumberPDF); // ОСТАЛЬНОЙ КОД // } How it works, I have QLineEdit , where I enter for example 4005, then I click on the " Finish " button, now the program should from serialNumberText save the number to the variable serialnumberPDF , and then save it to a PDF file - .arg(serialnumberPDF)
I add the code on request:
char serialnumberPDF[3]; void Main::finish(){ if (sdRemoveCheck->isChecked()){ QByteArray text = serialNumberText->text().toLocal8Bit(); text.resize(sizeof(serialnumberPDF) -1); strcpy(serialnumberPDF, text.data()); pdf_creation2(); close(); }else{ QMessageBox messageBox; messageBox.critical(0, "Error", "Remove first mircoSD Card"); messageBox.setFixedSize(500, 200); } QString SerialNumber = QString("<tr class=\"method\">" "<th style=\"background: #e3e4e4;\">S/N</th>" "<td>%1</td>" "<td></td>" "</tr>").arg(serialnumberPDF);
serialNumberText. - αλεχολυτserialNumberPDFtoo. - aleks.andr