diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-06-11 13:55:43 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@theqtcompany.com> | 2015-06-12 11:09:16 +0000 |
commit | 99bda08cb1ea14a29deefe9dabe276c38648c899 (patch) | |
tree | c40f0ea9a64c4e9c977373d828b96d4fe9cb99c6 /src/multimedia/camera/qcameraviewfindersettings.cpp | |
parent | c34cf6131221dac2ea8745a5c93b57c13dd8533c (diff) |
QCameraViewFinderSettings: make op== non-member
...and inline op!=. Mark them as nothrow.
More idiomatic C++ (symmetry between lhs and rhs).
Change-Id: I65ecbef961383897e4e17325ad62d45e1772fbb0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/multimedia/camera/qcameraviewfindersettings.cpp')
-rw-r--r-- | src/multimedia/camera/qcameraviewfindersettings.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/multimedia/camera/qcameraviewfindersettings.cpp b/src/multimedia/camera/qcameraviewfindersettings.cpp index a6290cfb7..059c93f6a 100644 --- a/src/multimedia/camera/qcameraviewfindersettings.cpp +++ b/src/multimedia/camera/qcameraviewfindersettings.cpp @@ -136,32 +136,35 @@ QCameraViewfinderSettings &QCameraViewfinderSettings::operator=(const QCameraVie } /*! - Determines if \a other is of equal value to a viewfinder settings object. + \relates QCameraViewfinderSettings + \since 5.5 + + Determines if \a lhs is of equal value to \a rhs. Returns true if the settings objects are of equal value, and false if they are not of equal value. */ -bool QCameraViewfinderSettings::operator==(const QCameraViewfinderSettings &other) const +bool operator==(const QCameraViewfinderSettings &lhs, const QCameraViewfinderSettings &rhs) Q_DECL_NOTHROW { - return (d == other.d) || - (d->isNull == other.d->isNull && - d->resolution == other.d->resolution && - qFuzzyCompare(d->minimumFrameRate, other.d->minimumFrameRate) && - qFuzzyCompare(d->maximumFrameRate, other.d->maximumFrameRate) && - d->pixelFormat == other.d->pixelFormat && - d->pixelAspectRatio == other.d->pixelAspectRatio); + 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->pixelFormat == rhs.d->pixelFormat && + lhs.d->pixelAspectRatio == rhs.d->pixelAspectRatio); } /*! - Determines if \a other is of equal value to a viewfinder settings object. + \fn bool operator!=(const QCameraViewfinderSettings &lhs, const QCameraViewfinderSettings &rhs) + \relates QCameraViewfinderSettings + \since 5.5 + + Determines if \a lhs is of equal value to \a rhs. Returns true if the settings objects are not of equal value, and false if they are of equal value. */ -bool QCameraViewfinderSettings::operator!=(const QCameraViewfinderSettings &other) const -{ - return !(*this == other); -} /*! Identifies if a viewfinder settings object is uninitalized. |