I want to put the data from a QLabel/QLineEdit in a text file.
But when I do it like this:
void MainWindow::on_pushButton_3_clicked() //the smile = : o
{
return;
out << this->ui->naamLineEdit;
out << "\r\n";
}
void MainWindow::on_pushButton_3_clicked() //the smile = : o
{
QFile file("test.txt");
if (!file.open(QIODevice::Append | QIODevice::Text))
return;
QTextStream out(&file);
out << this->ui->naamLineEdit;
out << "\r\n";
}
To copy to clipboard, switch view to plain text mode
where naamLineEdit is the name of my QLineEdit, and my input is: test.
It puts this in the txt file:
0xb18da40
Same goes for:
out << this->ui->tijdLabel_2;
out << this->ui->tijdLabel_2;
To copy to clipboard, switch view to plain text mode
where tijdLabel_2 is the name of my QLabel.
It also puts a strange string in the text file.
Can someone help me out, I think it's fault with not converting/storing the QLineEdit/QLabel the right way.
Bookmarks