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.

1

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

x

xx

xxx

and not cursor.

Thanking in advance.

Any help is appreciable.

2

Friday, October 28th 2011, 2:46pm

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

3

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.

4

Monday, October 31st 2011, 11:59am

is it possible with qlineedit

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