Hi all
i've a line edit inwhich inputmask is 000.000.000.000. This lineedit will be used as ip input field. But i need that the disatance between "." should be equal. Ive attached a samplecode. plz tel me how to do.
Hi all
i've a line edit inwhich inputmask is 000.000.000.000. This lineedit will be used as ip input field. But i need that the disatance between "." should be equal. Ive attached a samplecode. plz tel me how to do.
You used QTextEdit where you should use QLineEdit. QLineEdit is better for this kind of input.
The code you need is:
All of this is documented in QT. Read about it in the documentation of QLineEdit.Qt Code:
ui->lineEdit->setInputMask("000.000.000.000;_");To copy to clipboard, switch view to plain text mode
Oh I'm sorry actually i've used a line edit in my project. but while disaplyaing that line edit i need to display the "." at equal distance. Herewith i've attached the sample code again Please check this. and tell me what should i changed. And also i dont want to show "_" in inputmask. I need empty space.
Thank you .
Last edited by sudhansu; 31st March 2010 at 07:13.
Did you consider changing the QLineEdit font to a font with a fixed width? say "Courier New"?
something like this:
Qt Code:
To copy to clipboard, switch view to plain text mode
Bookmarks