PDA

View Full Version : Validate a value of lineEdit



edgar
6th September 2009, 18:47
hi...

I've problems with validate some values of lineEdit.

I was reading about one way to lineEdith only accept Strings or doubles or ints, but in the file .ui, like a "manual" form.

Boron
6th September 2009, 19:22
See QLineEdit::setValidator(...).
You will need a QValidator object for this. Qt already provides validators for int, double and regular expressions. The regular expression has, of course, to be defined yourself.