Mike
Mike

Reputation: 533

Qt working with files

If my program needs to generate some files how can I make it in a way that it asks the user where to create the files?

For example to ask the user for an input of the location.

Upvotes: 0

Views: 65

Answers (1)

Nemanja Boric
Nemanja Boric

Reputation: 22157

You can use QFileDialog::getSaveFileName.

From the docs:

QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),
                            "/home/jana/untitled.png",
                            tr("Images (*.png *.xpm *.jpg)"));

Upvotes: 3

Related Questions