1
<?xml version="1.0" encoding="iso-8859-1"?>
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/widgets/qabstractscrollarea.cpp -->
7
<title>Qt 4.0: QAbstractScrollArea Class Reference</title>
8
<style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
9
a:link { color: #004faf; text-decoration: none }
10
a:visited { color: #672967; text-decoration: none }
11
td.postheader { font-family: sans-serif }
12
tr.address { font-family: sans-serif }
13
body { background: #ffffff; color: black; }</style>
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
19
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="annotated.html"><font color="#004faf">Annotated</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QAbstractScrollArea Class Reference</h1>
21
<p>The QAbstractScrollArea widget provides a scrolling area with on-demand scroll bars. <a href="#details">More...</a></p>
22
<pre>#include <QAbstractScrollArea></pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
23
<p>Inherits <a href="qframe.html">QFrame</a>.</p>
24
<p>Inherited by <a href="qabstractitemview.html">QAbstractItemView</a>, <a href="qscrollarea.html">QScrollArea</a>, and <a href="qtextedit.html">QTextEdit</a>.</p>
26
<li><a href="qabstractscrollarea-members.html">List of all members, including inherited members</a></li>
28
<a name="properties"></a>
31
<li><div class="fn"/><b><a href="qabstractscrollarea.html#horizontalScrollBarPolicy-prop">horizontalScrollBarPolicy</a></b> : Qt::ScrollBarPolicy</li>
32
<li><div class="fn"/><b><a href="qabstractscrollarea.html#verticalScrollBarPolicy-prop">verticalScrollBarPolicy</a></b> : Qt::ScrollBarPolicy</li>
35
<li><div class="fn"/>6 properties inherited from <a href="qframe.html#properties">QFrame</a></li>
36
<li><div class="fn"/>52 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
37
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
39
<a name="public-functions"></a>
40
<h3>Public Functions</h3>
42
<li><div class="fn"/><b><a href="qabstractscrollarea.html#QAbstractScrollArea">QAbstractScrollArea</a></b> ( QWidget * <i>parent</i> = 0 )</li>
43
<li><div class="fn"/><b><a href="qabstractscrollarea.html#dtor.QAbstractScrollArea">~QAbstractScrollArea</a></b> ()</li>
44
<li><div class="fn"/>QScrollBar * <b><a href="qabstractscrollarea.html#horizontalScrollBar">horizontalScrollBar</a></b> () const</li>
45
<li><div class="fn"/>Qt::ScrollBarPolicy <b><a href="qabstractscrollarea.html#horizontalScrollBarPolicy-prop">horizontalScrollBarPolicy</a></b> () const</li>
46
<li><div class="fn"/>QSize <b><a href="qabstractscrollarea.html#maximumViewportSize">maximumViewportSize</a></b> () const</li>
47
<li><div class="fn"/>void <b><a href="qabstractscrollarea.html#horizontalScrollBarPolicy-prop">setHorizontalScrollBarPolicy</a></b> ( Qt::ScrollBarPolicy )</li>
48
<li><div class="fn"/>void <b><a href="qabstractscrollarea.html#verticalScrollBarPolicy-prop">setVerticalScrollBarPolicy</a></b> ( Qt::ScrollBarPolicy )</li>
49
<li><div class="fn"/>QScrollBar * <b><a href="qabstractscrollarea.html#verticalScrollBar">verticalScrollBar</a></b> () const</li>
50
<li><div class="fn"/>Qt::ScrollBarPolicy <b><a href="qabstractscrollarea.html#verticalScrollBarPolicy-prop">verticalScrollBarPolicy</a></b> () const</li>
51
<li><div class="fn"/>QWidget * <b><a href="qabstractscrollarea.html#viewport">viewport</a></b> () const</li>
54
<li><div class="fn"/>13 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
55
<li><div class="fn"/>183 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
56
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
57
<li><div class="fn"/>10 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
59
<a name="protected-functions"></a>
60
<h3>Protected Functions</h3>
62
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#contextMenuEvent">contextMenuEvent</a></b> ( QContextMenuEvent * <i>e</i> )</li>
63
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#dragEnterEvent">dragEnterEvent</a></b> ( QDragEnterEvent * <i>event</i> )</li>
64
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#dragLeaveEvent">dragLeaveEvent</a></b> ( QDragLeaveEvent * <i>event</i> )</li>
65
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#dragMoveEvent">dragMoveEvent</a></b> ( QDragMoveEvent * <i>event</i> )</li>
66
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#dropEvent">dropEvent</a></b> ( QDropEvent * <i>event</i> )</li>
67
<li><div class="fn"/>virtual bool <b><a href="qabstractscrollarea.html#event">event</a></b> ( QEvent * <i>e</i> )</li>
68
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#keyPressEvent">keyPressEvent</a></b> ( QKeyEvent * <i>e</i> )</li>
69
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> ( QMouseEvent * <i>e</i> )</li>
70
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#mouseMoveEvent">mouseMoveEvent</a></b> ( QMouseEvent * <i>e</i> )</li>
71
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#mousePressEvent">mousePressEvent</a></b> ( QMouseEvent * <i>e</i> )</li>
72
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#mouseReleaseEvent">mouseReleaseEvent</a></b> ( QMouseEvent * <i>e</i> )</li>
73
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#paintEvent">paintEvent</a></b> ( QPaintEvent * <i>event</i> )</li>
74
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#resizeEvent">resizeEvent</a></b> ( QResizeEvent * <i>event</i> )</li>
75
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#scrollContentsBy">scrollContentsBy</a></b> ( int <i>dx</i>, int <i>dy</i> )</li>
76
<li><div class="fn"/>void <b><a href="qabstractscrollarea.html#setViewportMargins">setViewportMargins</a></b> ( int <i>left</i>, int <i>top</i>, int <i>right</i>, int <i>bottom</i> )</li>
77
<li><div class="fn"/>virtual bool <b><a href="qabstractscrollarea.html#viewportEvent">viewportEvent</a></b> ( QEvent * <i>e</i> )</li>
78
<li><div class="fn"/>virtual void <b><a href="qabstractscrollarea.html#wheelEvent">wheelEvent</a></b> ( QWheelEvent * <i>e</i> )</li>
81
<li><div class="fn"/>39 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
82
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
84
<h3>Additional Inherited Members</h3>
86
<li><div class="fn"/>17 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
87
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
88
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
89
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
90
<li><div class="fn"/>2 static public members inherited from <a href="qframe.html#static-public-members">QFrame</a></li>
91
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
92
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
94
<a name="details"></a>
96
<h2>Detailed Description</h2>
97
<p>The QAbstractScrollArea widget provides a scrolling area with on-demand scroll bars.</p>
98
<p>QAbstractScrollArea is a low-level abstraction of a scrolling area. It gives you full control of the scroll bars, at the cost of simplicity. In most cases, using a <a href="qscrollarea.html">QScrollArea</a> is preferable.</p>
99
<p>QAbstractScrollArea's central child widget is the scrolling area itself, called <a href="qabstractscrollarea.html#viewport">viewport</a>(). The viewport widget uses all available space. Next to the viewport is a vertical scroll bar (accessible with <a href="qabstractscrollarea.html#verticalScrollBar">verticalScrollBar</a>()), and below a horizontal scroll bar (accessible with <a href="qabstractscrollarea.html#horizontalScrollBar">horizontalScrollBar</a>()). Each scroll bar can be either visible or hidden, depending on the scroll bar's policy (see <a href="qabstractscrollarea.html#verticalScrollBarPolicy-prop">verticalScrollBarPolicy</a> and <a href="qabstractscrollarea.html#horizontalScrollBarPolicy-prop">horizontalScrollBarPolicy</a>). When a scroll bar is hidden, the viewport expands in order to cover all available space. When a scroll bar becomes visible again, the viewport shrinks in order to make room for the scroll bar.</p>
100
<p>With a scroll bar policy of <a href="qt.html#ScrollBarPolicy-enum">Qt::ScrollBarAsNeeded</a> (the default), QAbstractScrollArea shows scroll bars when those provide a non-zero scrolling range, and hides them otherwise. You control the range of each scroll bar with <a href="qabstractslider.html#setRange">QAbstractSlider::setRange</a>().</p>
101
<p>In order to track scroll bar movements, reimplement the virtual function <a href="qabstractscrollarea.html#scrollContentsBy">scrollContentsBy</a>(). In order to fine-tune scrolling behavior, connect to a scroll bar's <a href="qabstractslider.html#actionTriggered">QAbstractSlider::actionTriggered</a>() signal and adjust the <a href="qabstractslider.html#sliderPosition-prop">QAbstractSlider::sliderPosition</a> as you wish.</p>
102
<p>It is possible to reserve a margin area around the viewport, see <a href="qabstractscrollarea.html#setViewportMargins">setViewportMargins</a>(). The feature is mostly used to place a <a href="qheaderview.html">QHeaderView</a> widget above or beside the scrolling area.</p>
103
<p>For convience, QAbstractScrollArea makes all viewport events available in the virtual <a href="qabstractscrollarea.html#viewportEvent">viewportEvent</a>() handler. <a href="qwidget.html">QWidget</a>'s specialised handlers are remapped to viewport events in the cases where this makes sense. The remapped specialised handlers are: <a href="qabstractscrollarea.html#paintEvent">paintEvent</a>(), <a href="qabstractscrollarea.html#mousePressEvent">mousePressEvent</a>(), <a href="qabstractscrollarea.html#mouseReleaseEvent">mouseReleaseEvent</a>(), <a href="qabstractscrollarea.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(), <a href="qabstractscrollarea.html#mouseMoveEvent">mouseMoveEvent</a>(), <a href="qabstractscrollarea.html#wheelEvent">wheelEvent</a>(), <a href="qabstractscrollarea.html#dragEnterEvent">dragEnterEvent</a>(), <a href="qabstractscrollarea.html#dragMoveEvent">dragMoveEvent</a>(), <a href="qabstractscrollarea.html#dragLeaveEvent">dragLeaveEvent</a>(), <a href="qabstractscrollarea.html#dropEvent">dropEvent</a>(), <a href="qabstractscrollarea.html#contextMenuEvent">contextMenuEvent</a>(). and <a href="qabstractscrollarea.html#resizeEvent">resizeEvent</a>().</p>
105
<h2>Property Documentation</h2>
106
<h3 class="fn"><a name="horizontalScrollBarPolicy-prop"></a>horizontalScrollBarPolicy : <a href="qt.html#ScrollBarPolicy-enum">Qt::ScrollBarPolicy</a></h3>
107
<p>This property holds the policy for the horizontal scroll bar.</p>
108
<p>The default policy is <tt>Qt::ScrollBarAsNeeded</tt>.</p>
109
<p>Access functions:</p>
111
<li><div class="fn"/><b>Qt::ScrollBarPolicy horizontalScrollBarPolicy () const</b></li>
112
<li><div class="fn"/><b>void setHorizontalScrollBarPolicy ( Qt::ScrollBarPolicy )</b></li>
114
<p>See also <a href="qabstractscrollarea.html#verticalScrollBarPolicy-prop">verticalScrollBarPolicy</a>.</p>
115
<h3 class="fn"><a name="verticalScrollBarPolicy-prop"></a>verticalScrollBarPolicy : <a href="qt.html#ScrollBarPolicy-enum">Qt::ScrollBarPolicy</a></h3>
116
<p>This property holds the policy for the vertical scroll bar.</p>
117
<p>The default policy is <tt>Qt::ScrollBarAsNeeded</tt>.</p>
118
<p>Access functions:</p>
120
<li><div class="fn"/><b>Qt::ScrollBarPolicy verticalScrollBarPolicy () const</b></li>
121
<li><div class="fn"/><b>void setVerticalScrollBarPolicy ( Qt::ScrollBarPolicy )</b></li>
123
<p>See also <a href="qabstractscrollarea.html#horizontalScrollBarPolicy-prop">horizontalScrollBarPolicy</a>.</p>
125
<h2>Member Function Documentation</h2>
126
<h3 class="fn"><a name="QAbstractScrollArea"></a>QAbstractScrollArea::QAbstractScrollArea ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
127
<p>Constructs a viewport.</p>
128
<p>The <i>parent</i> arguments is sent to the <a href="qwidget.html">QWidget</a> constructor.</p>
129
<h3 class="fn"><a name="dtor.QAbstractScrollArea"></a>QAbstractScrollArea::~QAbstractScrollArea ()</h3>
130
<p>Destroys the viewport.</p>
131
<h3 class="fn"><a name="contextMenuEvent"></a>void QAbstractScrollArea::contextMenuEvent ( <a href="qcontextmenuevent.html">QContextMenuEvent</a> * <i>e</i> ) <tt> [virtual protected]</tt></h3>
132
<p>This event handler can be reimplemented in a subclass to receive context menu events for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget. The event is passed in <i>e</i>.</p>
133
<p>Reimplemented from <a href="qwidget.html#contextMenuEvent">QWidget</a>.</p>
134
<p>See also <a href="qwidget.html#contextMenuEvent">QWidget::contextMenuEvent</a>().</p>
135
<h3 class="fn"><a name="dragEnterEvent"></a>void QAbstractScrollArea::dragEnterEvent ( <a href="qdragenterevent.html">QDragEnterEvent</a> * <i>event</i> ) <tt> [virtual protected]</tt></h3>
136
<p>This event handler can be reimplemented in a subclass to receive drag enter events (passed in <i>event</i>), for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget.</p>
137
<p>Reimplemented from <a href="qwidget.html#dragEnterEvent">QWidget</a>.</p>
138
<p>See also <a href="qwidget.html#dragEnterEvent">QWidget::dragEnterEvent</a>().</p>
139
<h3 class="fn"><a name="dragLeaveEvent"></a>void QAbstractScrollArea::dragLeaveEvent ( <a href="qdragleaveevent.html">QDragLeaveEvent</a> * <i>event</i> ) <tt> [virtual protected]</tt></h3>
140
<p>This event handler can be reimplemented in a subclass to receive drag leave events (passed in <i>event</i>), for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget.</p>
141
<p>Reimplemented from <a href="qwidget.html#dragLeaveEvent">QWidget</a>.</p>
142
<p>See also <a href="qwidget.html#dragLeaveEvent">QWidget::dragLeaveEvent</a>().</p>
143
<h3 class="fn"><a name="dragMoveEvent"></a>void QAbstractScrollArea::dragMoveEvent ( <a href="qdragmoveevent.html">QDragMoveEvent</a> * <i>event</i> ) <tt> [virtual protected]</tt></h3>
144
<p>This event handler can be reimplemented in a subclass to receive drag move events (passed in <i>event</i>), for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget.</p>
145
<p>Reimplemented from <a href="qwidget.html#dragMoveEvent">QWidget</a>.</p>
146
<p>See also <a href="qwidget.html#dragMoveEvent">QWidget::dragMoveEvent</a>().</p>
147
<h3 class="fn"><a name="dropEvent"></a>void QAbstractScrollArea::dropEvent ( <a href="qdropevent.html">QDropEvent</a> * <i>event</i> ) <tt> [virtual protected]</tt></h3>
148
<p>This event handler can be reimplemented in a subclass to receive drop events (passed in <i>event</i>), for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget.</p>
149
<p>Reimplemented from <a href="qwidget.html#dropEvent">QWidget</a>.</p>
150
<p>See also <a href="qwidget.html#dropEvent">QWidget::dropEvent</a>().</p>
151
<h3 class="fn"><a name="event"></a>bool QAbstractScrollArea::event ( <a href="qevent.html">QEvent</a> * <i>e</i> ) <tt> [virtual protected]</tt></h3>
152
<p>This is the main event handler for the <a href="qabstractscrollarea.html">QAbstractScrollArea</a> widget (<i>not</i> the scrolling area <a href="qabstractscrollarea.html#viewport">viewport</a>()). The event is passed in <i>e</i>.</p>
153
<p>Reimplemented from <a href="qobject.html#event">QObject</a>.</p>
154
<h3 class="fn"><a name="horizontalScrollBar"></a><a href="qscrollbar.html">QScrollBar</a> * QAbstractScrollArea::horizontalScrollBar () const</h3>
155
<p>Returns the horizontal scroll bar.</p>
156
<p>See also <a href="qabstractscrollarea.html#horizontalScrollBarPolicy-prop">horizontalScrollBarPolicy</a> and <a href="qabstractscrollarea.html#verticalScrollBar">verticalScrollBar</a>().</p>
157
<h3 class="fn"><a name="keyPressEvent"></a>void QAbstractScrollArea::keyPressEvent ( <a href="qkeyevent.html">QKeyEvent</a> * <i>e</i> ) <tt> [virtual protected]</tt></h3>
158
<p>This function is called with key event <i>e</i> when key presses occur. It handles PageUp, PageDown, Up, Down, Left, and Right, and ignores all other key presses.</p>
159
<p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget</a>.</p>
160
<h3 class="fn"><a name="maximumViewportSize"></a><a href="qsize.html">QSize</a> QAbstractScrollArea::maximumViewportSize () const</h3>
161
<p>Returns the size of the viewport as if the scroll bars had no valid scrolling range.</p>
162
<h3 class="fn"><a name="mouseDoubleClickEvent"></a>void QAbstractScrollArea::mouseDoubleClickEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> ) <tt> [virtual protected]</tt></h3>
163
<p>This event handler can be reimplemented in a subclass to receive mouse double click events for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget. The event is passed in <i>e</i>.</p>
164
<p>Reimplemented from <a href="qwidget.html#mouseDoubleClickEvent">QWidget</a>.</p>
165
<p>See also <a href="qwidget.html#mouseDoubleClickEvent">QWidget::mouseDoubleClickEvent</a>().</p>
166
<h3 class="fn"><a name="mouseMoveEvent"></a>void QAbstractScrollArea::mouseMoveEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> ) <tt> [virtual protected]</tt></h3>
167
<p>This event handler can be reimplemented in a subclass to receive mouse move events for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget. The event is passed in <i>e</i>.</p>
168
<p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget</a>.</p>
169
<p>See also <a href="qwidget.html#mouseMoveEvent">QWidget::mouseMoveEvent</a>().</p>
170
<h3 class="fn"><a name="mousePressEvent"></a>void QAbstractScrollArea::mousePressEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> ) <tt> [virtual protected]</tt></h3>
171
<p>This event handler can be reimplemented in a subclass to receive mouse press events for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget. The event is passed in <i>e</i>.</p>
172
<p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget</a>.</p>
173
<p>See also <a href="qwidget.html#mousePressEvent">QWidget::mousePressEvent</a>().</p>
174
<h3 class="fn"><a name="mouseReleaseEvent"></a>void QAbstractScrollArea::mouseReleaseEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> ) <tt> [virtual protected]</tt></h3>
175
<p>This event handler can be reimplemented in a subclass to receive mouse release events for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget. The event is passed in <i>e</i>.</p>
176
<p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget</a>.</p>
177
<p>See also <a href="qwidget.html#mouseReleaseEvent">QWidget::mouseReleaseEvent</a>().</p>
178
<h3 class="fn"><a name="paintEvent"></a>void QAbstractScrollArea::paintEvent ( <a href="qpaintevent.html">QPaintEvent</a> * <i>event</i> ) <tt> [virtual protected]</tt></h3>
179
<p>This event handler can be reimplemented in a subclass to receive paint events (passed in <i>event</i>), for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget.</p>
180
<p>Note: If you open a painter, make sure to open it on the <a href="qabstractscrollarea.html#viewport">viewport</a>().</p>
181
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget</a>.</p>
182
<p>See also <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
183
<h3 class="fn"><a name="resizeEvent"></a>void QAbstractScrollArea::resizeEvent ( <a href="qresizeevent.html">QResizeEvent</a> * <i>event</i> ) <tt> [virtual protected]</tt></h3>
184
<p>This event handler can be reimplemented in a subclass to receive resize events (passed in <i>event</i>), for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget. When resizeEvent() is called, the viewport already has its new geometry. The old size is accessible through <a href="qresizeevent.html#oldSize">QResizeEvent::oldSize</a>().</p>
185
<p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget</a>.</p>
186
<p>See also <a href="qwidget.html#resizeEvent">QWidget::resizeEvent</a>().</p>
187
<h3 class="fn"><a name="scrollContentsBy"></a>void QAbstractScrollArea::scrollContentsBy ( int <i>dx</i>, int <i>dy</i> ) <tt> [virtual protected]</tt></h3>
188
<p>Scrolls the viewport's contents by <i>dx</i>, <i>dy</i>.</p>
189
<h3 class="fn"><a name="setViewportMargins"></a>void QAbstractScrollArea::setViewportMargins ( int <i>left</i>, int <i>top</i>, int <i>right</i>, int <i>bottom</i> ) <tt> [protected]</tt></h3>
190
<p>Sets the margins around the scrolling area to <i>left</i>, <i>top</i>, <i>right</i> and <i>bottom</i>. 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.</p>
191
<p>By default all margins are zero.</p>
192
<h3 class="fn"><a name="verticalScrollBar"></a><a href="qscrollbar.html">QScrollBar</a> * QAbstractScrollArea::verticalScrollBar () const</h3>
193
<p>Returns the vertical scroll bar.</p>
194
<p>See also <a href="qabstractscrollarea.html#verticalScrollBarPolicy-prop">verticalScrollBarPolicy</a> and <a href="qabstractscrollarea.html#horizontalScrollBar">horizontalScrollBar</a>().</p>
195
<h3 class="fn"><a name="viewport"></a><a href="qwidget.html">QWidget</a> * QAbstractScrollArea::viewport () const</h3>
196
<p>Returns the viewport widget.</p>
197
<h3 class="fn"><a name="viewportEvent"></a>bool QAbstractScrollArea::viewportEvent ( <a href="qevent.html">QEvent</a> * <i>e</i> ) <tt> [virtual protected]</tt></h3>
198
<p>The main event handler for the scrolling area (the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget). It handles event <i>e</i>.</p>
199
<p>You can reimplement this function in a subclass, but we recommend using one of the specialized event handlers instead.</p>
200
<p>Specialised handlers for viewport events are: <a href="qabstractscrollarea.html#paintEvent">paintEvent</a>(), <a href="qabstractscrollarea.html#mousePressEvent">mousePressEvent</a>(), <a href="qabstractscrollarea.html#mouseReleaseEvent">mouseReleaseEvent</a>(), <a href="qabstractscrollarea.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(), <a href="qabstractscrollarea.html#mouseMoveEvent">mouseMoveEvent</a>(), <a href="qabstractscrollarea.html#wheelEvent">wheelEvent</a>(), <a href="qabstractscrollarea.html#dragEnterEvent">dragEnterEvent</a>(), <a href="qabstractscrollarea.html#dragMoveEvent">dragMoveEvent</a>(), <a href="qabstractscrollarea.html#dragLeaveEvent">dragLeaveEvent</a>(), <a href="qabstractscrollarea.html#dropEvent">dropEvent</a>(), <a href="qabstractscrollarea.html#contextMenuEvent">contextMenuEvent</a>(), and <a href="qabstractscrollarea.html#resizeEvent">resizeEvent</a>().</p>
201
<h3 class="fn"><a name="wheelEvent"></a>void QAbstractScrollArea::wheelEvent ( <a href="qwheelevent.html">QWheelEvent</a> * <i>e</i> ) <tt> [virtual protected]</tt></h3>
202
<p>This event handler can be reimplemented in a subclass to receive wheel events for the <a href="qabstractscrollarea.html#viewport">viewport</a>() widget. The event is passed in <i>e</i>.</p>
203
<p>Reimplemented from <a href="qwidget.html#wheelEvent">QWidget</a>.</p>
204
<p>See also <a href="qwidget.html#wheelEvent">QWidget::wheelEvent</a>().</p>
205
<p /><address><hr /><div align="center">
206
<table width="100%" cellspacing="0" border="0"><tr class="address">
207
<td width="30%">Copyright © 2005 <a href="trolltech.html">Trolltech</a></td>
208
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
209
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
210
</tr></table></div></address></body>