KAction/KPushButton question
Simon Hausmann
hausmann at kde.org
Sat Jun 26 11:37:01 BST 2004
On Friday 25 June 2004 14:30, Rob Kaper wrote:
> How do I plug a KAction to a KPushButton so changing the KAction in one
> place will automatically update every GUI element using it?
Unfortunately support for push buttons is not implemented in KAction.
> It looks like
>
> KPushButton *button = new KPushButton( m_actionCollection->action(
> "myaction" )->guiItem(), this );
>
> might work in KDE 3.3 and up, but I can't test it as I'm not running HEAD.
> (so someone please confirm or deny whether this is the preferred way)
It would give you a button that has the visual properties of the action, but
it does not keep the button in sync with the action (GuiItem is value
based) .
Simon
More information about the kde-core-devel
mailing list