QDoubleSpinBox with Hexadecimal value
-
Hi!
Trying to use QDoubleSpinBox to show uint64 values in hex.
QDoubleSpinBox is good for uint64 values, but is not good for hex view.
Is it possible?
Thank you!@sitesv sure, override textFromValue
-
Hi!
Trying to use QDoubleSpinBox to show uint64 values in hex.
QDoubleSpinBox is good for uint64 values, but is not good for hex view.
Is it possible?
Thank you!@sitesv
QDoubleSpinBox
deals indouble
s rather then theint
ofQSpinBox
, and it does not have the "integer base" option of the latter. Floating point values do not offer the ability to use a non-10 base supported in integers.You may have to roll your own. I think you would be better heading out from a
QSpinBox
-type with anint64
value thanQDoubleSpinBox
'sdouble
. See e.g. How to subclass QSpinBox so it could have int64 values as maxium and minimum, the solution there does not look like too much code. There is also https://stackoverflow.com/a/26581445/489865 if you need help on the hex digit side of things. Further examples are available by Googlingqspinbox int64
.P.S.
Thinking about it,double
cannot represent the full range of values foruint64
since both are 64-bits big! So if you are wanting to use the full range you will have abandondouble
as your type!