[Uml-devel] Building umlwidgets from textitems

Gopala Krishna krishna.ggk at gmail.com
Tue Jun 24 18:07:44 UTC 2008


Hi ,
  I have thought of a new approach for all the uml widgets.

My idea is to first build a generic text item class inheriting
QGraphicsTextItem.
The text item supports hovering, tooltips, coloured text, alignment
and also rich text.

All the widgets , then can use these text-items as its children to
display corresponding text.
The main advantage of this approach is flexibility. This will easily
help us fix lots of wishes and bugs ;)

Here is small program(addhoc) i wrote it for testing.
To run it do "qmake && make && ./textitem"
http://krishna.ggk.googlepages.com/textitem.tar.gz

Here is a snapshot
http://tinyurl.com/4fwn8a


You may increase the number of text-items for further analysis by
changing the for loop condition.
The performance is quite good !

My only concern is probable increase in memory usage,
But i think this is manageable as the number of widgets on a diagram
is usually < 50.

Any comments are appreciated. :)


P.S :
Can i use attachments here ? I read somewhere that it isn't encouraged.
Also if the file isn't downloadable for some reason, mail me.

-- 
Cheers,
Gopala Krishna A




More information about the umbrello-devel mailing list