Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我的程序需要生成一些文件,我该如何以询问用户在哪里创建文件的方式制作它?
例如,要求用户输入位置。
您可以使用QFileDialog::getSaveFileName.
QFileDialog::getSaveFileName
从文档:
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), "/home/jana/untitled.png", tr("Images (*.png *.xpm *.jpg)"));