Reading QML object (CheckBox) property in a loop in C++: always the same value
问题 I made a simple code to read the value of a checkbox from my QML in a C++ loop. However, I always get "unchecked" value, even after I toggle the checkbox with the mouse. QML: CheckBox { objectName: "simulatorCheckbox" text: "text" } C++: QObject *rootObject = engine.rootObjects().first(); QObject *simulatorCheckboxQ = rootObject->findChild<QObject*>("simulatorCheckbox"); if (!simulatorCheckboxQ) { std::cout << "simulatorCheckboxQ not found" << std::endl; std::exit(1); } auto consume = [