Important: Please read the Qt Code of Conduct -

Input Mask text field: "End" key not working correctly

  • Hello everyone,

    I have the following problem: If I mask a TextInput field e.g. with a date mask "00.00.0000", then hitting the "End" key navigates the cursor to position 2 (with 0 being the beginning of the field). When I hit it again, it navigates to position 1 and hitting "End" yet again naviagtes back to position 2.

    I would expect the cursor to navigate to the very end of the text field instead, but apparently QML assumes that the string has only 2 characters (the two periods) and therefore navigates behind them. I can only navigate to the very end if I write a digit into all spaces.

    Also, if I enter a date, then go back and delete a digit from somewhere in the middle, then hitting the "End" key navigates to the second last position and the cursor can only navigate to that position as well. Note that when the field was empty the cursor could navigate to the very end.

    What can I do to make masked input fields behave as a user would expect them to?

    I am using Qt 4.7.4 with Qt Creator 2.4.1 on Ubuntu 32 Bit.


  • Did nobody have this problem before me?

Log in to reply