1

This question already has an answer here:

I am trying to re design a plugin to run multiple iterations of data loaded from a file. I am using QT creator to develop the GUI. How would I design a load data input box so users can select a data file and then run the plugin.

The plugin initially uses single coordinate inputs i wish to use multiple.

marked as duplicate by underdark qgis Sep 1 '16 at 19:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Use QLineEdit and QPushButton, lets call them path and btn.

Create function like that:

def choose_file():
    dialog = QtGui.QFileDialog()
    fname = dialog.getOpenFileName(None, "Choose file to open")
    if fname:
        path.setText(fname)

Now connect this function to the btn:

btn.clicked.connect(choose_file)

This is how it works in most cases. If you want to use this path then just get it from the path widget:

input = path.text()

Not the answer you're looking for? Browse other questions tagged or ask your own question.