[Uml-devel] GraphicsView port: Approach
krishna.ggk at gmail.com
Tue Apr 29 00:24:16 UTC 2008
> > (4) Rip off WidgetBase. UMLWidget will be base class of widgets in
> > general(both rectangular and non rectangular)
> I had made WidgetBase to factor the methods that are common between
> UMLWidget and AssociationWidget.
> I am not sure why you want to remove that class (?)
> > The sub classes can then easily be implemented for specific purpose
> > (LinkWidget for eg)
> Are you saying that LinkWidget would inherit from UMLWidget?
> But UMLWidget has a rectangular quality while LinkWidget does not?
> Please explain your proposed inheritance graph.
I thought of removing the WidgetBase to avoid multiple inheritance
which was required for QCanvas based code.
Also there the LinkWidget uses an Q3CanvasLine as its member and not
inherit any QCanvas*
I think it is better to have uniform code through out, and hence
make UMLWidget inherit QGraphicsItem (not QG*RectItem)
In the implementation for association widgets, we can use some methods
like QGraphicsItem::shape() to implement the line properties. Thus we
don't actually have to separate the rectangular and the line widgets
in the topmost hierarchy.
> > (6) Try to remove signals, slots and finally QObject base for
> > UMLWidget and also UMLObject if possible.
> Well, a few of the signals/slots are really okay.
> For example, on renaming a class in the list view, all widget
> representations of the class should be updated to the new name
> (this may affect multiple diagrams.)
Yes you are right. Qt code without signal-slot doesn't sound great ;)
But what I actually want to do is keep signal-slot number in minimum
which is very much possible due the GraphicsView framework goodies.
> Hope this helps
Thanks for the reply :-)
BTW I think using "QPen and QBrush" instead of "LineColor, FillColor
and UseFillColor" will be better to hold the same information to draw
UMLWidgets. This allows Gradients, fillpatterns to be used for filling
and custom line width, line joining styles for the lines.
Gopala Krishna A
More information about the umbrello-devel