Plasma::RadioButton cannot be AutoExclusive?

Aaron J. Seigo aseigo at kde.org
Mon Dec 8 15:19:42 CET 2008


On Monday 08 December 2008, Ben Cooksley wrote:
> On 12/8/08, Aaron J. Seigo <aseigo at kde.org> wrote:
> > On Sunday 07 December 2008, Ben Cooksley wrote:
> >> Hi,
> >>
> >> I am developing the KuickQuiz plasmoid ( currently very alpha in
> >> playground/base/plasma/applets/kuickquiz ) and use Plasma::RadioButton
> >> to allow the user to choose the multi choice answer they want.
> >> However, I have ran into the issue of despite 4 Plasma::RadioButtons
> >> having the same parent, the radio button itself is never auto
> >> exclusive, so when the user changes their mind, the answer does not
> >> automatically switch to the newly chosen choice, and both become
> >> chosen so the user could potentially cheat and choose all of the
> >> choices.
> >
> > what are the RadioButtons parented to, exactly?
>
> They are parented to "this" which is "QuizQuestion" a subclass of
> Plasma::Frame. the involved code is in quizquestion.cpp line 31 (
> http://websvn.kde.org/trunk/playground/base/plasma/applets/kuickquiz/quizqu
>estion.cpp )

ah, Plasma::Frame isn't actually a QGraphicsProxyWidget. it's just pretending 
to be one; nativeWidget() even just returns 0 ... always.

try putting them in a Plasma::GroupBox instead and see if that works.

*or* create a QButtonGroup, which is a QObject class and allows you to group 
buttons however you'd like. not as elegant as automatically working, but 
should be guaranteed to work =)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20081208/18eb1101/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20081208/18eb1101/attachment.sig 


More information about the Plasma-devel mailing list