[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] PyKDE4, KAction and signal overloads
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2010-12-31 14:48:22
Message-ID: d449b8c64c221d86943b71895878f66e () localhost
[Download RAW message or body]

On Wed, 29 Dec 2010 13:48:33 +0100, Sebastian Wiesner
<lunaryorn@googlemail.com> wrote:
> Hallo,
> 
> KDE 4 uses its own action class called "KAction" [1], derived from
> "QAction".  This class overloads the standard "triggered(bool)"-Signal
> from "QAction" [2] as "triggered(Qt.MouseButtons,
> Qt.KeyboardModifiers)" [3].
> 
> Unfortunately, when using the new-style API for signals and slots, the
> "triggered(bool)" overload from "QAction" is hidden on "KAction"
> instances.  "act.triggered[bool].connect(foobar)" (where "act" is an
> instance of "KAction" or any subclass thereof) raises a "KeyError:
> 'there is no matching overloaded signal'".  An old-style connection
> works like "self.connect(act, SIGNAL('triggered(bool)'), foobar)"
> works, just like an explicit cast to "QAction" (e.g. "sip.cast(act,
> QAction).triggered[bool].connect(foo)").  However, compared to a
> straight new-style connection, both alternatives are rather ugly.
> 
> Is this a bug in PyKDE4, or is this a technical restriction in sip or
PyQt?

The scoping works the same as any other sort of attribute, so you can use
super()...

    super(KAction, act).triggered[bool].connect(foobar)

Phil
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic