Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef QMARGINS_H
00043 #define QMARGINS_H
00044
00045 #include <QtCore/qnamespace.h>
00046
00047 QT_BEGIN_HEADER
00048
00049 QT_BEGIN_NAMESPACE
00050
00051 QT_MODULE(Core)
00052
00053 class QMargins
00054 {
00055 public:
00056 QMargins();
00057 QMargins(int left, int top, int right, int bottom);
00058
00059 bool isNull() const;
00060
00061 int left() const;
00062 int top() const;
00063 int right() const;
00064 int bottom() const;
00065
00066 void setLeft(int left);
00067 void setTop(int top);
00068 void setRight(int right);
00069 void setBottom(int bottom);
00070
00071 private:
00072 int m_left;
00073 int m_top;
00074 int m_right;
00075 int m_bottom;
00076
00077 friend inline bool operator==(const QMargins &, const QMargins &);
00078 friend inline bool operator!=(const QMargins &, const QMargins &);
00079 };
00080
00081 Q_DECLARE_TYPEINFO(QMargins, Q_MOVABLE_TYPE);
00082
00083
00084
00085
00086
00087 inline QMargins::QMargins()
00088 { m_top = m_bottom = m_left = m_right = 0; }
00089
00090 inline QMargins::QMargins(int aleft, int atop, int aright, int abottom)
00091 : m_left(aleft), m_top(atop), m_right(aright), m_bottom(abottom) {}
00092
00093 inline bool QMargins::isNull() const
00094 { return m_left==0 && m_top==0 && m_right==0 && m_bottom==0; }
00095
00096 inline int QMargins::left() const
00097 { return m_left; }
00098
00099 inline int QMargins::top() const
00100 { return m_top; }
00101
00102 inline int QMargins::right() const
00103 { return m_right; }
00104
00105 inline int QMargins::bottom() const
00106 { return m_bottom; }
00107
00108
00109 inline void QMargins::setLeft(int aleft)
00110 { m_left = aleft; }
00111
00112 inline void QMargins::setTop(int atop)
00113 { m_top = atop; }
00114
00115 inline void QMargins::setRight(int aright)
00116 { m_right = aright; }
00117
00118 inline void QMargins::setBottom(int abottom)
00119 { m_bottom = abottom; }
00120
00121 inline bool operator==(const QMargins &m1, const QMargins &m2)
00122 {
00123 return
00124 m1.m_left == m2.m_left &&
00125 m1.m_top == m2.m_top &&
00126 m1.m_right == m2.m_right &&
00127 m1.m_bottom == m2.m_bottom;
00128 }
00129
00130 inline bool operator!=(const QMargins &m1, const QMargins &m2)
00131 {
00132 return
00133 m1.m_left != m2.m_left ||
00134 m1.m_top != m2.m_top ||
00135 m1.m_right != m2.m_right ||
00136 m1.m_bottom != m2.m_bottom;
00137 }
00138
00139 #ifndef QT_NO_DEBUG_STREAM
00140 Q_CORE_EXPORT QDebug operator<<(QDebug, const QMargins &);
00141 #endif
00142
00143 QT_END_NAMESPACE
00144
00145 QT_END_HEADER
00146
00147 #endif // QMARGINS_H