[Qt-interest] Connecting multiple QActions to a single SLOT

Bob Hood bhood2 at comcast.net
Wed Feb 17 02:19:46 CET 2010


Sorry, I fired off too soon.  I remembered just as I hit "Send" that I'd
already solved this problem once, but it was a long time ago.  Had to go
back and find the code to that application.

In case anybody needs it in the future, simply casting the sender() back
to a QAction will get you what you need:

    QAction *action = qobject_cast<QAction *>(sender());
    if(!action)
        return;

Sorry again to waste the bandwidth.  :)


Render me gone,                       |||
Bob                                 ^(===)^
---------------------------------oOO--(_)--OOo---------------------------------
                I keep a Snow Leopard in a box under my Windows.




More information about the Qt-interest-old mailing list