Summary: | KDoubleNumInput is broken in KDE4 | ||
---|---|---|---|
Product: | [Unmaintained] kdelibs | Reporter: | Gandalf Lechner <gandalflechner> |
Component: | kdeui | Assignee: | kdelibs bugs <kdelibs-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | andi.clemens, caulier.gilles, cfeck, digikam-bugs-null, Julien, lure, marcel.wiesweg, mikmach, uwolfer |
Priority: | VHI | ||
Version: | SVN | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Fixes issues with small double numbers |
Description
Gandalf Lechner
2008-08-01 19:09:30 UTC
Looks like a KDE bug into KDoubleNumInput Look at the code from knuminput.cpp (current trunk): // upcast to base type to get the minimum/maximum in int form: QDoubleSpinBox * spin = d->spin; int slmax = spin->maximum(); <-- What if maximum is 0.4? Slider's maximum is 0. int slmin = spin->minimum(); <-- same for this int slvalue = spin->value(); <-- int slstep = spin->singleStep(); <-- Step 0.01? slstep is 0 ... priv->m_slider = new QSlider(Qt::Horizontal, this); priv->m_slider->setMinimum(slmin); priv->m_slider->setMaximum(slmax); priv->m_slider->setSingleStep(slstep); priv->m_slider->setValue(slvalue); Look at compilation warning: /home/marcel/freshmeat/multimedia/kde4/src/KDE/kdelibs/kdeui/widgets/knuminput.cpp:834: warning: converting to 'int' from 'double' Gilles Caulier *** Bug 177876 has been marked as a duplicate of this bug. *** How can we raise priority for this to get on fixed before 4.2 release? I'm agree with Luka. This file is very important for digiKam. KDoubleNumInput widget is everywhere in digiKam (Raw decoding, editor plugins, etc...) Dysfunctions from this widget reduce digiKam usability. Thanks in advance to take a look on this problem before KDE 4.2 release. Happy new year. Gilles Caulier Created attachment 29806 [details]
Fixes issues with small double numbers
Please seems to work well with the class test; though I have not tested it with digikam. Please test it and let me know some feedback.
Anyway, the whole knuminput classes could need some revamp....
Andi, Marcel, Mik, If you use KDE4 from trunk, please test patch from Urs with digiKam. Here i still use KDE 4.1.3. Thanks in advance Gilles Caulier Looks OK. There are still few things I noticed: - by moving slider values change by 0.10, not fluently; I can insert more precise values in numeric fields; in connection with complex limitations of values in some plugins this creates some mess - in White Balance, Black point setting is limited only to 0.05 amplitude so by moving slider there are only two positions 0.0 and 0.05 - Restoration -> General -> Smoothing while dragging slider it sometimes add/remove 0.01 from value There is definite improvement but things still feel awkward. SVN commit 904333 by uwolfer: Fix slider for KDoubleNumInput when using very small numbers. Thanks for the feedback Mikolaj; I have adjusted the patch so it should work better in your cases. BUG:168022 M +8 -4 knuminput.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=904333 The slider still has problems, e.g. using KDoubleNumInput *input = new KDoubleNumInput(0.1, 3.0, 1.0, mainWindow); input->setSliderEnabled(true); input->setSingleStep(0.01); does only allow 11 distinct values, it should allow (3.0 - 0.1) / 0.01 + 1 = 291 values. See duplicate bug report. *** Bug 216630 has been marked as a duplicate of this bug. *** SVN commit 1060479 by cfeck: Improve KDoubleNumInput slider * Fixed crash on minimum == maximum * Fixed incorrect slider value for exponentRatio != 1.0 * Correctly compute number of steps for small ranges * Improve slider usability for large ranges and exponential sliders BUG: 168022 M +14 -18 knuminput.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1060479 |