On Thursday 01 July 2010 03:01:05 Diego Turcios wrote: > Hi guys > I thinks this is the right mailing list for my doubt. > I am working on a small application in QT. But right now I have the > following problem. > I have a line edit, and I want to manipulate the values so only numbers > (doubles) can be written on this line edit.
The right way to do this in Qt is to use a validator. Just write this line in the constructor of your dialog (after setting up the ui). ui->LEPrecio->setValidator( new QDoubleValidator ); This way you are sure the user can only type a double. No need to do any check. Nicolas -- Nicolas Arnaud-Cormos | [email protected] | Software Engineer Klarälvdalens Datakonsult AB, a KDAB Group company Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322) KDAB - Qt Experts - Platform-independent software solutions _______________________________________________ Qt-creator mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-creator
