QFileDialog is a class from the Qt toolkit which provides a dialog allowing users to select files or directories.
Questions tagged [qfiledialog]
322 questions
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…
![](../../users/profiles/212010.webp)
Mathias
- 1,256
- 2
- 15
- 28
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…
![](../../users/profiles/3284719.webp)
ochurlaud
- 360
- 3
- 13
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",
…
![](../../users/profiles/1144278.webp)
Streight
- 761
- 4
- 14
- 27
4
votes
1 answer
How can I get a QFileDialog to prompt for overwrite?
I have a QDialog that opens a QFileDialog like so:
QFileDialog fd(this);
fd.setFileMode(QFileDialog::AnyFile);
if (fd.exec()) {
// save data to a file
}
Unfortunately, the default behavior doesn't seem to be quite so default, and the file…
![](../../users/profiles/507761.webp)
Matthew Read
- 926
- 1
- 26
- 43
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…
![](../../users/profiles/6132109.webp)
J. Doe
- 328
- 2
- 4
- 9
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…
![](../../users/profiles/2487546.webp)
htzfun
- 1,026
- 9
- 35
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 =…
![](../../users/profiles/4111174.webp)
Igor
- 328
- 3
- 6
- 13
4
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…
![](../../users/profiles/3456611.webp)
Gianluca
- 122
- 4
- 13
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…
![](../../users/profiles/771740.webp)
JonatasTeixeira
- 1,342
- 1
- 16
- 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…
![](../../users/profiles/6046626.webp)
JuicyKitty
- 96
- 9
3
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…
![](../../users/profiles/923741.webp)
alecs1
- 33
- 7
3
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 =…
![](../../users/profiles/6607439.webp)
Sir Ectoplasm
- 31
- 1
- 4
3
votes
2 answers
QFileDialog: add suffix after selecting file
I need to add suffix to selected filename in QFileDialog with QFileDialog::AcceptSave accept mode. For example, after selecting "1.txt" file in QFileDialog edit should be select "1_suffix.txt". It should be added before file accepting, because I…
![](../../users/profiles/5197249.webp)
Nikita_Dedov
- 33
- 3
3
votes
1 answer
QFileDialog closes window when called
This if my first time asking a question here so please forgive me for any mistakes.
So my problem is when I run my program it works fine. But as soon as I click Search the program closes.
I use self.pushButton_5.cicked.connect(run) to call on a…
![](../../users/profiles/6504175.webp)
L.John.B
- 110
- 1
- 11
3
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…
![](../../users/profiles/3014097.webp)
dan_g
- 2,182
- 3
- 20
- 38