I am trying to display the name of a user-selected file in a line-edit box (for a QGIS python plugin), but nothing happens when I run the code.
Here is my code:
from PyQt5.QtWidgets import QFileDialog
filename = QFileDialog.getOpenFileName(self, 'Open file')[0]
self.dlg.lineEdit.setText(filename)
I hope that somebody can help me