現有結構體:
struct fileInfo { QDate createTime; QString fileName; }
QList<fileInfo> fileLst; // 對文件按時間排序 qSort(fileLst.begin(), fileLst.end(), compareBarData); //排列判斷 bool compareBarData(const fileInfo &barAmount1, const fileInfo &barAmount2) { if (barAmount1.createTime < barAmount2.createTime) { return true; }
return false; }