Extender api review, round 2

Rob Scheepmaker r.scheepmaker at student.utwente.nl
Wed Jul 30 22:57:42 CEST 2008


On Wednesday 30 July 2008 21:18:06 Aaron J. Seigo wrote:
> > Actually it moves the extender to somewhere in the topleft quadrant of
> > the scene (negative coordinates). However, I'm actually thinking now that
> > PopupApplet should handle this.
>
> that probably makes sense; or rather, Corona shold support a way to do this
> easily, which is used by things that would benefit from it such as
> PopupApplet.

I could add something like this to corona:

void addOffscreenWidget(QGW *)
void removeOffscreenWidget(QGW *)

that add's/removes widgets to a layout in the topleft quadrant... This name is horrible though... any 
suggestions?

> > > >             void setWidget(QGraphicsWidget *widget);
> > > >             QGraphicsWidget *widget() const;
> > >
> > > Why QGraphicsWidget only? Why not it's parent class QGraphicsItem?
> >
> > Hmm, that's actually a very good point. Currently I actually check the
> > size hints of the widget though. to set sane size hints for the extender
> > item. maybe I should try to cast the widget to QGW, use the sizehints in
> > that case, and assume a minimumsize of the current size if its a QGI?
> > Supporting QGI would be more flexible...
>
> if it's workable, that'd be great. note that there is a bool
> QGraphicsItem::isWidget() that makes detecting items-that-are-widgets
> easy/faster.

cool.

> > > >             void setExtender(Extender *extender);
> > > >             Extender *extender() const;
> > >
> > > Ah, now I'm confused... How is that different from the mandatory
> > > extender provided in the ctor?
> >
> > This way the item can be moved between extenders... I'm not entirely sure
> > if there are cases where that is useful though.
>
> does that happen when an item is moved between applets? or is a whole new
> ExtenderItem created (would seem a bit wasteful?)

Yes, it happens when an item is moved between applets. It moves it's configuration, removes the item 
from it's old extender, and adds itself to the new extender.

> > I guess it's only needed if
> > we're going to support multiple extenders/applet... which I think we'll
> > eventually want.
>
> what are the use cases for this? i've been trying to think of them, and i'm
> really not doing a great job of it ;)

Example:
The kuiserver applet could optionally use two extenders... one in which it shows running jobs, and one 
where finished jobs are move. In the panel it could show 2 icons, one for either extender.





More information about the Plasma-devel mailing list