valgaba
4th January 2012, 18:48
According to this code .....
QDateTime dateTime = QDateTime::currentDateTime();
QString Hora = dateTime.toString("hh:mm:ss");
QString Fecha = dateTime.toString("dd-MM-yy");
QString Path=QCoreApplication::applicationDirPath().toLati n1();
QFile file(Path + "/Logs/" + Fecha + ".txt");
file.open(QIODevice::WriteOnly| QIODevice::ReadOnly| QIODevice::Text);
QTextStream out(&file);
while (!out.atEnd()) {
QString line = out.readLine();
}
out << Hora ;
out << "\n";
file.close();
}
The output file for example is:
10:30:20
10:30:21
10:30:22
10:30:23
....
...
....
How can we make the output be:?
10:30:23
10:30:22
10:30:21
10:30:20
....
...
....
thanks
QDateTime dateTime = QDateTime::currentDateTime();
QString Hora = dateTime.toString("hh:mm:ss");
QString Fecha = dateTime.toString("dd-MM-yy");
QString Path=QCoreApplication::applicationDirPath().toLati n1();
QFile file(Path + "/Logs/" + Fecha + ".txt");
file.open(QIODevice::WriteOnly| QIODevice::ReadOnly| QIODevice::Text);
QTextStream out(&file);
while (!out.atEnd()) {
QString line = out.readLine();
}
out << Hora ;
out << "\n";
file.close();
}
The output file for example is:
10:30:20
10:30:21
10:30:22
10:30:23
....
...
....
How can we make the output be:?
10:30:23
10:30:22
10:30:21
10:30:20
....
...
....
thanks