Hi,

Can anyone tell me what's the best way to enable or disable actions from
(deep) within a program's code? Currently, I'm using this:

KMainWindow* kmwin = dynamic_cast(topLevelWidget());
if (kmwin)
kmwin->action("justAnAction")->setEnabled(true);

I'm aware this doesn't always work if the topLevelWidget isn't a KMainWindow,
but it does in my case.
But it doesn't look that pretty and it isn't very manageable. Maybe using
state changes, but that doesn't change the fact the mainWin is accessed from
all over the program.

any thoughts?

Bram

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<