[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: [Panel-devel] Finishing up the Layout Stuff
From:       "Matias Valdenegro T." <mvaldenegro () informatica ! utem ! cl>
Date:       2007-06-21 3:56:26
Message-ID: 200706202356.27051.mvaldenegro () informatica ! utem ! cl
[Download RAW message or body]

El Mié 20 Jun 2007, Aaron J. Seigo escribió:
> On Wednesday 20 June 2007, Matias Valdenegro T. wrote:
> > The actual proposal is just make ALL widgets inherit Plasma::Widget and
> > create glue/wrapper code for the elements already provided by Qt (SVG,
> > Text, etc)
>
> correct me if i'm wrong, but i thought we had decided to have all widget
> inherit Plasma::LayoutItem directly?

Actually i don't remember :)

> this solves the problem of multiply inheriting GraphicsItem, which would be
> problematic for things such as QGraphicsTextItem, and keeps the hierarchy
> simple.

Ok.

> we can use the parent/child relationships that already exist in
> QGraphicsScene betwen QGraphicsItems.

Yep, i don't know how i didn't think about that in the first place.

> the difference in API that i see right now between LayoutItem and Widget is
> that widget adds geometry, setGeometry, updateGeometry, invalidate (ugly
> name, btw =) and resize.
>
> invalidate can easily go away and the rest could be moved up into
> LayoutItem .
>
> the additional parent/child relationships seem to duplicate what is already
> there in QGraphicsScene really.
>
> i'd like to see us keep it simple and move with LayoutItem if at all
> possible.

Sounds great, the only issue is i need to have a pointer to the associated 
QGraphicsItem inside LayoutItem, to call the appropiate update() functions, 
and i thought to add the following API to LayoutItem :

d-Pointer : QGraphicsItem *item; (The item to manage and it's children)
protected:
	void setItem(QGraphicsItem *item);

So, on your widget, you inherit LayoutItem and QGraphicsItem (Directly or 
indirectly) and call setItem(this), so i have a pointer to the item.
_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic