On Fri, Aug 24, 2001 at 12:48:54PM +1000, Allan Rae wrote:
> On Fri, 24 Aug 2001, John Levon wrote:
>
> > Here's exactly what's going on :
> >
> > controller calls update()
> > in my update() I do ->setText() on a text object
> > This setText() queues a Qt2 signal emit
> > return from update(), finish everything and go back to the event loop
> >
> > --- at this point, everything is fine, but we have a pending event ---
> >
> > event loop invokes the signal, which ends up calling changed(), which calls
>bc().valid()#
> >
> > Whoops, I haven't changed anything, but I've told the BC otherwise !
>
> Are you sure Qt2 requires you to use setText()? Is there another silent
> function?
> Alternatively, is there some control mask for the connection that lets you
> specify what constitutes a signalible(?) event?
no, not as far as I know. Anyway this breaks the nice invariant that all changes
to the value emit a signal
> Can you instead take a hammer and bash the connection from
> setText so that the emitted signal goes somewhere safe (like a dummy
> handler or something) and then when you've finished updating/restoring
> reset the connection?
this would lead to some horrendous code I think.
I can't think of a way to nicely disable this situation generally. Instead of
changed(),
we could be calling anything, that might affect the button controller, in the general
case.
So this is a really big problem which must be dealt with generally.
How about a controller().ignore(true); ... controller().ignore(false) ?
regards
john
--
"That's just kitten-eating wrong."
- Richard Henderson