##// END OF EJS Templates
Add overloaded comparison operators to domain
Michal Klocek -
r220:94c82e0171bd
parent child
Show More
@@ -42,4 +42,18 Domain Domain::subDomain(const QRectF& rect, qreal maxWidth,qreal maxHeight) con
42
42
43 return domain;
43 return domain;
44 }
44 }
45
46 bool operator== (const Domain &domain1, const Domain &domain2)
47 {
48 return (domain1.m_maxX == domain2.m_maxX &&
49 domain1.m_maxY == domain2.m_maxY &&
50 domain1.m_minX == domain2.m_minX &&
51 domain1.m_minY == domain2.m_minY);
52 }
53
54 bool operator!= (const Domain &domain1, const Domain &domain2)
55 {
56 return !(domain1 == domain2);
57 }
58
45 QTCOMMERCIALCHART_END_NAMESPACE
59 QTCOMMERCIALCHART_END_NAMESPACE
@@ -13,6 +13,9 public:
13 qreal spanX() const;
13 qreal spanX() const;
14 qreal spanY() const;
14 qreal spanY() const;
15
15
16 friend bool operator== (const Domain &domain1, const Domain &domain2);
17 friend bool operator!= (const Domain &domain1, const Domain &domain2);
18
16 Domain subDomain(const QRectF& rect, qreal maxWidth, qreal maxHeight) const;
19 Domain subDomain(const QRectF& rect, qreal maxWidth, qreal maxHeight) const;
17
20
18 public:
21 public:
General Comments 0
You need to be logged in to leave comments. Login now