cursorPositionChanged() is not triggered when you click anything but when... cursor position changes. If you want to have a virtual keyboard then the proper approach is to implement an input context plugin.