[Solved] TextInput select problem



  • I have got a problem with the select. I asked the same question "in this thread":http://qt-project.org/forums/viewthread/18662/, but I think it makes more sense to create a new thread, because it doesn't directly have anything to do with the overwriteMode.

    When I select something with the mouse, I can overwrite the selection. Also when I call select in the onTextChanged.

    Now I want the text to be selected in the beginning already, so I call

    @
    Component.onCompleted: selectAll()
    @

    or
    @
    Component.onCompleted: select(0, 1)
    @

    The text gets selected, but I cannot type anything. I need to deselect it with the mouse and then I can type again.

    Can someone tell me what I'm doing wrong?



  • maybe the focus is somehow lost after the 'select' call(like when we use the find feature, the text gets selected in the document but it doesn't have focus)... try calling 'forceActiveFocus' (or something like that)



  • thank you very much for your reply!

    stupid me... now I call select when the activeFocus changes and is true, and everything is working fine!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.