[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    More info; was: KDoubleNumInput issue
From:       TAnGorN (Anatoli Gorchetchnikov) <anatoli () cns ! bu ! edu>
Date:       2001-08-09 17:43:53
[Download RAW message or body]

Well I looked at the KDoubleNumInput source and did not find any 
reason for this, can't look longer till KInNeSS release, so if 
anybody got a moment to spare please look at this. There are two 
problems:

If setValue is called before setRange, then setRange somehow floors 
the value by one step. I'm absolutely sure (48 digits printout :) 
that TSim::timestepGet() below returns 1.000000, not 0.999999.

Second, if setValue is called after setRange (workaround I used for 
now), then value is not corrected by step, so that using up/down 
arrows can lead to something like
0.97
1.07 
1.17
which looks ugly.

Both of those bugs can really frustrate users of any scientific app, 
not just KInNeSS, so I think it is worth to look at.

On Monday 06 August 2001 02:11 pm, TAnGorN (Anatoli Gorchetchnikov) 
wrote:
> Hi guys!
>
> The following piece of code does something weird:
> First I initialize three KDoubleNumInputs, the respective functions
> put 4, 1, and 300 as initial values (they return them for sure, I
> checked :)
>
> d_simLength = new KDoubleNumInput(m_sim->simLengthGet(), this);
> d_timeStep = new KDoubleNumInput(TSim::timestepGet(), this);
> d_outIntrv = new KDoubleNumInput(m_sim->outfileIntervalGet(),
> this);
>
> Then I set the ranges (all initial values are within respective
> range) like this:
>
> d_outIntrv->setRange(0.0, d_simLength->value()*1000.0, 0.01,
> false); d_simLength->setRange(0.1, 1000.0, 0.1, false);
> d_timeStep->setRange(0.01, 100.0, 0.01, false);
>
> Finally, I look at my dialog and see 3.9, 0.99 and 299.99
> respectively. Notice, that precision matches the step parameter in
> setRange. What did I do wrong?
>
> Thanks.

-- 
WBR,
TAnGorN
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic