Edit TexEdit by click
-
Hi,
In my TextEdit I would like to add function. I would like to click to actual value and edit them. Now I have code like below:TextEdit { id: occupiedPlaceValue anchors { top: parent.bottom leftMargin: 0 horizontalCenter: parent.horizontalCenter } text: occupiedPlaces color: "white" font.pixelSize: parent.height * 1.2 MouseArea { anchors.fill: parent onPressed: { occupiedPlaceValue.select(0,occupiedPlaceValue.length) } } }
how do this >?
-
@Damian7546 said in Edit TexEdit by click:
In my TextEdit I would like to add function. I would like to click to actual value and edit them. Now I have code like below:
Hi could you please be
moreexplicit about what you actually want to do ? In my world, when you click any text editor, you enter the edit mode and then you can edit the value.Of what I understand from your code, you want your input to be wholly selected, I'd rather pick for selectAll() method. Whereas to the property to be monitored, I'd rather pick for the TextEdit's onCursorVisibleChanged one, testing of course whether the cursor is actually visible or not.
By the way, your anchors seem very weird, as I understand it your horizontalCenter would be higher than the top.
-