QtnProperty icon indicating copy to clipboard operation
QtnProperty copied to clipboard

How enter and display properties of double type in scientific notation

Open kleomash opened this issue 3 years ago • 2 comments

Hi!

I operate with small values which should be entered in scientific notation. For example 0.000000001 is more convenient when written as 1.0e-9.

Is it possible to set up display format for qtnCreateProperty<QtnPropertyDouble>?

kleomash avatar Jun 29 '21 11:06 kleomash

Visual aspects of properties can be tuned by property delegates.

For example for Float property we have QtnPropertyDelegateFloat default delegate with min/max/step/suffix/multiplier/precision attributes which can be configured.

To modify these attributes you can use code like this:

    auto p = qtnCreateProperty<QtnPropertyFloat>(parent);
    p->setDelegateAttribute("min", -3);

Scientific/Regular notation is not supported now. I think it could be implemented in the existing delegate class or implemented as a separate delegate.

@kusharami It seems QtnPropertyDelegateFloat delegate was heavily refactored by you. What do you think about scientific notation support for Double/Float? Can we add such support to the existing delegate?

lexxmark avatar Jun 30 '21 04:06 lexxmark

What do you think about scientific notation support for Double/Float? Can we add such support to the existing delegate?

It seems that a new floating point spin box implementation is needed to achieve this

kusharami avatar Jul 17 '21 12:07 kusharami