Directly control inputfield units

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Post Reply
User avatar
sliptonic
Veteran
Posts: 3410
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Directly control inputfield units

Post by sliptonic »

Can I explicitly (from Python) set the displayed units of a inputfield? For example, if the user has Standard units set for their UI default and a field is showing '6.35 mm' can I change the unit for that one field so it shows '0.25 in'?
wmayer
Founder
Posts: 20074
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Directly control inputfield units

Post by wmayer »

You can change the quantity type, the format of how floats should be displayed or the number of decimals but you cannot change the unit scheme. At the moment this always follows on what is set in the preferences.

In order to support this the InputField class must be adjusted. Feel free to open a feature request.
User avatar
sliptonic
Veteran
Posts: 3410
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Directly control inputfield units

Post by sliptonic »

Thank Werner,
I created an issue https://www.freecadweb.org/tracker/view.php?id=3966

I accidentally created in the Path project and I don't seem to have authority to move it someplace more appropriate. If necessary, I'll delete and recreate.
chrisb
Veteran
Posts: 52143
Joined: Tue Mar 17, 2015 9:14 am

Re: Directly control inputfield units

Post by chrisb »

I have a move button and moved it to the general FreeCAD section.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply