9 QMargins(
int left,
int top,
int right,
int bottom);
18 void setLeft(
int left);
20 void setRight(
int right);
21 void setBottom(
int bottom);
47 inline QMargins::QMargins() : m_left(0), m_top(0), m_right(0), m_bottom(0) {}
49 inline QMargins::QMargins(
int aleft,
int atop,
int aright,
int abottom)
50 : m_left(aleft), m_top(atop), m_right(aright), m_bottom(abottom) {}
52 inline bool QMargins::isNull()
const 54 return m_left == 0 && m_top == 0 && m_right == 0 && m_bottom == 0;
57 inline int QMargins::left()
const 62 inline int QMargins::top()
const 67 inline int QMargins::right()
const 72 inline int QMargins::bottom()
const 78 inline void QMargins::setLeft(
int aleft)
83 inline void QMargins::setTop(
int atop)
88 inline void QMargins::setRight(
int aright)
93 inline void QMargins::setBottom(
int abottom)
101 m1.m_left == m2.m_left &&
102 m1.m_top == m2.m_top &&
103 m1.m_right == m2.m_right &&
104 m1.m_bottom == m2.m_bottom;
110 m1.m_left != m2.m_left ||
111 m1.m_top != m2.m_top ||
112 m1.m_right != m2.m_right ||
113 m1.m_bottom != m2.m_bottom;
118 return QMargins(m1.left() + m2.left(), m1.top() + m2.top(),
119 m1.right() + m2.right(), m1.bottom() + m2.bottom());
124 return QMargins(m1.left() - m2.left(), m1.top() - m2.top(),
125 m1.right() - m2.right(), m1.bottom() - m2.bottom());
130 return QMargins(lhs.left() + rhs, lhs.top() + rhs,
131 lhs.right() + rhs, lhs.bottom() + rhs);
136 return QMargins(rhs.left() + lhs, rhs.top() + lhs,
137 rhs.right() + lhs, rhs.bottom() + lhs);
142 return QMargins(lhs.left() - rhs, lhs.top() - rhs,
143 lhs.right() - rhs, lhs.bottom() - rhs);
148 return QMargins(margins.left() * factor, margins.top() * factor,
149 margins.right() * factor, margins.bottom() * factor);
154 return QMargins(margins.left() * factor, margins.top() * factor,
155 margins.right() * factor, margins.bottom() * factor);
172 return QMargins(margins.left() / divisor, margins.top() / divisor,
173 margins.right() / divisor, margins.bottom() / divisor);
184 return *
this = *
this + margins;
189 return *
this = *
this - margins;
192 inline QMargins &QMargins::operator+=(
int margin)
201 inline QMargins &QMargins::operator-=(
int margin)
210 inline QMargins &QMargins::operator*=(
int factor)
212 return *
this = *
this * factor;
215 inline QMargins &QMargins::operator/=(
int divisor)
217 return *
this = *
this / divisor;
220 inline QMargins &QMargins::operator*=(
float factor)
222 return *
this = *
this * factor;
225 inline QMargins &QMargins::operator/=(
float divisor)
227 return *
this = *
this / divisor;
237 return QMargins(-margins.left(), -margins.top(), -margins.right(), -margins.bottom());
246 QMarginsF(
float left,
float top,
float right,
float bottom);
254 float bottom()
const;
256 void setLeft(
float left);
257 void setTop(
float top);
258 void setRight(
float right);
259 void setBottom(
float bottom);
282 inline QMarginsF::QMarginsF() : m_left(0), m_top(0), m_right(0), m_bottom(0) {}
284 inline QMarginsF::QMarginsF(
float aleft,
float atop,
float aright,
float abottom)
285 : m_left(aleft), m_top(atop), m_right(aright), m_bottom(abottom) {}
287 inline QMarginsF::QMarginsF(
const QMargins &margins)
288 : m_left((
float)margins.left()), m_top((
float)margins.top()), m_right((
float)margins.right()), m_bottom((
float)margins.bottom()) {}
290 inline bool QMarginsF::isNull()
const 292 return Math::FuzzyIsNull(m_left) && Math::FuzzyIsNull(m_top) && Math::FuzzyIsNull(m_right) && Math::FuzzyIsNull(m_bottom);
295 inline float QMarginsF::left()
const 300 inline float QMarginsF::top()
const 305 inline float QMarginsF::right()
const 310 inline float QMarginsF::bottom()
const 316 inline void QMarginsF::setLeft(
float aleft)
321 inline void QMarginsF::setTop(
float atop)
326 inline void QMarginsF::setRight(
float aright)
331 inline void QMarginsF::setBottom(
float abottom)
338 return Math::FuzzyCompare(lhs.left(), rhs.left())
339 && Math::FuzzyCompare(lhs.top(), rhs.top())
340 && Math::FuzzyCompare(lhs.right(), rhs.right())
341 && Math::FuzzyCompare(lhs.bottom(), rhs.bottom());
346 return !operator==(lhs, rhs);
351 return QMarginsF(lhs.left() + rhs.left(), lhs.top() + rhs.top(),
352 lhs.right() + rhs.right(), lhs.bottom() + rhs.bottom());
357 return QMarginsF(lhs.left() - rhs.left(), lhs.top() - rhs.top(),
358 lhs.right() - rhs.right(), lhs.bottom() - rhs.bottom());
363 return QMarginsF(lhs.left() + rhs, lhs.top() + rhs,
364 lhs.right() + rhs, lhs.bottom() + rhs);
369 return QMarginsF(rhs.left() + lhs, rhs.top() + lhs,
370 rhs.right() + lhs, rhs.bottom() + lhs);
375 return QMarginsF(lhs.left() - rhs, lhs.top() - rhs,
376 lhs.right() - rhs, lhs.bottom() - rhs);
381 return QMarginsF(lhs.left() * rhs, lhs.top() * rhs,
382 lhs.right() * rhs, lhs.bottom() * rhs);
387 return QMarginsF(rhs.left() * lhs, rhs.top() * lhs,
388 rhs.right() * lhs, rhs.bottom() * lhs);
393 return QMarginsF(lhs.left() / divisor, lhs.top() / divisor,
394 lhs.right() / divisor, lhs.bottom() / divisor);
399 return *
this = *
this + margins;
404 return *
this = *
this - margins;
407 inline QMarginsF &QMarginsF::operator+=(
float addend)
416 inline QMarginsF &QMarginsF::operator-=(
float subtrahend)
418 m_left -= subtrahend;
420 m_right -= subtrahend;
421 m_bottom -= subtrahend;
425 inline QMarginsF &QMarginsF::operator*=(
float factor)
427 return *
this = *
this * factor;
430 inline QMarginsF &QMarginsF::operator/=(
float divisor)
432 return *
this = *
this / divisor;
442 return QMarginsF(-margins.left(), -margins.top(), -margins.right(), -margins.bottom());
445 inline QMargins QMarginsF::toMargins()
const static int Round(float fValue)
get the closest integer near the specified float number.
Definition: ParaMath.h:609
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: ParaMargins.h:5
Definition: ParaMargins.h:242