[Panel-devel] KDE/kdebase/workspace/plasma/lib

Alexander Wiedenbruch alexander at wiedenbruch.de
Fri Mar 2 21:09:39 CET 2007


Am Freitag, 2. März 2007 schrieb Aaron J. Seigo:
> On March 1, 2007, Alexander Wiedenbruch wrote:
> > SVN commit 638393 by wirr:
> >
> > Move the InputBox from SuperKaramba to Plasma.
> >
> >
> >  M  +6 -0      CMakeLists.txt
> >  M  +1 -1      datavisualization.h
> >  A             widgets (directory)
> >  A             widgets/lineedit.cpp   [License: GPL (v2+)]
> >  A             widgets/lineedit.h   [License: GPL (v2+)]
>
> this won't work; libplasma is lgpl. so either this needs to move into
> plasma itself, or we could just use QGraphicsTextItem, no?
I can put it under LGPL as I am the original author.

In SK I had some problems with using different colors for the frame, selected 
text, ... in QGraphicsTextItem so I implemented it myself.
I am not sure this necessary in Plasma anyway.

> yes, this would mean special casing the construction of this one widget a
> bit; if we keep the "set the size in the ctor" feature of Widget then we
> could also subclass QGraphicsTextItem and provide a compatible ctor at
> least. ditto for the svg and pixmap items.

If Widget will still inherit a QGraphicsItem, inheriting from both 
QGraphicsTextItem and Widget is not good.

We could remove Widget and just inherit from a QGraphics*Item of our need.
Widget would not be needed anymore then.

>
> >  A             widgets/widget.cpp   [License: LGPL (v2)]
> >  A             widgets/widget.h   [License: LGPL (v2)]
>
> i see this implements the (pure virtual) boundingRect(). i suppose the
> question is whether or not makes any sense to set the size in the
> constructor?
boundingRect should actually be virtual in Widget, so it can be reimplemted.
My thought was that any widget needs a size, so this is necessary for every 
widget so I put it in the ctor.

>
> additionally, this class is missing a dptr and a setter for m_boundingBox.
> also, could we call it m_size since that's the parameter in the ctor?
Not sure about a setter for m_boundingBox. Perhaps a setSize(QSizeF) is better 
than changing the complete boundingBox?

>
> finally, everything in libplasma should be in the Plasma namespace. i've
> fixing Runner right now, actually.
>
> what else are you planning on implementing in Widget, if anything?

Actually it was just an idea to have a fixed interface for all widgets.
Perhaps some necessary functions that need to implemented in each widget, like 
setSize()?



More information about the Panel-devel mailing list