I make a window with a PIN. There is a following kind: initially in lineedit there is a line like "_ _ _ _". Next, we replace each underscore with a number that is entered from the virtual keyboard, and, for example, has the following form - "1 2 _ _". After a split second, you need to replace the numbers with asterisks and get "* * _ _". Those. when you enter the numbers, we see her and she hides behind a star.
There is the following slot:
void uRent::s1(const QString &i) { QString line = ui->lineEdit->text(); int index = line.indexOf('_'); line.replace(index, 1, i); ui->lineEdit->insert(line); QThread::msleep(1000); line.replace(index, 1, '*'); ui->lineEdit->setText(line); } But when he performs, he waits a second and then instead of the number he immediately inserts an asterisk. There is a suspicion that QThread::msleep(1000); it is performed not in the middle of the slot body, but immediately and only then all functions are performed. Is this true and how can you implement the above?