Search code examples
qtqmltextfieldqtquick2qqmlcomponent

Remove label on Textfield in QML


When I try to enter in the textfield, the placeholderText is displayed as label of the Textfield.

enter image description here

Is there any way to remove the placeholderText when Textfield is active and filled?

enter image description here

I didn't find any solution for this.


Solution

  • You could try simply clearing the place holder text when you don't want it to be visible, something like this:

    placeholderText: focus || text ? "" : "Enter name"