di_zou
4th August 2011, 21:39
I have a bunch of buttons in a QButtonGroup that I am trying to connect with a function.
Here is my code:
def __init__(self):
addAppButtonGroup = QButtonGroup()
addAppButtonGroup.addButton(addCustomAppButton)
addAppButtonGroup.addButton(addAppleStoreAppButton )
addAppButtonGroup.addButton(addWebLinkButton)
addAppButtonGroup.setId(addCustomAppButton, 0)
addAppButtonGroup.setId(addAppleStoreAppButton, 1)
addAppButtonGroup.setId(addWebLinkButton, 2)
""Stuff to make buttons show up"""
self.connect(addAppButtonGroup, SIGNAL("buttonClicked(int)"), self.AddApplication)
def AddApplication(self, id):
print "hi"
print id
So all the buttons show up and I can click on them. However, when I click on them, nothing is printed to the screen.
Thanks.
Here is my code:
def __init__(self):
addAppButtonGroup = QButtonGroup()
addAppButtonGroup.addButton(addCustomAppButton)
addAppButtonGroup.addButton(addAppleStoreAppButton )
addAppButtonGroup.addButton(addWebLinkButton)
addAppButtonGroup.setId(addCustomAppButton, 0)
addAppButtonGroup.setId(addAppleStoreAppButton, 1)
addAppButtonGroup.setId(addWebLinkButton, 2)
""Stuff to make buttons show up"""
self.connect(addAppButtonGroup, SIGNAL("buttonClicked(int)"), self.AddApplication)
def AddApplication(self, id):
print "hi"
print id
So all the buttons show up and I can click on them. However, when I click on them, nothing is printed to the screen.
Thanks.