Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

64bit int Spin Box in QT

I'm building a windows program which shall have controls for 64bit numeric values. these controls shall be switchable to be signed or unsigned.

I found two controls: "Spin Box"(int32) and "Double Spin Box"(double) with double I'd be able to cover the range but it can't handle the precision.

Is there a way to change the data type of these controls?

Is it possible to create an own control which can handle signed and unsigned 64bit values? Is it possible to create a 128bit Spin box?

The only work around I can see right now is in using a string control and manually convert to an INT64 or UINT64 but I'm not very happy with this solution

Any other Ideas?

I'm on QT 4.7.4 and VS2010 with C++ thx

like image 764
fpdragon Avatar asked Dec 05 '11 10:12

fpdragon


Video Answer


1 Answers

You can derive QAbstractSpinBox and reimplement at least the virtual functions stepBy, stepEnabled and possibly validate() and fixup() for the input validation.

like image 89
alexisdm Avatar answered Sep 23 '22 19:09

alexisdm