Nominate our 2022 Qt Champions!

QDial - don't use for fine control ..

  • Hi,

    If you specify a singleStep that is less than 1/32768 of the specified minimum to maximum range,
    then dial can freeze midsweep, on using uparrow or downarrow

    Seems, on adding or subtracting singleStep to the position, it rounds back to where it was
    Meaning, the dial can get stuck, at a seeming random but repeatable position

    Here's an example:

    minimum -12500 maximum 37500 singleStep 1

    Starting from position 0, try using uparrow
    It will get stuck at 410 :-/

    Via another control, you can enter a value that takes it past 410
    And then, reverse back through 410 with downarrow, without issue

    But when you try going forward again, with uparrow, again it sticks at 410

    Anyway, just one to be aware of: Don't try using QDial for very fine control ..

    Best regards,


  • @David-King what if you use two separate dial controls, one for "coarse" control of the value (let's say "unit") and another control for "fine" control (let's say fractions of the unit). This approach was implemented long time ago in actual instruments.

  • Hi Pablo,

    Great idea there ..

    As happens, the same thought occurred to me on drive into work this morning :-)
    And I know that used to be done on eg scientific instruments and high end HiFi's

    For our application though, I'd quite like to keep the UI as simple and approachable as I can
    A single dial, fits the bill - and the 3 speed levels afforded by the following keys, suffice :

    Up/Down keys for slow
    PgUp/PgDn keys for medium
    End/Home keys for fast - see also my post :-)

    Together with, the linear accelerating limit, applied to motion, key or mouse initiated,
    provides for a single dial, with fine through to coarse control..

    What is really needed, I think, is for the QAbstractSlider author, to widen the internal position variable,
    from int16_t to int32_t :-)

    Or perhaps, to provide the option: an added fineControl false/true property, that selects int16_t / int32_t
    Or always int32_t, but zeroes the low 16 bits if false
    Default false, to sidestep any existing app compatibility issues ..

    About the mentioned post, I'll update it in due course, to add the option of linear or exponential.
    Latter confers a nicely weighted dial, I think ..

    And change my CamelCase to javaCase, I'm new to ..

    @JKSH: thanks for the upvote

    Best regards,


Log in to reply