endless loop in KDoubleNumInput (with patch)

Lubos Lunak l.lunak at suse.cz
Fri Nov 15 14:34:17 GMT 2002


On Friday 15 November 2002 15:02, Matthias Kretz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thursday 14 November 2002 19:01, Dirk Mueller wrote:
> > On Mit, 13 Nov 2002, Matthias Kretz wrote:
> > > calling KDoubleNumInput::setRange may cause an endless loop if
> > > d->spin->setRange changes the value of the spinbox. Because that
> > > automatically changes the value of the slider which in turn changes the
> > > value of the spinbox ... and so forth.
> >
> > spin->setRange should block signals then.
>
> But what about those who rely on the signal
> KDoubleNumInput::valueChanged(double) being emitted on range change?
> Granted, I don't know if that's important, but nevertheless it could be the
> source for bugs, no?

 If you want only to avoid getting your slot called from a signal from some 
object as a response to doing something with the object, you should rather 
termporarily disconnect the slot (or have a bool for ignoring the call) 
rather than blocking all signals from the object.

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/




More information about the kde-core-devel mailing list