View Issue Details

IDProjectCategoryView StatusLast Update
0000854FreeCADFeaturepublic2014-03-09 09:46
Reporterdanielfalck Assigned Towmayer  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Summary0000854: Ability to change number of digits to the right of decimal place in spinboxes
DescriptionIt would be good to be able to have more than two digits to the right of the decimal in some cases for placement, size, etc, in the spinboxes that are in the Property, Data tabs. Having .01 as the smallest value possible with a spinbox sometimes isn't going to work for some things.
I usually work around this by using python scripting, but I think a lot of engineers might not want to do this.
If this is a lot of work, let me know. I should be able to help with this, if I can figure out where to start. I grepped the source and there seem to be thousands of references to "PrefDoubleSpinBox" , so I'm a bit intimidated.
Thanks,
Dan
TagsNo tags attached.
FreeCAD Information

Relationships

related to 0001178 closed Increase decimal precision 
related to 0001107 closedwmayer Ability to specify more decimal places of precision for fillets, etc. 

Activities

wmayer

2012-10-08 12:58

administrator   ~0002444

For double spin boxes of the property editor we already have a solution. There we use the number of decimals of the units API framework.

At the moment you can set the default value in the parameter editor under BaseApp/Preferences/Units/Decimals.

For all other double spin boxes used in dialogs it is not that easy. Here we have to explicitly add a line for each occurrence of a double spin box and set its number of decimals:
spinBox->setDecimals(Base::UnitsApi::getDecimals());

Or instead of doing this for every single spin box which is a bit tedious we can do that in the command class or in the dialog class:
QList<QDoubleSpinBox*> list = dialog->findChildren<QDoubleSpinBox*>();
for (QList<QDoubleSpinBox*>::iterator it = list.begin(); it != list.end(); ++it)
    (*it)->setDecimals(Base::UnitsApi::getDecimals());

danielfalck

2012-10-09 23:51

reporter   ~0002449

Thanks. I have this version running on this machine at the moment:
OS: Ubuntu 10.04.4 LTS
Platform: 64-bit
Version: 0.13.1512 (Git)
Branch: master
Hash: e11e4ba9ff7caaff018c27c1690926041ff94c5e
Python version: 2.6.5
Qt version: 4.7.0
Coin version: 3.1.2
SoQt version: 1.4.2a
OCC version: 6.5.0


Under 'Tools' 'Edit Parameters' 'BaseApp/Preferences/Units/' the screen has nothing to edit- it's blank

wmayer

2012-10-10 07:12

administrator   ~0002450

You have to manually add the new parameter "Decimals" (type is int) and set the number of decimals you want. Then restart FreeCAD.

normandc

2013-06-29 16:08

manager   ~0003299

Couldn't the Decimals parameter be created automatically at FreeCAD install so the end user doesn't have to?

yorik

2013-09-29 14:22

administrator   ~0003700

I just adapted the Draft and Arch modules to use this setting too

Related Changesets

FreeCAD: master fb994e20

2014-02-16 18:02:09

wmayer

Details Diff
+ fixes 0000854: Ability to change number of digits to the right of decimal place in spinboxes Affected Issues
0000854, 0001107
mod - src/Gui/InputVector.cpp Diff File
mod - src/Gui/Placement.cpp Diff File
mod - src/Mod/Inspection/Gui/VisualInspection.cpp Diff File
mod - src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp Diff File
mod - src/Mod/Part/Gui/CrossSections.cpp Diff File
mod - src/Mod/Part/Gui/DlgExtrusion.cpp Diff File
mod - src/Mod/Part/Gui/DlgFilletEdges.cpp Diff File
mod - src/Mod/Part/Gui/DlgPartCylinderImp.cpp Diff File
mod - src/Mod/Part/Gui/DlgPrimitives.cpp Diff File
mod - src/Mod/Part/Gui/DlgRevolution.cpp Diff File
mod - src/Mod/Part/Gui/Mirroring.cpp Diff File
mod - src/Mod/Part/Gui/TaskOffset.cpp Diff File
mod - src/Mod/PartDesign/Gui/TaskChamferParameters.cpp Diff File
mod - src/Mod/PartDesign/Gui/TaskDraftParameters.cpp Diff File
mod - src/Mod/PartDesign/Gui/TaskFilletParameters.cpp Diff File
mod - src/Mod/PartDesign/Gui/TaskGrooveParameters.cpp Diff File
mod - src/Mod/PartDesign/Gui/TaskHoleParameters.cpp Diff File
mod - src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp Diff File
mod - src/Mod/PartDesign/Gui/TaskPocketParameters.cpp Diff File
mod - src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp Diff File
mod - src/Mod/PartDesign/Gui/TaskRevolutionParameters.cpp Diff File
mod - src/Mod/PartDesign/Gui/TaskScaledParameters.cpp Diff File

Issue History

Date Modified Username Field Change
2012-10-07 17:03 danielfalck New Issue
2012-10-08 12:58 wmayer Note Added: 0002444
2012-10-09 23:51 danielfalck Note Added: 0002449
2012-10-10 07:12 wmayer Note Added: 0002450
2013-06-29 15:40 wmayer Status new => assigned
2013-06-29 15:40 wmayer Assigned To => wmayer
2013-06-29 16:08 normandc Note Added: 0003299
2013-09-29 14:22 yorik Note Added: 0003700
2014-02-16 17:30 wmayer Changeset attached => FreeCAD Master master fb994e20
2014-02-16 17:30 wmayer Status assigned => closed
2014-02-16 17:30 wmayer Resolution open => fixed
2014-02-16 17:50 wmayer Relationship added related to 0001178
2014-03-09 09:46 wmayer Relationship added related to 0001107