Question

I am using QtDesigner in Python to write a simple program that can save variables to a file and load it from it again. What is the easiest way to make a menu for the user to choose a file to load? I want the list of files to open up and the user must be able to click on the file he wants to open? Is there a specific widget for that? Thanks for the help.

Was it helpful?

Solution

QtGui.QFileDialog.getOpenFileName(None,"Load File","","Text (*.txt);;All Files (*)")

Watch out because depending if you are using PyQT or PySide the values returned by this call will be slightly different.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top