I have implemented a pyqtgraph parameter tree in my application.  Most of 
the parameters are SimpleParameter's with float or int type.  pyqtgraph 
takes care of generating the tree items which are WidgetParameterItems with 
a pyqtgraph spinbox.  I would like to default the values to '' and allow 
users to enter nothing - i.e., an empty spinbox.  Currently when you delete 
the spinbox contents (or set default = ''), it defaults to zero.  This is 
proving difficult for me to change.  

At first, I tried providing a different evalFunc to the spinbox, but that 
was not enough.

So, far I've overridden the following spinbox functions:  interpret, 
setValue, emitChanged, and value.  Also overidden 
parameterTypes.SimpleParameter._interpretValue.

It now seems to be working as I expect (allowing users delete spinbox 
contents and set value to '')

I'm wondering if there is a better way altogether - my approach seems messy 
and not supportable long term.  I love the functionality that pyqtrgraph 
parameter tree items provides (spinbox functionality, data validation, si 
prefixes and units).  Does anyone have any suggestions on a better way to 
do this?

Also, this seems like a reasonable feature request (allowing blanks in 
parameter tree items of type int/float).  I imagine others would have 
encountered this need?  Am I missing something?

Thanks!

P.S.  I love pyqtgraph!  Thanks for creating and maintaining this library!




-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/1c9a3300-5996-4a6e-a888-40f3841abb87o%40googlegroups.com.

Reply via email to