PDA

View Full Version : set cursor position in qlineedit with an inputmask



guitar1
11th March 2011, 16:26
Hi,

i have a qlineedit with an inputmask, now i want to set the cursor position via setCursorPos, but that doesn't work -.-



qle.setInputMask("D9,99 EUR;0");
qle.setCursorPosition(1);


i only call this part of code if the actual cursor position is 2, in the "validate" function of a subclassed qvalidator.

hope someone could help ;-)

wysota
11th March 2011, 16:43
Validate allows you to manipulate the "pos" argument you receive to change the cursor position.

guitar1
11th March 2011, 17:13
ouh .. that's right! well i'm not very familary with the c++ syntax ;-)

thank you very much!!