QFile file("re");
if (!file.exists())
{
QMessageBox::critical(0, QObject::tr("Error"), QObject::tr("找不到文件"));
//return -1;
}
if (file.open(QIODevice::ReadOnly))
{
QMessageBox::critical(0, "Error", QObject::tr("open(QIODevice::ReadOnly)打开文件失败"));
return -1;
}
QDataStream streamRe(&file);
while ( !streamRe.atEnd())
{
QDateTime temp;
streamRe >> temp;
.................................
.........................
}
file.close();