Friday June 25, 2004

KAction, KPushButton, KNope!

Software

This is how KDE should work:

KPushButton *button = new KPushButton( this );
KAction *action = actionCollection()->action( "myaction" );
action->plug( button );

Alas, it doesn't. Although KAction::guiItem() ( 3.3) looks promising, it seems like there isn't any way to easily hook an action to a button. Neil told me to add some manual connects, but I'm reluctant: I'm using KAction precisely to avoid having to track setEnabled calls. It wouldn't be hard to connect a few signals and slots, but obviously that's a step a developer shouldn't have to take.


© Copyright 1995-2007 Robert John Kaper. All rights reserved.

Powered by the delicious Kiki CMS! (#8/9)