QLCDNumber fixed width for numbers
Is there a possible solution to the following problem?
I am using a QLCDNumber widget in Qt 3.3.4.
I've set the widget to use 5 digits with setNumDigits(5).
But the LCD doesn't print the numbers the way I would like to see them display.
The idea is that the number 0.500 will be printed like 0.500, but the LCD prints: 0.5
and, e.g. 1.460 is printed like 1.46 which should be printed as 1.460.
I found the same problem in the old Qt interest archive, but didn't include an answer:
Are there are some ideas to solve this in a simple way? :)
I would format the number with "QString::arg() ":http://doc.qt.nokia.com/3.3/qstring.html#arg-a to a QString and set the display with "QLCDNumber::display() ":http://doc.qt.nokia.com/3.3/qlcdnumber.html#display that takes a QString as argument.
Thanks for the tip!
It works OK, I have used QString::sprintf() for formatting, and then transfered the QString to the QLCDNumber :)