You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

nmchi

Beginner

  • "nmchi" is male
  • "nmchi" started this thread

Posts: 16

Location: Ha Noi, Viet Nam

Occupation: Manchester city, England

  • Send private message

1

Thursday, June 18th 2009, 3:03pm

How to get text of QLineEdit before signal textEdit or textChanged emited

Hi all,
I want valid some input in QLineEdit
my problem: when you input 2 "." in a float value then I will delete 1 "."
ex---> when you input 23..456 then result is 23.456, you can't input 2 "."
But I can't do it
Thanks for all help!
!! only you !!

Junior

Professional

  • "Junior" is male

Posts: 1,623

Location: San Antonio, TX USA

Occupation: Senior Secure Systems Engineer

  • Send private message

2

Friday, June 19th 2009, 2:16pm

nmchi,

You probably would want to use lineEdit->setValidator( ... );
Since it's a double/float value you are anticipating as input - I would recommend the QDoubleValidatoras the validator.