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 <[EMAIL PROTECTED]>:
> 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).
>

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to