Fading Memories

About

Ramblings about books and other things that will soon fade from my memory.

Boudewijn Rempt

index | rss1.0

Check out my sculpture website: www.boudewijnrempt.nl.

There's more...

Creative Commons License
The original artwork is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License.

Roundabout through identi.ca

    follow me on Identi.ca

    Categories, too

    Find


    Archives

    Other things here at valdyas.org

    2010-03-03

    Writing a custom widget...

    One of the dangers of having a real interaction designer look at your application is that they are apt to suggest that some special widget might make your app much nicer, much more efficient, much more usable. And they are right, of course. Which sucks because writing a custom widget that respects the application style is not fun, at least not in Qt, but I haven't seen any toolkit that makes it fun.

    And a custom widget in this context is not a form with two or three existing widgets in a layout and some signals to connect them.

    So let's look at the widget Peter suggested we use instead of KDE's or Qt's spinboxes and sliders. The needs are clear: we need a numerical input widget that shows visually what part of the total is enabled. Mouse wheel, tablet tilt and drag need to decrease or increase the value, clicking somewhere in the widget needs to set the value to that level. It should show the value as numbers inside the widget. Spinbox arrows and behaviour would be nice. It should have double and int support. And finally, it should have an option for exponential or segmented behaviour (1 - 10: stepsize 1, 10-100, stepsize 10, 100-100 stepsize 100).

    So, what we are creating is a sort of legitimate bastard child of a progress bar, a spinbox and a slider, all in one area. Something that looks a bit like this, but less like a progressbar:

    Well... Sven has spent half a day on this, I've spent a day on it... I guess this is not our forte. There doesn't seem to be much documentation on the topic of creating widgets from scratch. I've also been looking for exising Qt implementations, but haven't found anything. So... If there is anyone who knows where I can find a widget like this, or who would like to help Krita by implementing it, please, please, please tell me!