How do I write an ip address on Qlineedit regularly QT with mask

426 Views Asked by At

I made Qlineedit to enter the ip address in the Qt interface. and I made an input mask to Qlineedit and showed it to the user to enter it in the form of a ip.

Then I set the default ip address but when different ip addresses are entered in the interface, it did not look good in terms of spaces and appearance. How can I dynamically inputmask in Qlineedit.

I set input mask to write the IP address on the Qt interface.

ui.serverName->setInputMask("000.000.000.000");

I made the default IP show when the interface is opened.

ui.serverName->setText("127.0.0.1");

but when there are different ip entries in the interface, the input mask did not look good in terms of appearance, there were gaps.

like this 127.0 .0 .1 How can I fix this in terms of appearance.

ı want to set this on QT ınterface with mask. 127.0.0.1

How can I write the IP addresses entered from the interface in a beautiful way. example entering ıp 10.114.100.105, 102.1.100.10

1

There are 1 best solutions below

1
On

First try to do inputmask;to choose IP address and then take if loop