Last active
May 29, 2020 20:33
-
-
Save ThomasG77/440006f4c5f88bd38dfabc84beb699d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qgis.PyQt.QtWidgets import QFileDialog | |
dialog = QFileDialog() | |
# dialog.setNameFilters(["Log files (*.log)"]) | |
dialog.setFileMode(QFileDialog.DirectoryOnly); | |
dialog.setOption(QFileDialog.ShowDirsOnly, False); | |
def fileSelected(file): | |
# Instead of printing, save it in a config in your plugin | |
print(file) | |
dialog.fileSelected.connect(fileSelected) | |
dialog.show() # Select a directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment