0

I'm developing a plugin in QGIS, with a dialog box where I want to insert text (string) and send to web service soap.

I don't found much on the internet.

Except this code that i have adapted:

qid = QInputDialog()
canvas = iface.mapCanvas()
input, ok = QInputDialog.getText( qid, "Enter Date", "Enter text", QLineEdit.Normal, "Date" + "," + "Text")
if ok:
    Date = input.split( "," )[ 0 ]
    print Date
    Name = input.split( "," )[ 1 ]
    print Name

But this code don't work in the combobox that i want.

I create this ComboBox in QCreator:

combobox

Can someone help me to adapt the code to this combobox?

  • Did make it a widget? Try to build a QtDialog with that widget a provide a run method to get a result from that dialog. – Andreas Müller Sep 13 '18 at 16:05
  • I make the combobox in QTCreator. My difficult is to give an action to the send button. When i click in the button it don't does nothing. – Antonio Padez Sep 13 '18 at 16:42
  • The logic off your plugin must be programmed in python! Did you read the cookbook? docs.qgis.org/2.18/en/docs/pyqgis_developer_cookbook/intro.html – Andreas Müller Sep 13 '18 at 17:06
  • Yes, i read the book. This is not my first plugin in python to Qgis. I develop other plugin, but don't have combobox. My difficulty is to give an action to the send button. – Antonio Padez Sep 14 '18 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.