View Single Post
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#12
Originally Posted by pelago View Post
Hi, I'm not the OP but I'm trying to learn PyQt. Do you mean that
Code:
tempPushButton = QtGui.QPushButton()
MainWindow.ledArray[r].append(tempPushButton)
is the thing to do? Is there a reference as to why the first form is incorrect?
It's not incorrect, just might cause trouble on particular combination of methods and classes AFAIK the problem stems from two sources - from the way Python garbage collection works and from the problem that it does not necessarily know about object pointer ownership transfers than happen on Qt's level. Can't find anything descriptive on google right now, so you'll have to take my word for it Or remember this and when your first segfault appears, try the suggested change above and then ponder why it fixes the problem
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc