Plasma::RadioButton cannot be AutoExclusive?

Aaron J. Seigo aseigo at kde.org
Mon Dec 8 01:27:32 CET 2008


On Sunday 07 December 2008, David Baron wrote:
> On Sunday 07 December 2008 12:03:24 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.
> >
> > Can anyone give me an insight into why this is happening? could it be
> > because they are all individually parented to seperate
> > QGraphicsProxyWidgets?
> >
> > By the way, creating a Plasmoid has been a very easy experience, and
> > 4.2 Plasma rocks! (running trunk)
>
> First I head of these. So ... we have QRadioButton, KRadioButton and now
> RadioButton from plasma.

the Plasma widgets are just subclasses of QGraphicsProxyWidget that give us 
three things:

* provide a set API for accessing the widgets that is easy to use from scripts
* give us a central place to do cool Plasma Things like the button glows.
* allow us to avoid writing the same half dozen lines of code over and over, 
e.g.:

QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
KPushButton *button = new KPushButton();
proxy->setWidget(button);

etc..

this just becomes:

Plasma::PushButton *button = new Plasma::PushButton(this);

internally, however, it's still just a QGraphicsProxyWidget with a 
KPushButton.

> 1. How can I get these "plasma" widgets into qt designer to use them. Yes,
> I can do a global replace and get rid of all th Qs and Ks, huh?

we don't have deigner integration ... yet.

> 2. Are these any better or more well behaved than their counterparts?

i guess that should be apparent from the answer to #1 =)

> 3. I have a problem with icons and Q...buttons. A direct
> setIcon(QIcon(..... is a sure fire crash out. Setting icons in the designer
> uses qPixmap routines. In a cmake build, where might I find these
> functions? Can I use icon names and let KDE skin 'em if I use the Plasma
> buttons instead of the others?

yes, but you can also do that with normal KPushButtons.

-- 
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/20081207/fc6edc2f/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/20081207/fc6edc2f/attachment.sig 


More information about the Plasma-devel mailing list