Resolving conflicts with PyQt new-style signals-slots

元气小坏坏 提交于 2019-12-05 10:23:40
Avaris

See the second example in connecting signals portion of documentation.

In your case it would be:

self.myComboBox.currentIndexChanged[QtCore.QString].connect(self.mySlot)

or if you are using v2 API for QString

self.myComboBox.currentIndexChanged[str].connect(self.mySlot)

You must specify the return value within brackets if you want non-default value to be returned

self.myComboBox.currentIndexChanged[str].connect(self.mySlot)

def mySlot(self, item):
    self.currentItem = item

see : http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/new_style_signals_slots.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!