PDA

View Full Version : QComboBox event



ad3d
8th March 2013, 07:39
Hi,

I have created QCombox in UI and converted it in .py using Pyuic4. Now in my main py file i have imported this UI.py file and written an event for QCombox as follows

name of QCombox is shotCB

def on_shotCB_activated(self):
print "A";

but when i tried to run my py file, though i selected item once A got printed twice.

again i tried

def on_shotCB_currentIndexChanged(self):
print "A";

but this event also gave me same results i.e. printed A twice

Can anybody tell me where i am going wrong?

ChrisW67
8th March 2013, 22:30
The slot has been connected twice: possibly once by your code explicitly and once by the automatic connection mechanism triggered by the on_widget_signal() naming.