Hi all,

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.

class DnDMenuListWidget(QListWidget):
    ...
    ...
    def dropEvent(self, event):
        ...
        ...
        menu = QMenu(self)    # using QMenu(self)
        # menu = QMenu()      #  using QMenu()
        ...
        ...

Thanks!
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to