[PyQt] what is the difference between QMenu() and QMenu(self)
jianmarf at gmail.com
Fri Jul 29 23:18:58 BST 2011
I created a QMenu object in a class. When I created it with menu =
QMenu(self) and run the program, it sometimes got the "segmentation fault"
after exit the program. When I created the object with menu = QMenu(), it
didn't get this problem. I guess the reason is about the QMenu object
ownership. In one case, the object is owned by PyQt. In other case, it is
owned by Qt. I am not sure my guess. Can someone give some explanation?
Below is some code segment.
def dropEvent(self, event):
menu = QMenu(self) # using QMenu(self)
# menu = QMenu() # using QMenu()
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt