Hi all,<br><br>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.<br>
<br>class DnDMenuListWidget(QListWidget):<br> ...<br> ...<br> def dropEvent(self, event):<br> ...<br> ...<br> menu = QMenu(self) # using QMenu(self)<br> # menu = QMenu() # using QMenu()<br>
...<br> ...<br><br>Thanks!<br>