Search code examples
qtqmlqtquick2qtquickcontrols2qtvirtualkeyboard

How to hide selection handles on QtQuickControls2 TextField?


I use QtVirtualKeyboard in my QML app and as a result selection handles appear whenever some text is selected in a TextField:

enter image description here

Is there any way to hide these handles? Nothing in TextField or TextInput docs mention anything about this.


Solution

  • You can hide the handle by setting the InputMethodHint flag in the TextField to Qt.ImhNoTextHandles. That should get rid of the handle. ref https://doc.qt.io/qt-5/qt.html