![]() |
2010-09-15
, 20:36
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#2
|
![]() |
2010-09-16
, 06:28
|
Posts: 2 |
Thanked: 0 times |
Joined on Sep 2010
|
#3
|
What comes to mind is that some of those objects might be, in some circumstances, garbage collected..
# new call self.connect(self, QtCore.SIGNAL('clicked()'),self.rollSlot)
![]() |
2010-09-16
, 07:01
|
|
Posts: 1,012 |
Thanked: 817 times |
Joined on Jul 2007
@ France
|
#4
|
![]() |
2010-09-16
, 12:37
|
Posts: 6 |
Thanked: 3 times |
Joined on May 2010
|
#5
|
Hi,
I'm fairly new to both Python and Qt4, so I'd like a few pointers to find out what my problem is.
The problem is that some QPushButtons won't signal the slots they're connected to when clicked, when running the program on my n900. When running the same program under Ubuntu 9.10 or 10.4, the method will execute without problems.
Code:# this does NOT work: self.b1[i] = QtGui.QPushButton(self.quickButtons[i]) self.ds1[i] = Roller() self.connect(self.b1[i],QtCore.SIGNAL('clicked()'),self.ds1[i].rollSlot)Any pointers on how I should debug this would be greatly appreciated. The only relevant difference I can think of is that n900 has Python2.5, whereas Ubuntu ships Python2.6.Code:# this WORKS: self.throw_b = QtGui.QPushButton("Throw") self.connect(self.throw_b,QtCore.SIGNAL('clicked()'),self.genericRoll)
OTOH, the new-style connect() (second example) does work... I am using the new-style connect(), am I not?
self.b1[i] = QtGui.QPushButton(self.quickButtons[i]) self.ds1[i] = Roller() self.b1[i].clicked.connect(self.ds1[i].rollSlot)
I'm fairly new to both Python and Qt4, so I'd like a few pointers to find out what my problem is.
The problem is that some QPushButtons won't signal the slots they're connected to when clicked, when running the program on my n900. When running the same program under Ubuntu 9.10 or 10.4, the method will execute without problems.
To add to the weirdness, the problem only affects some of the buttons, not all.
OTOH, the new-style connect() (second example) does work... I am using the new-style connect(), am I not?