[Qt-interest] Widget for floating point number input?
David Boosalis
david.boosalis at gmail.com
Sat Feb 27 17:17:44 CET 2010
QLCNumber accepts doubles. You have to play with its pallet or style sheet
to make it look nice.
QLineEdit works fine if you use QLineEdit::setText(QString::number(float));
You will have to do a little more work to get the format you like but its
really trivial to implement. If you need more control and want to implement
this widget in more then one place, create you own widget from base class
QLineEdit and add methods such as :setFloat(double), double getFloat()
-david
On Fri, Feb 26, 2010 at 3:35 PM, Rui Maciel <rui.maciel at gmail.com> wrote:
> What widget do you use to input floating point numbers? I'm having trouble
> discovering a
> widget that handles floating point input well. QSpinBox only deals with
> ints, QDoubleSpinBox
> is terribly limited (doesn't accept values greater than 10^10-1) and
> QLineEdit and it's mask
> is terribly restrictive.
>
> So, what widget do you use?
>
>
> Thanks in advance,
> Rui Maciel
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100227/62468e88/attachment.html
More information about the Qt-interest-old
mailing list