[PATCH] KToggleToolbarAction, KWidgetAction

David Faure david at mandrakesoft.com
Mon Apr 8 14:05:08 BST 2002


On Monday 08 April 2002 04:45, John Firebaugh wrote:
> The attached patch adds two new KAction-subclasses: KToggleToolbarAction and 
> KWidgetAction. The first handles everything associated with a "Show ___ 
> Toolbar" menu item, including updating itself when the toolbar is shown or 
> hidden programmatically. Use of this class will make bugs like "Bug#40413: 
> Selections in Settings are displayed incorrectly" easy to fix. The second 
> provides an easy way to insert custom widgets into toolbars. It removes the 
> necessity of subclassing KAction for every widget you want to insert into a 
> toolbar.
> 
> To support KToggleToolbarAction I had to make a small change to 
> kxmlguibuilder: it now queries the main window for the specified toolbar and 
> creates a new one only if the query returns null.
> 
> Under the hood, use of KToggleToolbarAction changes one thing that may or may 
> not be of significance: a toolbar with an associated KToggleToolbarAction 
> will always be created, at the time the action is plugged, regardless of 
> whether the toolbar is ever used.
> 
> Comments, suggestions, objections? If none of the latter, I will commit in 2 
> days.

KWidgetAction is great. I think it removes the need for Richard Moore's
KSliderAction, KDialAction etc. This single action can take care of
all those custom widgets.

For KToolbarAction, I'd like Simon to comment on the builder change ;)

-- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today






More information about the kde-core-devel mailing list