Skip to content Skip to sidebar Skip to footer

Pyqt5 Qfiledialog Is Not Returning Correct Paths In Ubuntu

I'm using this bit of code to open a file dialog and return the selected file names (PyQt5, Ubuntu) QtWidgets.QFileDialog.getOpenFileNames(self, 'Open files', self.__target, self._

Solution 1:

@musicamante, thank you for your help. The answer lays with DontUseNativeDialog if I'm running my code with PyCharm. Running it outside PyCharm, that flag isn't required.

Solution 2:

Same issue happening for me aswell, finally i figured out the curprit is pycharm (in my case), try run your code in terminal and you will see it works fine. and after snap package your application it will also run smooth. So this was not a problem for me now.

Solution 3:

I am using PyCharm and I had the same problem. The option "DontUseNativeDialog" as suggested by @musicamante also solved the problem for me.

QtWidgets.QFileDialog.getOpenFileName(parent=self, options=QtWidgets.QFileDialog.DontUseNativeDialog)

Post a Comment for "Pyqt5 Qfiledialog Is Not Returning Correct Paths In Ubuntu"