event bugs & selection picker
Melchior FRANZ
mfranz at kde.org
Fri Apr 29 15:57:43 CEST 2005
Because keyPress() doesn't deliver modifier events, I'm using a QTimer in the
selection picker as a workaround, running with 20 Hz. To save some CPU cycles
"Enter" events start it, and "leave" events stop it. Unfortunately, enter()
events are also broken: if one wants to scroll the image, the following can
happen:
- leaving canvas --> "leave" event (good!)
- click and drag slider
- while dragging, move cursor into canvas area --> no enter event! (bad!)
- release button from slider --> still no enter event (very bad!)
We are now in the canvas, but never got an enter event. The timer isn't started.
The selection picker's Shift/Ctrl/Alt-behavior doesn't work until one leaves
and enters again. Crap.
Although I glanced through all the files, I didn't find the cause. I assume
that it has to do with the tablet support (because in pure Qt this works as
it should).
Of course, the way to go is: fix the keyPress() and the enter() event. But
this is probably not high on anybody's TODO list. (It isn't on mine, at
least. :-)
So, which of these workarounds would you prefer as a temporary solution:
- don't start and stop the timer? It runs *always* then, no matter if the
selection picker is even active. (Would be nice if the tools were told
when they become active and inactive.) 20 Hz isn't *that* much, but if
everyone does it, it becomes a problem.
- put checks into a few extra event handlers (buttonPress, mouseMove) that
start the timer, too, if necessary. (Those are only triggered if the picker
is active, right?)
- remove the whole Ctrl/Alt/Shift feature (because krita just doesn't grok
it yet)
Neither solution pleases me much, but I tend to solution 2 (with a few
comments in the code that explain why this is necessary.) This is, at least,
what I'll commit in the next days if I get no authoritative response. ;-)
m.
More information about the kimageshop
mailing list