PDA

View Full Version : Cursor changes and stops blinking when mask is set on QLineEdit



sattu
9th May 2013, 11:22
Hi Everyone,

I am applying a mask on my QLineEdit as follows:-


setInputMask("000.000.000.000;");

The problem that I am facing is as soon as I set the mask the cursor on the lineedit changes (it's width increases) and it stops blinking. How do I change it?


-Thanks,
Sattu

ChrisW67
10th May 2013, 01:33
The 'cursor' changes to a block (actually rendered as a selected character AFAICT) because you are overtyping the existing content of the mask rather then the more usual inserting (cursor is a vertical bar) into a blank edit. I am unaware of any way to change this behaviour without reimplementing QLineEdit::paintEvent().

sattu
10th May 2013, 07:20
Thanks Chris,
Are any examples or links present regarding such cases where mask and cursor could be customized using the paintEvent() of QLineEdit?