QFileDialog is a class from the Qt toolkit which provides a dialog allowing users to select files or directories.
Questions tagged [qfiledialog]
367 questions
3
votes
0 answers
code crash after opening a QfileDialog in a QThread
I wrote a code who display in a GUI, the steps of calcul of an algorithm.
For this, i use a QThread which is in charge to check the steps and display it in a GUI. This alone is working.
However, the first step for the user is to select a…

SebD
- 31
- 3
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…

Nikita_Dedov
- 33
- 3
3
votes
1 answer
'selectedFilters' is not a valid keyword argument
I use PyQt5 and I have an error when I try to save the file name :
csv_file_list = QtWidgets.QFileDialog.getOpenFileName(self, 'Open file', '', '*.csv')
fileName = csv_file_list
fileName = QtWidgets.QFileDialog.getSaveFileName(self,…
user6450583
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
- 120
- 1
- 13
3
votes
1 answer
pyqt QFileDialog.getOpenFileName() get path of the directory of the file
I'm searching for a way to get the path of the directory of the file that I have chosen by QFileDialog.getOpenFileName().
I know that you can access it by os.path.dirname(os.path.realpath(filename), but I'm searching for a better way because I need…

jule
- 61
- 1
- 5
3
votes
2 answers
How to set the directory separator character to match the operating system?
I am writing a qt application, with the goal of it being portable to the 3 major operating systems.
I am using QFileDialog to select a folder, and then adding it to a QListWidget. However the folder name is being returned as E:/media even though I…

esac
- 24,099
- 38
- 122
- 179
3
votes
0 answers
C++ / Qt - QFileDialog::getOpenFileName() does not show expected extension on MAC OS X
I want to use a native file dialog to let the user choosing a .zip file
So I call following Qt static method with zip extension as expected file type
QFileDialog::getOpenFileName(0, "Please select a zip file", "/home", "*.zip");
The behaviour is…

looboot
- 31
- 1
3
votes
3 answers
Qt remembering the last open folder
I am using QFileDialog::openfilename for taking a file from user as input and I have specified the default folder which is to be shown when user open dialog.
But qt is somehow remembering the last open folder when filedialog is opened multiple…

Nishu
- 133
- 1
- 2
- 11
3
votes
0 answers
Qt Remote File Browser
I was wondering if anyone has worked on Qt Remote File Browser. From my understanding, I have two options;
Use QFileDilaog with a custom proxy model when it comes to remote files. The model will be responsible for providing remote file/directory…

user3396164
- 31
- 3
3
votes
1 answer
Qt: Hide folders in getSaveFileName
I would like to save a file using QFileDialog::getSaveFileName without allowing to choose the path or at least hide folders.
Reading the doc I tried to set QFileDialog::ShowDirsOnly as an option like this:
QString fileName =…

Jeanstackamort
- 309
- 2
- 4
- 16
3
votes
1 answer
KDE writing (too many) in the console
I'm developping a Qt GUI application.
My problem is that I use the console for another thread (it write his comunication in it), and the main problem is that when I create a QFileDialog (in order to select a script file), KDE is wrinting useless …

MokaT
- 1,416
- 16
- 37
3
votes
1 answer
Window modal QFileDialog pushing parent to background after exec()
I stripped my problem down to what it necessary, so don't mind that is does nothing useful as shown here.
I have my MainWindow which is a QMainWindow with a QPushButton inside, and I connected the clicked() signal of that button to the following…

PrisonMonkeys
- 1,199
- 1
- 10
- 20
3
votes
1 answer
PyQt: QtGui.QFileDialog.getSaveFileName won't close after selection
In my PyQt4 application, there is a functionality that allows users to save a avi file.
To this aim, a saveMovie method has been implemented in the main window:
def saveMovie(self):
""" Let the user make a movie out of the current experiment.…

Loris Fichera
- 98
- 1
- 8
3
votes
1 answer
QFileDialog history
i'm trying to set the history on the QFileDialog, but it doesn't seem to appear anywhere.
QFileDialog dialog(parent, caption, path, filter);
dialog.setHistory(history);
dialog.exec();
But i don't see the history in the dialog anywhere. Where should…

0xbaadf00d
- 2,535
- 2
- 24
- 46
3
votes
1 answer
QDir absolutePath still returning the filename
QString FilePath2 = QFileDialog::getOpenFileName(this, tr("Open Directory"), "C:/", tr("Text files (*.txt)"));
QDir a = FilePath2;
qDebug() << a.absolutePath();
Code works fine. But absolutePath() is still returning the path + filename instead of…

Blastcore
- 360
- 7
- 19