summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qabstractscrollarea.cpp
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-05 12:13:26 (GMT)
committerMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-06 14:39:40 (GMT)
commit15a21652d178e4a298bb522d777602620cbd9938 (patch)
tree862636dae0389ab0e04d4f34a6a85544bae5e100 /src/gui/widgets/qabstractscrollarea.cpp
parent4ad6343be52b757fd354cd92874bca944d2ede49 (diff)
downloadQt-15a21652d178e4a298bb522d777602620cbd9938.zip
Qt-15a21652d178e4a298bb522d777602620cbd9938.tar.gz
Qt-15a21652d178e4a298bb522d777602620cbd9938.tar.bz2
API review: Add convenience functions using QMargins
We added the class QMargins, so we should use it wherever we deal with margins, as a convenience to the users. Reviewed-by: Andreas Aardal Hanssen
Diffstat (limited to 'src/gui/widgets/qabstractscrollarea.cpp')
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index 7d81d5a..48099ef 100644
--- a/src/gui/widgets/qabstractscrollarea.cpp
+++ b/src/gui/widgets/qabstractscrollarea.cpp
@@ -51,6 +51,7 @@
#include "qdebug.h"
#include "qboxlayout.h"
#include "qpainter.h"
+#include "qmargins.h"
#include "qabstractscrollarea_p.h"
#include <qwidget.h>
@@ -868,6 +869,22 @@ void QAbstractScrollArea::setViewportMargins(int left, int top, int right, int b
}
/*!
+ \since 4.6
+ Sets \a margins around the scrolling area. This is useful for
+ applications such as spreadsheets with "locked" rows and columns.
+ The marginal space is is left blank; put widgets in the unused
+ area.
+
+ By default all margins are zero.
+
+*/
+void QAbstractScrollArea::setViewportMargins(const QMargins &margins)
+{
+ setViewportMargins(margins.left(), margins.top(),
+ margins.right(), margins.bottom());
+}
+
+/*!
\fn bool QAbstractScrollArea::event(QEvent *event)
\reimp