smallB
smallB

Reputation: 17120

Constraining user input to certain characters

How in qt constrain what can be typed in lineedit? I would i.e. want user to enter just digits but not letters.

Upvotes: 2

Views: 93

Answers (1)

pnezis
pnezis

Reputation: 12321

Check the setValidator function and the inputMask property. If you need something more complex than just numbers it is very easy to subclass QValidator and use it.

Upvotes: 4

Related Questions