Is it possible to create a simple text editor only using QML components?
I am trying to do this with help TextArea, but it seems like it has no way to work with formatted text. Of course, I can do something like this:
ToolButton {
text: "Bold"
onClicked: {
var start = textArea.selectionStart;
var end = textArea.selectionEnd;
var text = textArea.getText(start,end);
text = "<strong>" + text + "</strong>";
textArea.remove(start,end);
textArea.insert(start,text);
}
}
But I still canβt detect the formatting of the text under the cursor.
I will be glad if anyone can share a piece of code or something.
Any advice would be appreciated.
source
share