I have my QML UI alongside my C++ code. My loop which I need to show its progress is developed in C++ like this:
for(unsigned int j = 0; j < Count; ++j) {
// Do stuff
}
On my QML code, I need to progress bar like this:
ProgressBar {
value: j // Should come from C++ loop
// It is "j" on C++ loop
from: 0 // C++ loop starts out with 0
to: Count // C++ loop ends with "Count"
}
I don't know how my C++ loop and my QML progress bar need to be linked to each other. I couldn't find any relevant example. Can anybody give me a hint.
The communication between my C++ and QML is done by using Q_PROPERTY
like this, but I'm not sure how to use it:
Q_PROPERTY(float j READ j WRITE setJ NOTIFY jChanged)