Search code examples
pythonpyqt5scrollbarincrement

Is there a way to set a float for the single step of a pyqt5 scrollbar?


I'm trying to use a scroll bar in a pyqt5 gui. I need it to increment by 0.01 (Total length should be around 390) for a single click on the arrow but it seems like the setSingleStep only takes integers. Is there a way to make a single step 0.01?


Solution

  • I think you must convert to integers these values 390x100 and 0.01x100 setRange(0,39000) and setSingleStep(1) and done :)