[PATCH] KRadioAction toggled() signal

David Faure david at mandrakesoft.com
Thu Oct 24 10:08:20 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 24 October 2002 02:04, Scott Wheeler wrote:
> Sigmund Augdal pointed this one out on IRC:
> 
> KRadioAction is a subclass of KToggleAction, which has a toggled(bool) signal.  
> Curretnly this signal is only emitted in the activated() slot, which is 
> called when a user clicks on the action.
> 
> However, when there is an "exclusive group" KToggleAction::setChecked() 
> unchecks all other checked items by calling setChecked(false) on the other 
> items in the group.
>
> However, since these items being unchecked are never "activated" 
> toggled(false) is never emitted.

Indeed.

>  This patch (2 liner) moves the toggled() 
> signal from activated() to setChecked(), which corrects the above behavior.

Looks wrong - a "manual" call to setChecked(true) from the application will emit
toggled (for this same action) (which might trigger some slot in the app, etc. ...).
We have removed such behaviour from all KActions, it would be wrong to reintroduce it here.
I suggest emitting toggled from some code that only happens when KAction itself 
decides to uncheck the 'other' actions.

- -- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9t7iE72KcVAmwbhARAkOHAJ4lumbRghTpPGKVRKAdeMjhdBJ0JwCfctlx
0DotzJjlMH2huHZVOGjQwwk=
=Qpxd
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list