[Panel-devel] Plasma::Widget subclassing and QGVItem's

Aaron J. Seigo aseigo at kde.org
Fri May 25 03:24:04 CEST 2007


On Thursday 24 May 2007, Matias Valdenegro T. wrote:
> El Jue 24 May 2007, Andreas Aardal Hanssen escribió:
> > 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?
>
> a Widget is a LayoutItem, but i don't know if inheriting from QGraphicsItem
> will make the Qt provided items (QGraphicsTextItem and such) wrappable.

well, in the Qt provided items case it would subclass from LayoutItem and, for 
instance, QGraphicsSvgItem. this is exactly what the LineEdit widget is 
doing, in fact.

> > class Widget : public QGraphicsItem, public LayoutItem
> > {
> > };
>
> As we speak is defined as
>
> class Widget : public QGraphicsItem, public LayoutItem, public
> DataVisualization
> {
> };

right; DataVisualization is going to go away though. it's nice because it 
documents the required slot's signature and even causes a compile time check 
on the signature (due to it being pure virtual) .... but it really has little 
purpose beyond that and so isn't worth the API imho.

-- 
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/panel-devel/attachments/20070524/42fcc3cd/attachment.pgp 


More information about the Panel-devel mailing list