[PyQt] Add custom widget to the QMenu

matteo.boscolo at boscolini.eu matteo.boscolo at boscolini.eu
Mon Sep 13 19:46:15 BST 2010




Hi all, What I'm trying to do is to have at the right click on a QGraphicsItem, a QLineEdit . I'm trying to use the following codedef contextMenuEvent(self, event) :        #qle=QtGui.QLineEdit()                menu =QtGui.QMenu();        action=menu.addAction("test");        menu.exec_(event.screenPos())        #menu.addWidget(qle)        del(menu) But I do not know how to add the QLineEdit into the QMenu .there is any way to add a custom widget to the QMenu ? Or there is any other way to do such a think ? Regards,Matteo          






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100913/22ef0b48/attachment.html>


More information about the PyQt mailing list