Search code examples
c++visual-studio-2010qt64-bitcontrols

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


Solution

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