diff options
-rw-r--r-- | src/multimedia/camera/qcameraviewfindersettings.cpp | 31 | ||||
-rw-r--r-- | src/multimedia/camera/qcameraviewfindersettings.h | 7 |
2 files changed, 22 insertions, 16 deletions
diff --git a/src/multimedia/camera/qcameraviewfindersettings.cpp b/src/multimedia/camera/qcameraviewfindersettings.cpp index a6290cfb..059c93f6 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. diff --git a/src/multimedia/camera/qcameraviewfindersettings.h b/src/multimedia/camera/qcameraviewfindersettings.h index db9d3d8e..dcdf025f 100644 --- a/src/multimedia/camera/qcameraviewfindersettings.h +++ b/src/multimedia/camera/qcameraviewfindersettings.h @@ -52,9 +52,8 @@ public: ~QCameraViewfinderSettings(); QCameraViewfinderSettings& operator=(const QCameraViewfinderSettings &other); - bool operator==(const QCameraViewfinderSettings &other) const; - bool operator!=(const QCameraViewfinderSettings &other) const; + friend Q_MULTIMEDIA_EXPORT bool operator==(const QCameraViewfinderSettings &lhs, const QCameraViewfinderSettings &rhs) Q_DECL_NOTHROW; bool isNull() const; QSize resolution() const; @@ -80,6 +79,10 @@ private: QSharedDataPointer<QCameraViewfinderSettingsPrivate> d; }; +inline bool operator!=(const QCameraViewfinderSettings &lhs, const QCameraViewfinderSettings &rhs) Q_DECL_NOTHROW +{ return !operator==(lhs, rhs); } + + QT_END_NAMESPACE Q_DECLARE_METATYPE(QCameraViewfinderSettings) |