QDateTime time = QDateTime::currentDateTime(); QString dateTime = time.toString("MM-dd-hh-mm"); QString str= QString("Data%1.dat").arg(dateTime); QFile file1(str); if(!file1.open(QIODevice::WriteOnly)) { qDebug("File open failed!"); } file1.close();</span>
Qt5.5.1 以当前时间作为文件名保存文件
最新推荐文章于 2023-03-31 11:14:59 发布