Sets the caret to the given position. If the given location is invalid, it will snap to the nearest valid location. Immediately afterwards a caretPositionChanged signal containing the effective position is emitted name="node" node to set to name="offset" zero-based offset within the node name="extendSelection" If true, a selection will be spanned from the last caret position to the given one. Otherwise, any existing selection will be deselected.