TextField placeholderText - Trying to capture numeric input. Would like underscores for digit fields. QML 5.15
-
Why does this still appear to be broken after at least 5 years? (Looking at previous posts on this and other sites.)
If I set a placeholder text, I should be able to make it whatever I please, possibly with some auto-fill options. And underscores would be a naturally acceptable option for numeric digits until they are entered.
OK, so I have set the input to accept only numeric characters, but I do plan to use the same field for values with decimal points at varying locations, a variable number of digits and possibly no decimal point. Yes, I should be able to easily do this without setting a Double vs an Int validator.
And, yes, this is why placeholderText has value for numeric input.
I entered underscores and that didn't work. So I entered zeros where the underscores would go. Still NOTHING! I can enter zeros in the fields and generate a string that is identical to the placeholderText I entered, but even the zeros show NOTHING when used for placeholderText.
Please fix this. Granted, it won't be fixed in time for me to use it on this project, but please fix this.
-
Are you wanting the placeholder text to appear while you are entering in text?
The docs specify "before" you enter text. Meaning there is nothing in the field yet.You could achieve this by putting a Text {} behind the TextField and tracking what has been entered into the field and changing the text in the Text Item. This might be tricky though. Is TextField background opaque? Might have to customize the control a bit.
-
What have you tried? Can you share a reproducible example?
Please share details so we can help you.Because when I tried to reproduce what I understood from your post, it "works on my system":