QCameraViewFinderSettings: make op== transitive
Using qFuzzyCompare in operator== makes it impossible to create a consistent qHash() overload for the class later on (qFuzzyCompare is not transitive). It is unlikely that there will be numerical instability for frame rates. If there is, qFuzzyCompare should be overloaded for either this class or the FrameRateRange class. Change-Id: Id975ea410b373e2987da160504f7618a8c498b5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
committed by
Jani Heikkinen
parent
12893e3826
commit
62d9398a27
@@ -149,8 +149,8 @@ bool operator==(const QCameraViewfinderSettings &lhs, const QCameraViewfinderSet
|
||||
return (lhs.d == rhs.d) ||
|
||||
(lhs.d->isNull == rhs.d->isNull &&
|
||||
lhs.d->resolution == rhs.d->resolution &&
|
||||
qFuzzyCompare(lhs.d->minimumFrameRate, rhs.d->minimumFrameRate) &&
|
||||
qFuzzyCompare(lhs.d->maximumFrameRate, rhs.d->maximumFrameRate) &&
|
||||
lhs.d->minimumFrameRate == rhs.d->minimumFrameRate &&
|
||||
lhs.d->maximumFrameRate == rhs.d->maximumFrameRate &&
|
||||
lhs.d->pixelFormat == rhs.d->pixelFormat &&
|
||||
lhs.d->pixelAspectRatio == rhs.d->pixelAspectRatio);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user