Dead end…

I’ve spent much of today working on things to do with the title block in Drawing – both the old and new versions. This morning, there was some investigation into a bug in the old Drawing, then after that I’ve been working on implementing a nice UI for editing text fields from templates…

My idea was to make text in the SVG template be clickable, so the user could just click on the drawing’s title and edit the title, for instance. Sounds simple enough, but the plan involved one slight complication that’s turned out to require a fair bit of effort. It’s easy to extract the coordinates of the beginning of the text from the source SVG file, but it’s not trivial to get the width and height of the rendered text. That’s important because the width and height are required to determine what area needs to be clickable.

There’s a documented function in Qt though, which should allow one to use the SVG ID of an item in an SVG document to get the width and height once it’s rendered. So, I spent some time getting things setup to use that function, and found that it didn’t work. After spending some time trying to figure out where I had screwed up, I found a post explaining that the function I wanted to use wasn’t actually implemented for SVG text items…

Anyways, a couple random distractions later (some related to the PropertyEnumeration refactoring effort, which has been pushed to the main line and so some folks have been forced into testing it 😉 ), and I’m making some progress again on Drawing.

I probably won’t be updating this much over the next few days, as I’ll be travelling, but stay tuned!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s