QT Creator Spin Box for hex values
I am new to C++ and QT. I am using QT Creator 1.0.0 to create a GUI. I have a hex value I need to lookup and display to the user and allow the user to change that value.
Basically, I am looking for the Microsoft Visual Studio NumericUpDown Hexadecimal properties equivelant in QT.
Re: QT Creator Spin Box for hex values
Hi, you can subclass QSpinBox and show your hex value with it.
Ginsengelf
Re: QT Creator Spin Box for hex values
Re: QT Creator Spin Box for hex values
Thank you for your reply.
I do not see this property in the QT Creator Property table. Can it be set from QT Creator. As I mentioned, I am new to C++ and QT, so QT Creator is the simplest and fastest solution for me.
Re: QT Creator Spin Box for hex values
Don't expect to find any simple property in Qt Creator for this. Ginsengelf suggested that you subclass QSpinBox and reimplement textFromValue() and valueFromText() to show hexadecimal values. I pointed out that such class already exists in Qxt - an extension library for Qt (it is not part of Qt, but a separate community driven amateur project to provide most often requested features that are missing from Qt).
Re: QT Creator Spin Box for hex values
There is an example of a Hex Spinbox in the C++ GUI Programming with Qt 4 book. Google has these pages here.
Re: QT Creator Spin Box for hex values
Thanks for the information. I am new to C++ and OOP programming in general, so I am somewhat reliant on Qt Creator.
Is there a way to "promote" a spinbox on the toolbar in Qt Creator or to add a new hex spinbox widget to the toolbar in Qt Creator?