How to create line edit or text edit box similar to "Setting IP address in Windows"
I have to create a box which will accept text in the form of IP address that is it should show " . . . " at the opening and then it should accept IP address from the user in the form of 192.168.23.54 where it should be in the range of 0 to 255.Anybody having any idea regarding this then please help me....Thank you in advance
Re: How to create line edit or text edit box similar to "Setting IP address in Windo
Method 1: Use a mask on a QLineEdit
Method 2: Use four QLineEdit's and have the '.'s as QLabels
Method 3: Subclass QLinEdit and override paintEvent to nicely align the ip address (you can also do the validation in the subclass too)
If you want to allow copy/paste of the ip address, you should rule out method 2, but thats the way Windows IP control works (tab doesn't work properly there either).
Re: How to create line edit or text edit box similar to "Setting IP address in Windo
Thanx for your help...I have done it using multiple line edit but now i want one more thing that is when three digits are input by user then the cursor should automatically go to next line edit....Can any one help me regarding that.
Re: How to create line edit or text edit box similar to "Setting IP address in Windo
You could connect to "textChanged()". If 3 digits were entered set the focus to the next QLineEdit.