弹窗代码
fileName = QFileDialog::getSaveFileName(ui->tableWidget,"保存", "c:", "xlsx(*.xlsx)");
自动保存代码
QString folderPath = QDir::currentPath() + "/data";
QDir().mkpath(folderPath); // Create directory if it doesn't exist
QString fileName = folderPath + "/data_" + QDateTime::currentDateTime().toString("yyyyMMdd_hhmmss") + ".xlsx";