Hi!
I would like to choose a path for a file that will be downloaded from internet. To do that I tried to create a button, when pressed will open a QFileDialog so I can choose the path. To make my initial GUI i'm using Qt Designer 5.7 and pyqt5.
The output when i hit "Folder" button:
Traceback (most recent call last):
File "teste.py", line 49, in destination
self.folderPath = QtWidgets.QFileDialog.getExistingDirectory(self, 'Select folder');
TypeError: getExistingDirectory(parent: QWidget = None, caption: str = '', directory: str = '', options: Union[QFileDialog.Options, QFileDialog.Option] = QFileDialog.ShowDirsOnly): argument 1 has unexpected type 'Ui_MainWindow'
Aborted (core dumped)
from PyQt5 import QtCore, QtGui, QtWidgets
#...
self.destinoButton.clicked.connect(self.destination)
#...
def destination( self ):
self.
folderPath = QtWidgets.
QFileDialog.
getExistingDirectory(self,
'Select folder');
from PyQt5 import QtCore, QtGui, QtWidgets
#...
self.destinoButton.clicked.connect(self.destination)
#...
def destination( self ):
self.folderPath = QtWidgets.QFileDialog.getExistingDirectory(self, 'Select folder');
To copy to clipboard, switch view to plain text mode
How can I fix it?
Bookmarks