[PyQt] How to override mousePressEvent for an existing QPushButton widget

Dov Grobgeld dov.grobgeld at gmail.com
Thu Jul 30 22:43:10 BST 2009


Great! Though I'll have to wait a while until Fedora PyQt is updated to 4.5,
it seems.

Dov

2009/7/30 Phil Thompson <phil at riverbankcomputing.com>

> On Thu, 30 Jul 2009 21:26:42 +0300, Dov Grobgeld <dov.grobgeld at gmail.com>
> wrote:
> > Thanks! It seems like this is exactly what I was looking for.
> >
> > I have to say it is quite annoying that there is neither any compile time
> > nor any run time error reported for errors in the signal signatures.
> >
> > Regards,
> > Dov
>
> Use the new-style connection API...
>
> self.button.customContextMenuRequested.connect(self.context_menu)
>
> Phil
>
> > 2009/7/30 Henning Schröder <henning.schroeder at gmail.com>
> >
> >> On Thu, Jul 30, 2009 at 7:10 PM, Dov Grobgeld<dov.grobgeld at gmail.com>
> >> wrote:
> >>
> >> > Regarding contextMenuPolicy, how would you use that. I tried the
> >> following,
> >> > but it didn't work...
> >> >   [..]
> >> >         self.connect(self.button,
> >> > QtCore.SIGNAL('customContextMenuRequested()'), self.context_menu)
> >> You always have  to use the complete signature. Please try:
> >> SIGNAL('customContextMenuRequested(const QPoint&)')
> >>
> >> Henning
> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090730/0fbcde92/attachment.html


More information about the PyQt mailing list