Issue
I have these following code to set a variable:
void TypeLogVisualization::setGain(double gain)
{
qWarning("Floating point comparison needs context sanity check");
if (qFuzzyCompare(m_gain, gain) || gain < 1.0 || gain > 2.1)
return;
m_gain = gain;
setPath();
emit gainChanged(m_gain);
}
The variable gain is set in QML File, like the code bellow:
function gainMinus(){
log.setGain(log.gain-=0.1)
}
function gainPlus(){
log.setGain(log.gain+=0.1)
}
log is object of a classe who contains "setGain", gain is a QProperty. I really want know how to avoid that warning: Floating point comparison needs context sanity check
Solution
Like everyone said, the only way it's remove that lines
Answered By - antuniooh Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.