i'm having difficulty selecting text on textfield qt quick controls 2.0 mouse. when hover on textfield cursor not change cursor arrow cursor beam , unable select text. verified text selection possible using keyboard shortcut ctrl+a. tested textfield qt quick controls 1.4, , works expected (the mouse cursor changes beam , can select text). think must missing obvious because seems basic text field functionality. have ideas? below code:
import qtquick 2.7 import qtquick.controls 2.0 import qtquick.layouts 1.0 applicationwindow { visible: true width: 640 height: 480 title: qstr("hello world") textfield { anchors.centerin: parent height: 50 width: 100 } }
you can use selectbymouse: true
enable mouse selection. typically not desired on embedded , mobile platforms. mouse cursor, fixed in qt 5.7.1. temporary workaround, can use mousearea
.
textfield { selectbymouse: true mousearea { anchors.fill: parent cursorshape: qt.ibeamcursor acceptedbuttons: qt.nobutton } }
Comments
Post a Comment