Monday, 16 June 2008

Umbrello : More improvements follow!

Did i say my exams are nearing and i'll stop working for now on GSoC ?
Argg... GraphicsView is so addictive!

Fortunately i could pull out a couple of hours on umbrello, and guess what - I got resizing of the widgets working !!

All the eight resize handles which appear on selecting a widget are functional :-)
And the resize handles respect the minimum size and maximum size constraints of widget, neat (aseigo's TM ;) )

The current trunk and its predecessors have a size-grip which is the only way a widget can be resized. OTOH, I removed this size-grip. I am not really sure whether this move is sane or not.

And I am happy because I could achieve this in a clean generic way - including the changing cursor on hovering :-) I digged a bit of Qt-designer code which helped me a bit.

Here is a screen shot.


One good thing i have learnt so far is to document the code first before writing the actual code. This maximizes the focus on the exact functionality of a method/class before it is actually coded.

Update: Btw i also tweaked the enum widget painting code to use the extra space generated due to resizing. Here is screen shot of that.


Ok ok, no more gsoc until July 5th!
Study Study Study :)
Cheers.

Saturday, 14 June 2008

Umbrello gets gradient support!

Groovy!

I just committed the new version of base widget classes (not QWidget but QGraphicsItem) into my soc branch which enables gradients to be used with umbrello widgets like EnumWidget and it already works :) I tested this change by creating a NewEnumWidget class, and it already makes the old enum widget feel as second class citizen :)

Here is a screenshot.



To be technically honest, i just had to make QPen and QBrush as widget members rather than QColors.
But designing the base classes is not that easy as I need to keep in my mind about all possible usages by the subclasses. I have spent lot of time on the design. I was in a dilemma whether to inherit QGraphicsItem or QGraphicsWidget, but later settled onto the former as it is not heavy. So i had to duplicate a bit of functionality of QGraphicsWidget like sizeHint.
/me is happy with the design so far :)

Also i did a dired-do-query-replace-regexp (yeah i am emacsean ;) ) on the source directory to convert all widget::draw methods to its equivalent widget::paint method, which means almost all widgets are now shown on diagram as and when dropped. The widgets can be moved around. Also the AssociationWidgets show up, but are static i.e they don't update when any connected widget moves.

I should now better study for my exam. I'll get back to work after July 5th.
Until then bbye!!

Monday, 9 June 2008

Hello planet (late hello ;) )

Hello planet

I noticed it late, that my blog got syndicated to planet. Thanks a lot Chris for adding me :-)

So here is just a small introduction of me and my gsoc project,
I am Gopala Krishna, doing engineering in Information Science at Bangalore.

My gsoc project is to do the GraphicsView port of Umbrello and add a couple of usability/cool features like inplace editing of diagram texts, gradient editor..

My mentor is Jonathan Riddell - a kool kubentero :)

I have done some progress with my gsoc work and i have blogged it here.

My gsoc project helps me in my exam!

Yeah, thats true.. Today my gsoc project - Umbrello helped me do well in my viva during my practical exam for the subject OOPS.

The actual program i got in my exam was to demo Quick Sort which was fairly easy. After that there was a brief session of viva. The first few were good ground up c++ questions which i could answer.
The last two questions were surprisingly based on uml class diagrams (which we have in next semester) Good news, is i could answer them easily as that is what my project is based on :P
Honestly though the answers might not directly map to marks it surely has helped to earn some *impression* about me :)


Now, that one practical is over, I have Microprocessor programming practical exam on 11th. The problem with that exam is, we are most of the times not confident of getting output in the hardware part(elevator, keypad..)

I have actually understood the assembly language constructs well, as i also double as teacher sometimes to my friends ;)
Good thing is i found an 8086 emulator designed by my seniors which works fairly well. I was just thinking why they didn't make it open source.

Anyways I got to still practice some programs.
GSoC needs to wait for my exams to get over now :(

Friday, 6 June 2008

First progress!

Yay!!
I could complete my first round of the GraphicsView port of umbrello after ~15 days of hard work. My morale was low until now because, i was not able to commit anything.
The quote "no commit means no work" which i read somewhere in GSoC docs was banging my head. I made my mind strong and worked for about 16hrs a day for the last two days which beared fruits in the end. Usually
the port kind of work takes longer time than expected as it involves lots of files.

The good news is
I got umbrello compiling and also some bits of the diagram tools working. Umbrello is now free from QCanvas based code ! There are tons of int-qreal, QRect-QRectF and QPoint-QPointF changes. Screenshot at this stage is useless!

I have to attribute part of my success to emacs, which helped me simplify repetitive work by using simple keyboard macros. That feature is so simple yet extremely powerful!

Of course i still have lots to do. There is simply no direct mapping for QCanvas to QGraphicsView technology. Infact all the book keeping and manual mouseEvent mapping code has to be scrapped as GraphicsView does it in best way.

I had two options to continue with my project


1) Get all the diagram widgets working by least modification, that is forcefully fit the code to GV framework.

2) Redesign the base-foundation classes like UMLWidget(not a QWidget), UMLScene.. and then port the remaining widgets to use this robust base classes later.

I being brave, chose the option 2 :-)
I am designing new classes like NewUMLWidget which will become UMLWidget soon. This way i don't have to port other widget subclasses now (smart right ? ;-) )

On the other side of development, I also did my first ever bug fix within umbrello.
The bug was nasty, resulting in displaced partial fonts throughout the umbrello gui(menu/toolbars..). The strange thing was, the bug showed up only when not using default font that comes with kde4. Rafael challenged me to fix it on #umbrello for a chocolate box ;)

Here is a snapshot of the buggy display

I by looking at screenshot immediately knew that it was because of creation of QFont object before creation of QApplication object. I knew it because, i had faced exactly same situation in the qucs-port. Indeed there was a global object of a state structure which had QFont objects in it.
The first fix to my branch was to create my own singleton class, but then later Rafael mention K_CONFIG_STATIC. Using that code was way simple and I committed the fix to trunk as well :)

I am happy for seeing so many positives , that too on a single day. :-) I hope it continues :)
My next objective is to perform well in my exams.
Practical exams are due on 9th and 11th of this month and
Theory subjects are between 24th june to 5th july.