Hello,
Could someone tell me how, from a PythonCaller calling a dropdown list via the PyQt5 module, to use the selected string (in the example below, the "select" variable) in the list to fill in a feature attribute and then leave the dialog box once the choice is made?
# coding: utf-8
from PyQt5.QtWidgets import QApplication, QWidget , QComboBox
import sys
def actionSelect():
select = qcombo.currentText()
print("Selected street : " + select)
app = QApplication(sys.argv)
root = QWidget()
root.setWindowTitle("Street Selected")
root.setGeometry(100 , 100 , 500 , 300)
# création de la liste QCombobox
qcombo = QComboBox(root)
qcombo.setGeometry(100 , 10 , 150 , 30)
qcombo.activated.connect(actionSelect)
# création de la liste des items
L = "Street A, City A" , "Street B, City B" , "Street C, City C"]
# ajout des items à la liste QCombobox
qcombo.addItems(,"Street A, City A" , "Street B, City B" , "Street C, City C"])
root.show()
sys.exit(app.exec_())
For example, in the example below:
Give this result:
Thanks a lot in advance for your help
Antonin