D
D
Desmoke2021-05-14 16:51:05
Python
Desmoke, 2021-05-14 16:51:05

How to make auto space in lineEdit?

Hello!
I have a program in which, when entering data, an auto space is needed after every 4 characters.
And you also need a "\" character after 2 entered numbers.
Help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
1
12rbah, 2021-05-14
@Desmoke

There are two options, for a simple case, you can take InputMask.
For complex cases, use textChanged, when the user changes the text, you take the text from lineEdit on this event, parse it and substitute all the necessary characters, then replace the old text with a new line.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question