2

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 ?
Matt
  • 1,672
  • 16
  • 24
Tchotcho
  • 43
  • 4

1 Answers1

0
  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.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Aerov
  • 333
  • 1
  • 2
  • 9
  • 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 '15 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 '15 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 '15 at 01:27
  • So it works? I am not using Eclipse, so I really don't know... – Aerov Aug 21 '15 at 07:01