PDA

View Full Version : QLineEdit



rick_st3
14th June 2008, 08:34
How do I take number inputs from QLineEdit ? Say,if I wanted to multiply 2 numbers taking the two numbers from two different QLineEdit and display the result in a third QLineEdit.
And how would I link another program which performs the calculations with QLineEdit , both for taking inputs from QLineEdits and displaying the result in another one ? And also can I imply certain restriction on the value being entered ? Say,I wanted the QLineEdit to take only float values. How do I do it..??

wysota
14th June 2008, 09:05
QLineEdit::text(), QString::toInt(), QDoubleValidator or simply use QDoubleSpinBox instead of the line edit.