[PATCH] RFC: KButtonGroup non-exclusive mode

Marco Gulino marco at kmobiletools.org
Thu Jun 7 22:23:25 BST 2007


Hi all!
While i was hacking KMobileTools configuration dialogs i noticed that there's 
no way (or at least.. not an easy way) to let kconfig_xt manage an OR-ed 
flags int item, like QButtonGroup did in qt3/kde3.
Pino Toscano pointed me to the KButtonGroup class, which is able to manage 
QRadioButtons, but i needed something more generic.. so i hacked on it, and 
with my patch make it able to:
	- Handle QAbstractButtons instead of QRadioButtons only
	- Have a exclusive flag: in exclusive mode the behaviour is the old one (then 
it's the default) while in non-exclusive mode selected() returns the OR of 
the IDs of the selected buttons, and setSelected(int ID) select an AND 
between buttons and ID.
	- Add a setId method to set non-consecutive IDs (very useful in non-exclusive 
mode, but it can be used in exclusive too).

The patch is attached in the message.
Comments?

-- 
KMobileTools - Open Source meets Mobile Phones.
http://www.kmobiletools.org
RockMan's home page
http://rockman.altervista.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdelibs_kbuttongroup.diff
Type: text/x-diff
Size: 7413 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070607/27ffcd9d/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070607/27ffcd9d/attachment.sig>


More information about the kde-core-devel mailing list