[PyQt] Problems with mousePressEvent
piotr maliński
riklaunim at gmail.com
Thu Dec 4 20:40:21 GMT 2008
Ok, solved. I've just removed QListWidget from the Designer *ui file,
and in the Python class that uses that file I've added it from the
code using my class that subclasses QListWidget and handles the event:
class FileManagerWidget(QtGui.QListWidget):
def __init__(self, parent=None,):
super(FileManagerWidget, self).__init__(parent)
QtCore.QMetaObject.connectSlotsByName(self)
def mousePressEvent(self, event):
print 'test'
2008/12/4, piotr maliński <riklaunim at gmail.com>:
> I have a widget made in QtDesigner, I use it in a standard for this class,
> everything works, except one tiny problem. I want to catch mouse events:
>
> def mousePressEvent(self, event):
> print 'test'
>
> It works if I click mouse on the widget, but only if the cursor is on the
> widget "background" - and I want it to work when I click something on
> QListWidget (self.ui.items) that is on that custom widget (self.ui).
>
More information about the PyQt
mailing list