I guess my suggestion wasn't very good. The accuracy supplied
by the sliders are probably limited by the width (i.e. the number of
pixels),
not by the range.

Searching the internet, it seems like the common answer is to
use a slider like this:

class DoubleSlider : public QSlider {
    Q_OBJECT
public:
    DoubleSlider(QWidget *parent = 0) : QSlider(parent) {
        connect(this, SIGNAL(valueChanged(int)),
            this, SLOT(notifyValueChanged(int)));
    }

signals:
    void doubleValueChanged(double value);
public slots:
    void notifyValueChanged(int value) {
        double doubleValue = value / 10.0;
        emit doubleValueChanged(doubleValue);
    }};



On Mon, Aug 8, 2016 at 2:37 PM, Aidan O Boyle <aidan.o-bo...@ucdconnect.ie>
wrote:

> Yes I tried that and the results is still the same.
>
> On 8 August 2016 at 13:22, Kjetil Matheussen <k.s.matheus...@gmail.com>
> wrote:
>
>> Hi,
>>
>> Did you try to compile with -double or -quad when you increased the range?
>>
>>
>> On Mon, Aug 8, 2016 at 2:14 PM, Aidan O Boyle <
>> aidan.o-bo...@ucdconnect.ie> wrote:
>>
>>> Hi Kjetil,
>>>
>>> Thank you very much for the response. Yes you understand the problem
>>> correctly. The numeric entry next to a QT slider display the correct number
>>> of digits but truncates the number displayed to three decimal places.
>>>
>>> I think you're theory is right, it certainly seems likely that the
>>> numeric entries can support a higher precision than the sliders. I tired
>>> changing the hardcoded range but it had no effect. I will settle for 3
>>> decimal places for now :).
>>>
>>> Regards,
>>> Aidan.
>>>
>>> On 4 August 2016 at 15:50, Kjetil Matheussen <k.s.matheus...@gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> If I understand you correctly, the problem is that you can not write,
>>>> for instance, "0.0000001" into a numeric entry?
>>>> Looking quickly at faustqt.h, it seems like the sliders are hardcoded
>>>> to support a range of only 10000.
>>>>
>>>> A theory why it doesn't work to set
>>>> very accurate numbers in the numeric entry would be that the
>>>> numeric entry widget signals the new value to the slider, which
>>>> doesn't support that kind of accuracy, so it converts it, and then
>>>> sends it back again to the numeric entry with less accuracy.
>>>>
>>>> If this is the reason, it might work to change all the hardocded "10000"
>>>> values in faustqt.h /  uiSlider into something much bigger.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Aug 4, 2016 at 3:23 PM, Aidan O Boyle <
>>>> aidan.o-bo...@ucdconnect.ie> wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> I am having difficulty getting the correct precision for the numeric
>>>>> display of sliders (vertical or horizontal). This is the case both with 
>>>>> GTK
>>>>> and QT. My problem is that I would like to specify a slider step of say,
>>>>> 0.000001. The QT app numerical entry field to the right of the slider
>>>>> displays a number with this same precision however only the first three
>>>>> decimal places are actually used (the last three remain 0). Furthermore 
>>>>> the
>>>>> step size implemented is actually 0.002.
>>>>>
>>>>> So where a slider is coded as follows:
>>>>> s0 = hslider("h(0)", 0, -5, 5, 0.000001);
>>>>>
>>>>> The behavior as it is incremented either by the slider or numeric
>>>>> entry (QT app only, GTK app does not have a configurable one):
>>>>> 0.002000 -> 0.004000 -> 0.006000 -> 0.008000 -> 0.010000 ...
>>>>>
>>>>> This is also the precision of the slider/numeric entry when the step
>>>>> is specified as 0.0001 or 0.00001. Why does it behave like this? -
>>>>> Defaulting to 3 decimal places with a step of 0.002?
>>>>>
>>>>> However coding a slider like:
>>>>> s0 = hslider("h(0)", 0, -5, 5, 0.001);
>>>>>
>>>>> It works as it should:
>>>>> 0.001 -> 0.002 -> 0.003 -> 0.004 ...
>>>>>
>>>>> So I am wondering if I am missing something? I have tried compiling
>>>>> using -quad and -double options but this has no effect. I had some
>>>>> (beginners) luck getting a step with this many decimal places for a GTK
>>>>> numeric entry but only because I compiled inline and altered the UI class
>>>>> to specify the precision of the step. Is there a way active widgets like
>>>>> the above can be made to abide to this many decimal places for a step?
>>>>>
>>>>> Sorry for a n00bish question, I am new to Faust. Any help/clarity
>>>>> would be much appreciated.
>>>>>
>>>>> Regards, Aidan.
>>>>>
>>>>> ------------------------------------------------------------
>>>>> ------------------
>>>>>
>>>>> _______________________________________________
>>>>> Faudiostream-users mailing list
>>>>> Faudiostream-users@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>>>>>
>>>>>
>>>>
>>>
>>
>
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to