src/gui/kernel/qlayout.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
--- a/src/gui/kernel/qlayout.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/src/gui/kernel/qlayout.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -496,6 +496,21 @@
 }
 
 /*!
+    \since 4.6
+
+    Sets the \a margins to use around the layout.
+
+    By default, QLayout uses the values provided by the style. On
+    most platforms, the margin is 11 pixels in all directions.
+
+    \sa contentsMargins()
+*/
+void QLayout::setContentsMargins(const QMargins &margins)
+{
+    setContentsMargins(margins.left(), margins.top(), margins.right(), margins.bottom());
+}
+
+/*!
     \since 4.3
 
     Extracts the left, top, right, and bottom margins used around the
@@ -521,6 +536,23 @@
 }
 
 /*!
+    \since 4.6
+
+    Returns the margins used around the layout.
+
+    By default, QLayout uses the values provided by the style. On
+    most platforms, the margin is 11 pixels in all directions.
+
+    \sa setContentsMargins()
+*/
+QMargins QLayout::contentsMargins() const
+{
+    int left, top, right, bottom;
+    getContentsMargins(&left, &top, &right, &bottom);
+    return QMargins(left, top, right, bottom);
+}
+
+/*!
     \since 4.3
 
     Returns the layout's geometry() rectangle, but taking into account the