QFileDialog is a class from the Qt toolkit which provides a dialog allowing users to select files or directories.
Questions tagged [qfiledialog]
367 questions
5
votes
3 answers
QFileDialog - differences between PyQt4/PyQt5/PySide
I have been working my way through Summerfields book on Rapid GUI programming with Python and QT (PyQt to be more precise), but the book from 2007 uses version 4.x and I am trying to get going with the current version (5.4.2).
There are some…

Keith Miller
- 51
- 2
5
votes
2 answers
QFileDialog filter from mime-types
I want the filter in a QFileDialog to match all audio file types supported by Phonon on the platform in question.
1 - However I am not able to find a way in Qt to use mime types in a filter. How can I do that?
2 - Or how can I find the corresponding…

Mathias
- 1,446
- 2
- 16
- 31
5
votes
1 answer
QFileDialog works only once after reboot (prints an error otherwise)
The problem
I use a QFileDialog. It worked very well and suddently my issue appeared.
After a reboot, the code given below works as expected. Then if I close the app and relaunch it, the modal window takes a long time to appear and never shows the…

ochurlaud
- 410
- 5
- 14
5
votes
2 answers
I try to use QFileDialog for choose a file on PyQt but it don't run
I'm new on stackoverflow.
I have a MainWindow on PyQt, I want click a button and open a QFileDialog for choose a file. The problem is: If I use a MainWindow, QFileDialog don't run. If I use a Dialog, QFileDialog run.
This is my code for the…

Gianluca
- 142
- 1
- 4
- 13
5
votes
2 answers
QFileDialog - how to specify home directory
I tried the following to open a file dialog that should display the users home directory:
QString fileName = QFileDialog::getOpenFileName(this,
tr("Select database"), QDir::homePath(),
tr("Database Files (*.db…

rogergl
- 3,501
- 2
- 30
- 49
4
votes
2 answers
How to specify the QFileDialog::getExistingDirectory() method?
With the method/command:
OpenCreateDirectory()
{
QString Directory = QFileDialog::getExistingDirectory(this,
tr("Choose Or Create Directory"),
"/home",
…

Streight
- 811
- 4
- 15
- 28
4
votes
1 answer
Force QFileDialog::DontUseNativeDialog globally in a QT program
To avoid the freeze at https://bugreports.qt.io/browse/QTBUG-59184 on Ubuntu Unity (and some networking issues on Windows), I'd like to force QFileDialog::DontUseNativeDialog in all the calls to the static functions of QFileDialog. Some of the calls…

alecs1
- 43
- 7
4
votes
3 answers
File dialog not working with PyQt5?
This is my first time attempting to create a GUI. I have created a simple program with a button that is supposed to open the file browser and return that file. I know PyQt5 has some built in file dialog commands, but they are not working for me. I…

J. Doe
- 338
- 2
- 4
- 9
4
votes
1 answer
Name Error: name 'QFileDialog' is not defined
I am working on coursework for computer science and can't work out why the piece of code isn't working. I am trying to connect a button that I've created in PyQt4 so that when it is pressed it shows a directory dialogue:
self.Browse_Button_1 =…

Sir Ectoplasm
- 41
- 1
- 4
4
votes
1 answer
QFileDialog doesn't work with tags in OSX and Qt 5.7
I need fileDialog to work properly with tags. On OSX, when I try to click on tag - this code removes all files from file dialog, so I can't pick them.
Looks like I found solution Option::DontResolveSymlinks but it doesn't work either.
Update: if…

htzfun
- 1,231
- 10
- 41
4
votes
1 answer
PyQt QFileDialog - Multiple Directory Selection
I am trying to create a QFileDialog that allows the user to select multiple directories.
Following the discussion here and the faq here, but I'm not sure what I'm doing wrong. I get a file dialog, but it still only lets me select a single directory…

dan_g
- 2,712
- 5
- 25
- 44
4
votes
1 answer
How to use options in QFileDialog.getOpenFileName?
I would like to use options in the static method QFileDialog.getOpenFileName.
For example i would like to set two options: QFileDialog.ExistingFile and QFileDialog.Detail.
I have already read this text:…

Igor
- 358
- 3
- 6
- 14
4
votes
2 answers
Python PyQt Pyside - setNameFilters in QFileDialog does not work
(Windows 7 64 Bit, PyCharm 3.4.1 Pro, Python 3.4.0, PySide 1.2.2)
I want to make a file dialog with filters and preselect one filter.
If i use the static method, it works, i can use filters and preselect one filter.
dir = self.sourceDir
filters =…

Igor
- 358
- 3
- 6
- 14
3
votes
3 answers
How to know the file's type to save, using QFileDialog
About pyQt4
I prefer to use the static method for the getSaveFilename in the QFileDialog so that the user sees the Windows/Mac native dialog.
My problem is that if the user doesn't type the file extension the in the save file name (say when…

JonatasTeixeira
- 1,474
- 1
- 18
- 24
3
votes
2 answers
Limit amount of files user can select in QFileDialog
Here the code:
dialog = new QFileDialog(this);
dialog->setFileMode(QFileDialog::ExistingFiles);
connect(dialog, SIGNAL(currentChanged(const QString&)),
this, SLOT(dialogSelectionChanged(const QString&)));
void…

JuicyKitty
- 318
- 1
- 16