I finished creating my plugin and then compiled it.

I have : Myplugin.py, Myplugin_dialog.py, Myplugin_dialog_base.ui

  1. Is it in the Myplugin_dialog.py that I'm supposed to create new functions and add signal/slot for the components of the dialog?
  2. How can I call the components, for exemple a QComboBox of the Myplugin_dialog_base.ui ?

1 Answer 1

  1. Add your functions in Myplugin.py. You can also add in Myplugin_dialog.py, but for start try add in Myplugin.py
  2. Also in Myplugin.py in class Myplugin in function init you can catch signals, e.g. self.dlg.pushButton.clicked(self.my_function)

Have "def my_function(self):" in the same class.

  • It's okey now. Thank you Aerov and thank you Joseph. I just use the second option that you advice me Aerov. As i'm working on eclipse(Pydev), when i type self.dlg.pushButton; i did not find pusButton appear in the list of components.
    – Tchotcho
    Aug 20, 2015 at 21:32
  • Glad that helped. You can mark it as solved by clicking that tick. Of course it won't find "pushButton", you must add it in Qt Designer first (open that ...dialog_base.ui in Qt, add pushButton from the menu on left, and it's objectName (seen on right) is that self.dlg."object_name"
    – Aerov
    Aug 20, 2015 at 21:44
  • I putted it, but it does not appear in the list when i type. WHen i save it and run it in Qgis, theres no errors.
    – Tchotcho
    Aug 21, 2015 at 1:27
  • So it works? I am not using Eclipse, so I really don't know...
    – Aerov
    Aug 21, 2015 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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