this is the cursor in normal mode of LineEdit
and this is the cursor when there is input mask
As you see the cursor with input mask is thicker. How can I modify QLineEdit to get the thin cursor as in normal mode for input mask?
this is the cursor in normal mode of LineEdit
and this is the cursor when there is input mask
As you see the cursor with input mask is thicker. How can I modify QLineEdit to get the thin cursor as in normal mode for input mask?
I do not think there is anything you can do without re-implementing the QLineEdit
.
But I do not think you should. The look of the cursor has a meaning:
Note that this is not a Qt thing, this is universal. For instance if you open a command prompt, pressing the "Insert" key will change the cursor from one mode to another;
When you use an input mask, the QLineEdit
works in replace mode so it is perfectly fine to have a fat cursor.
Forcing the cursor to display in thin mode would be misleading users and is a really poor UX idea.
Another solution would be to use a QValidator
like the QRegularExpressionValidator
. It is not exactly the same behaviour as an input mask, but it serves the same purpose and will not force the insert-mode.