How can i have a textEdit which just receive number?
-
Hi
How can i have a textEdit which just receive number?
What member of QTextEdit class i should use ?
if user write anything except numbers , i want to make a warning.
Thanks -
Hi,
Do you really need a QTextEdit or would a QSpinBox be enough ?
-
Thanks @SGaist
I need QTextEdit because i have a textEdit and user want to write a number , if user write alphabet i want to which textedit drop that.
sorry if my english is bad. -
That I understood, my question was rather: do you need any feature of QTextEdit for your use case ? If not then, using a QSpinBox would make more sense.
Otherwise you'll have to implement a solution like described here.
-
Thanks @SGaist
I saw QSpingbox , I can enter 2 numbers and no more.
Why? can i enter 7 or 8 number ? -
It's up to you to fix the limit of what can be entered in your QSpinBox. Take a look at setMinimum and setMaximum