0

I have a GUI and I prepared a drop down list. when the user select one of the drop down list options I want to activate a function. this is the function I want to call when one of the items in the list is selected:

def autoselect():
    autoruntype = str(ui.autorunselect.currentText())
    return

I know I should connect them by something like (it's an example of a button):

QtCore.QObject.connect(self.autorunselect, QtCore.SIGNAL(_fromUtf8("clicked()")),autoselect )

what should be instead of "clicked" when using drop down list

ᴀʀᴍᴀɴ
  • 4,443
  • 8
  • 37
  • 57
  • use `activated`, `currentTextChanged` or `currentIndexChange, see the docs – eyllanesc Jul 05 '18 at 14:20
  • Hi eyllanesc, I still didn't solve one issue - upon user selecting one of the options from the drop down list I want my function to be called (similar to button push), how can I do it? that's why I used the connect option: (but it's not working - it doesn't call my function): :QtCore.QObject.connect(self.autorunselect, QtCore.SIGNAL(_fromUtf8("activated()")),autoselect) – Moshe Gabay Jul 08 '18 at 09:38
  • edit your question and provide a [mcve], so I'll tell you where the problem is, read [ask] – eyllanesc Jul 08 '18 at 09:47
  • solved !! the way I used it is: self.autorunselect.activated[str].connect(autoselect) – Moshe Gabay Jul 09 '18 at 06:21

0 Answers0