Okay, I have defined two slots called hasSample and getSample, hasSample when queried returns true/false (boolean) and getSample returns the value to be plotted (int). Below are the two functions
int Classname::getSample()
{
int ret= buff[outp];
outp=(outp+1)%100;
return ret;
}
//return size
bool Classname::hasSample() const
{
if(inp==outp)
return false;
else
return true;
}
//statements from another function in .cpp that gets the value:
buff[inp]=foo; //value added in the buffer
inp=(inp+1)%100;
int Classname::getSample()
{
int ret= buff[outp];
outp=(outp+1)%100;
return ret;
}
//return size
bool Classname::hasSample() const
{
if(inp==outp)
return false;
else
return true;
}
//statements from another function in .cpp that gets the value:
buff[inp]=foo; //value added in the buffer
inp=(inp+1)%100;
To copy to clipboard, switch view to plain text mode
Kkindly correct me if this not the proper way to get it done. Also, I found this link: http://doc.qt.io/qt-5/qtqml-cppinteg...mlfromcpp.html . May be I need to access the QQmlProperty? Thank you.
Bookmarks