Benjamin K. Stuhl wrote:

> Hi Jeremy,
>   I'm looking into making the control graph items nudgeable using the
> keyboard, but I've run into a roadblock: plotwindow.selectedWidgets()
> destroys and recreates the control items. Since
> plotwindow.selectedWidgets() is regularly called from the update timer,
> this means that the control items don't stick around long enough to keep
> keyboard focus!
>   Is there some way to tell if the control items really _need_ to be
> changed (e.g. by the document change set or something), so that I can
> give them a bit more longevity?

Urgh - the design of controlgraphs is a bit ugly isn't it?

What do you think is best?

 - Reimplement them to be some part of the widget which is updated if 
necessary - quite a bit of work. You'd have the same controlgraph for all 
the time for the widget.

 - Only replace them if necessary - I think this will break your keyboard 
moving code still however.

 - Some sort of hack which checks whether a controlgraph has the keyboard 
focus on updating the document, and gives it back to the controlgraph of the 
same widget after updating.

I think the design for controlgraphs is not great as you could 
(theoretically) have two windows onto the same document open, breaking the 
current implementation. I suspect the QPainter passed to widget draw should 
actually keep track of the controlgraphs. We should probably make a proper 
class for this.

In the long run, I think doing this and moving to some sort of update model 
to save having to destroy them all the time would be best.

Jeremy



_______________________________________________
Veusz-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/veusz-discuss

Répondre à