Hey,
I have a problem with QML Controls:
I try to connect two TextAreas via Network:
TextArea{
id: textarea
onTextChanged: {
//send message
}
}
//onMessage:
textarea.text = message;
TextArea{
id: textarea
onTextChanged: {
//send message
}
}
//onMessage:
textarea.text = message;
To copy to clipboard, switch view to plain text mode
The Problem is that
onTextChanged
onTextChanged
To copy to clipboard, switch view to plain text mode
is although triggered if the text is set by a message. By that, a new Message is generated, which causes the generation of an other Massage on the other side an so on...
My approach was to add a property to detect, the event was triggered manually but it won't work:
TextArea{
property bool surpress: false
function setPassive(newText){
surpress = true;
text = newText;
}
id: textarea
onTextChanged: {
if(surpress){
surpress = false;
return;
}
//send message
}
}
//onMessage:
textarea.setPassive(message);
TextArea{
property bool surpress: false
function setPassive(newText){
surpress = true;
text = newText;
}
id: textarea
onTextChanged: {
if(surpress){
surpress = false;
return;
}
//send message
}
}
//onMessage:
textarea.setPassive(message);
To copy to clipboard, switch view to plain text mode
Any Ideas?
best regards,
Jakob
Bookmarks