Today was a fresh day, the day after my class internal tests. After my daily morning routine, i started thinking about what i can code in qucs-qt4 today. Ideas started sprouting up in my mind.
I had written a few classes to render svg before which somehow seemed to have flaws in them. Well i had neglected the fact that QSvgRenderer::repaintNeeded() signal is indeed needed to update svg when the style of svg changes. I could imagine bug where changing stylesheet of an item, didn't change all the svg items sharing the renderer.
Hmm i thought and i started sketching up my thoughts for the new design and SvgItem, SvgPainter and SvgItemData classes were born.
SvgItemData simply wraps the shared data in a class and SvgPainter renders the svg. SvgItem uses SvgPainter internally. I used the repaintNeeded() signal this time.
The design seems neat atleast for now ;) It was tiring in the end with more that 550 lines of code and modifications here and there in other files.
Here are sample screen shots


0 comments:
Post a Comment