diff --git a/src/domain.cpp b/src/domain.cpp index 081ba76..f2969e7 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -42,4 +42,18 @@ Domain Domain::subDomain(const QRectF& rect, qreal maxWidth,qreal maxHeight) con return domain; } + +bool operator== (const Domain &domain1, const Domain &domain2) +{ + return (domain1.m_maxX == domain2.m_maxX && + domain1.m_maxY == domain2.m_maxY && + domain1.m_minX == domain2.m_minX && + domain1.m_minY == domain2.m_minY); +} + +bool operator!= (const Domain &domain1, const Domain &domain2) +{ + return !(domain1 == domain2); +} + QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/domain_p.h b/src/domain_p.h index ea1998d..c60f8db 100644 --- a/src/domain_p.h +++ b/src/domain_p.h @@ -13,6 +13,9 @@ public: qreal spanX() const; qreal spanY() const; + friend bool operator== (const Domain &domain1, const Domain &domain2); + friend bool operator!= (const Domain &domain1, const Domain &domain2); + Domain subDomain(const QRectF& rect, qreal maxWidth, qreal maxHeight) const; public: