Questions tagged [qfiledialog]

QFileDialog is a class from the Qt toolkit which provides a dialog allowing users to select files or directories.

Documentation can be found here (Qt4) and here (Qt5).

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…
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…
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", …
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…
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…
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…
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 =…
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…
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…
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…
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…
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 =…
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…
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…
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…
dan_g
  • 2,182
  • 3
  • 20
  • 38
1 2
3
21 22