Question

I am a bit new to using the GUI programming application PyQt4 and I had a question about saving files.

Is there some sort of way to create a save file button on a PyQt4 application that doesn't require you to use the QFileDialog.getSaveFileName(...) function? I want to create a button that will allow you to save files without the user having to enter the name, but rather having it specified based on an already-decided filename that I would provide.

I was trying to look at PyQt4 documentation that could do this but I couldn't find anything that would save files without using the QFileDialog.getSaveFileName(...) function.

If anyone could help me out that would be great!

Thanks.

Était-ce utile?

La solution

As you can see in the docs for the QFileDialog

You can pass in the exact name of the file:

fileName = QtGui.QFileDialog.getSaveFileName(None, 'Save File',
                                             '/path/to/your/file.ext')
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top