You are not logged in.


Friday, October 28th 2011, 12:10pm

cursor position is changing when qlineedit is inserting text in it

Hi All,

Can somebody help me on this.

Currently i am using QLineEdit to insert my ip address but my cursor position is changing once a number is enetered.

I want to enter 3 digits e.g xxx but i want my cursor poistion always at 3rd digit(in first octet) at 6th digit (in 2nd octet) at 9th digit ( in 3rd octet) so whenever i enter the next digit my cursor should always be at the 3rd place of every octate and number should move forward e.g




and not cursor.

Thanking in advance.

Any help is appreciable.


Friday, October 28th 2011, 2:46pm

Instead of updating the cursor position, you can go with the QRegExpValidator for validating the IP Address.


Monday, October 31st 2011, 7:55am

validating ip address is not an issue

validating ip address is not an issue, issue is how to stop moving of cursor.only number needs to move and cursor should be at 3rd or 6th or at 9th position.


Monday, October 31st 2011, 11:59am

is it possible with qlineedit

can somebody tell me whetehr this behaviour is possible with qlineedit?