There is data that is updated at a constant speed, in addition there is an Image element that is shown, or disappears, depending on the data received.
In my case, Image receives data once and for all. When the program is running, changing the data Image does not respond.
How to make the data perceived element Image in real time?
Image { id: indicator1 x: 320 y: 257 fillMode: Image.PreserveAspectFit source: "../images/grn.png" visible: stringList[0] === "0" || stringList[0] === "1" ? true : false } In *.cpp
void SerialPort::processSingleRecord (QByteArray value) { QString value2 = QString(value).trimmed(); QStringList sl = value2.split(","); QString qqq; std::vector<QString> fullData; fullData.reserve(sl.size()+22); for(int i = 0; i < sl.size()-1; i++) fullData.push_back(sl[i]); QString lastItem = sl[sl.size()-1]; for(int i = 0; i < lastItem.size(); i++) fullData.push_back(QString(lastItem[i])); for(int i = 0; i <fullData.size(); i++) qqq+= fullData[i]+','; set_serial_data(qqq); } In *.qml
SerialPort { id: cppClass } property variant stringList: cppClass.serial_data.split(',') Image { id: indicator1 x: 320 y: 257 fillMode: Image.PreserveAspectFit source: "../images/grn.png" visible: stringList[0] === "0" || stringList[0] === "1" ? true : false }