Bug: Wrong unit

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Bug: Wrong unit

Post by openBrain »

PR above merged by @wmayer.
No I released https://github.com/FreeCAD/FreeCAD/pull/5232 that fixes the OP problem.
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Bug: Wrong unit

Post by wmayer »

While testing the recent locale specific PRs I found a small regression caused by PR 5232.

To test create a QuantitySpinBox with no unit:

Code: Select all

ui=Gui.UiLoader()
w=ui.createWidget("Gui::QuantitySpinBox")
w.show()
When you scroll up/down or use the up/down arrow buttons the value doesn't change. It is stuck at 0.000 (or -0.000).
When setting a unit

Code: Select all

w.setProperty("unit", "m")
it starts to work. But when removing the unit again

Code: Select all

w.setProperty("unit", "")
it is stuck again.

When only reverting the changes made to QuantitySpinBox::stepBy() and leave the rest it works normally again.

git commit b330a83273
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Bug: Wrong unit

Post by openBrain »

wmayer wrote: Sat Mar 26, 2022 5:22 pm When only reverting the changes made to QuantitySpinBox::stepBy() and leave the rest it works normally again.

git commit b330a83273
Doing so you introduce a regression. ;)
Take any QuantitySpinbox with Unit preference being "Standard".
* Manually enter value of "9999 mm"
* Step up value -> "10 000 mm" -> OK
* Step up value again -> "11 mm" -> Oups

I can have a look at this in coming days if you want. If you have time or prefer to do it by yourself, please let me know. ;)
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Bug: Wrong unit

Post by wmayer »

Doing so you introduce a regression.
Confirmed.
I can have a look at this in coming days if you want. If you have time or prefer to do it by yourself, please let me know.
Go ahead, please. I will be busy to look at some of the other bugs.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Bug: Wrong unit

Post by openBrain »

wmayer wrote: Wed Mar 30, 2022 11:55 am Go ahead, please. I will be busy to look at some of the other bugs.
PR is here : https://github.com/FreeCAD/FreeCAD/pull/6690 ;)
Post Reply