Plasma::Widget subclassing and QGVItem's

Aaron J. Seigo aseigo at kde.org
Thu May 24 16:28:23 BST 2007


On Thursday 24 May 2007, Andreas Aardal Hanssen wrote:
> On Wednesday 23 May 2007 18:25, Aaron J. Seigo wrote:
> > > > On Tuesday 22 May 2007, Matias Valdenegro T. wrote:
> > > > well, we could wrap Qt's ones. what this would mean probably is:
> > > > making Widget not subclass QGraphicsItem or that matter
> > > > DataVisualization. it would then become, essentially, an interface
> > > > class for "extra" plasma features. so:
> > > > namespace Plasma
> > > > {
> > > > class Label : public QGraphicsItem, public Widget
> > > > {
> > > >      // implementation of Widget API
> > > > };
> > > > }
> > > > how does that sound?
> > >
> > > Sounds nice, but widget should at least inherit LayoutItem to be
> > > layout-manageable.
> >
> > well, yes. i thought was implied =)
>
> So, maybe Widget is a Layoutitem? Maybe inheriting from QGraphicsItem and
> LayoutItem will make the item a widget?
>
> class Widget : public QGraphicsItem, public LayoutItem
> {
> };

yeah, that would remove one level of inheretence that is probably completely 
unecessary at this point. there's really nothing much more to be added via 
the Widget class (though people have tried to come up with things a few times 
now ;)

> Just a thought. The approach we're looking at in Qt is that layouts are
> items as well, so the layout hierarchy is the same as the item hierarchy

nice =)

> (as opposed to with QWidget, where the hierarchy is separate).

yeah, that's always been a bit of an odd beast, since the layouts and widgets 
in the layout usually need to be children of the same parent for it all to 
work properly...

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

Full time KDE developer sponsored by Trolltech (http://www.trolltech.com)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070524/e59f3edf/attachment.sig>


More information about the kde-core-devel mailing list