Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 3471

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qscrollarea.cpp -->
  <title>QScrollArea Class | Qt Widgets 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QScrollArea</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#size-hints-and-layouts">Size Hints and Layouts</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QScrollArea Class</h1>
<!-- $$$QScrollArea-brief -->
<p>The <a href="qscrollarea.html">QScrollArea</a> class provides a scrolling view onto another widget. <a href="#details">More...</a></p>
<!-- @@@QScrollArea -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QScrollArea&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qabstractscrollarea.html">QAbstractScrollArea</a></td></tr></table></div><ul>
<li><a href="qscrollarea-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qscrollarea.html#alignment-prop">alignment</a></b> : Qt::Alignment</li>
<li class="fn"><b><a href="qscrollarea.html#widgetResizable-prop">widgetResizable</a></b> : bool</li>
</ul>
<ul>
<li class="fn">3 properties inherited from <a href="qabstractscrollarea.html#properties">QAbstractScrollArea</a></li>
<li class="fn">6 properties inherited from <a href="qframe.html#properties">QFrame</a></li>
<li class="fn">59 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#QScrollArea">QScrollArea</a></b>(QWidget *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#dtor.QScrollArea">~QScrollArea</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::Alignment </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#alignment-prop">alignment</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#ensureVisible">ensureVisible</a></b>(int <i>x</i>, int <i>y</i>, int <i>xmargin</i> = 50, int <i>ymargin</i> = 50)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#ensureWidgetVisible">ensureWidgetVisible</a></b>(QWidget *<i>childWidget</i>, int <i>xmargin</i> = 50, int <i>ymargin</i> = 50)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#alignment-prop">setAlignment</a></b>(<i>Qt::Alignment</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#setWidget">setWidget</a></b>(QWidget *<i>widget</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#widgetResizable-prop">setWidgetResizable</a></b>(bool <i>resizable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget *</td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#takeWidget">takeWidget</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget *</td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#widget">widget</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#widgetResizable-prop">widgetResizable</a></b>() const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#focusNextPrevChild">focusNextPrevChild</a></b>(bool <i>next</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#sizeHint">sizeHint</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">20 public functions inherited from <a href="qabstractscrollarea.html#public-functions">QAbstractScrollArea</a></li>
<li class="fn">14 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
<li class="fn">214 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">14 public functions inherited from <a href="../qtgui/qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#event">event</a></b>(QEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#eventFilter">eventFilter</a></b>(QObject *<i>o</i>, QEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#resizeEvent">resizeEvent</a></b>(<i>QResizeEvent *</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#scrollContentsBy">scrollContentsBy</a></b>(int <i>dx</i>, int <i>dy</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qscrollarea.html#viewportSizeHint">viewportSizeHint</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">20 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
<li class="fn">4 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">3 signals inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
<li class="fn">20 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
<li class="fn">4 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
<li class="fn">1 protected type inherited from <a href="../qtgui/qpaintdevice.html#protected-variables">QPaintDevice</a></li>
</ul>
<a name="details"></a>
<!-- $$$QScrollArea-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qscrollarea.html">QScrollArea</a> class provides a scrolling view onto another widget.</p>
<p>A scroll area is used to display the contents of a child widget within a frame. If the widget exceeds the size of the frame, the view can provide scroll bars so that the entire area of the child widget can be viewed. The child widget must be specified with <a href="qscrollarea.html#setWidget">setWidget</a>(). For example:</p>
<pre class="cpp">

  <span class="type"><a href="qlabel.html">QLabel</a></span> <span class="operator">*</span>imageLabel <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlabel.html">QLabel</a></span>;
  <span class="type"><a href="../qtgui/qimage.html">QImage</a></span> image(<span class="string">&quot;happyguy.png&quot;</span>);
  imageLabel<span class="operator">-</span><span class="operator">&gt;</span>setPixmap(<span class="type"><a href="../qtgui/qpixmap.html">QPixmap</a></span><span class="operator">::</span>fromImage(image));

  scrollArea <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qscrollarea.html#QScrollArea">QScrollArea</a></span>;
  scrollArea<span class="operator">-</span><span class="operator">&gt;</span>setBackgroundRole(<span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span><span class="operator">::</span>Dark);
  scrollArea<span class="operator">-</span><span class="operator">&gt;</span>setWidget(imageLabel);

</pre>
<p>The code above creates a scroll area (shown in the images below) containing an image label. When scaling the image, the scroll area can provide the necessary scroll bars:</p>
<div class="table"><table class="generic">
 <tr valign="top" class="odd"><td ><img src="images/qscrollarea-noscrollbars.png" alt="" /></td><td ><img src="images/qscrollarea-onescrollbar.png" alt="" /></td><td ><img src="images/qscrollarea-twoscrollbars.png" alt="" /></td></tr>
</table></div>
<p>The scroll bars appearance depends on the currently set <a href="../qtcore/qt.html#ScrollBarPolicy-enum">scroll bar policies</a>. You can control the appearance of the scroll bars using the inherited functionality from <a href="qabstractscrollarea.html">QAbstractScrollArea</a>.</p>
<p>For example, you can set the <a href="qabstractscrollarea.html#horizontalScrollBarPolicy-prop">QAbstractScrollArea::horizontalScrollBarPolicy</a> and <a href="qabstractscrollarea.html#verticalScrollBarPolicy-prop">QAbstractScrollArea::verticalScrollBarPolicy</a> properties. Or if you want the scroll bars to adjust dynamically when the contents of the scroll area changes, you can use the <a href="qabstractscrollarea.html#horizontalScrollBar">horizontalScrollBar()</a> and <a href="qabstractscrollarea.html#verticalScrollBar">verticalScrollBar()</a> functions (which enable you to access the scroll bars) and set the scroll bars' values whenever the scroll area's contents change, using the <a href="qabstractslider.html#value-prop">QScrollBar::setValue</a>() function.</p>
<p>You can retrieve the child widget using the <a href="qscrollarea.html#widget">widget</a>() function. The view can be made to be resizable with the <a href="qscrollarea.html#widgetResizable-prop">setWidgetResizable</a>() function. The alignment of the widget can be specified with <a href="qscrollarea.html#alignment-prop">setAlignment</a>().</p>
<p>Two convenience functions <a href="qscrollarea.html#ensureVisible">ensureVisible</a>() and <a href="qscrollarea.html#ensureWidgetVisible">ensureWidgetVisible</a>() ensure a certain region of the contents is visible inside the viewport, by scrolling the contents if necessary.</p>
<a name="size-hints-and-layouts"></a>
<h3 >Size Hints and Layouts</h3>
<p>When using a scroll area to display the contents of a custom widget, it is important to ensure that the <a href="qwidget.html#sizeHint-prop">size hint</a> of the child widget is set to a suitable value. If a standard <a href="qwidget.html">QWidget</a> is used for the child widget, it may be necessary to call <a href="qwidget.html#minimumSize-prop">QWidget::setMinimumSize</a>() to ensure that the contents of the widget are shown correctly within the scroll area.</p>
<p>If a scroll area is used to display the contents of a widget that contains child widgets arranged in a layout, it is important to realize that the size policy of the layout will also determine the size of the widget. This is especially useful to know if you intend to dynamically change the contents of the layout. In such cases, setting the layout's <a href="qlayout.html#sizeConstraint-prop">size constraint</a> property to one which provides constraints on the minimum and/or maximum size of the layout (e.g&#x2e;, <a href="qlayout.html#SizeConstraint-enum">QLayout::SetMinAndMaxSize</a>) will cause the size of the scroll area to be updated whenever the contents of the layout changes.</p>
<p>For a complete example using the <a href="qscrollarea.html">QScrollArea</a> class, see the <a href="qtwidgets-widgets-imageviewer-example.html">Image Viewer</a> example. The example shows how to combine <a href="qlabel.html">QLabel</a> and <a href="qscrollarea.html">QScrollArea</a> to display an image.</p>
</div>
<p><b>See also </b><a href="qabstractscrollarea.html">QAbstractScrollArea</a>, <a href="qscrollbar.html">QScrollBar</a>, and <a href="qtwidgets-widgets-imageviewer-example.html">Image Viewer Example</a>.</p>
<!-- @@@QScrollArea -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$alignment-prop$$$alignment$$$setAlignmentQt::Alignment -->
<h3 class="fn" id="alignment-prop"><a name="alignment-prop"></a><span class="name">alignment</span> : <span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span></h3>
<p>This property holds the alignment of the scroll area's widget</p>
<p>A valid alignment is a combination of the following flags:</p>
<ul>
<li><code>Qt::AlignLeft</code></li>
<li><code>Qt::AlignHCenter</code></li>
<li><code>Qt::AlignRight</code></li>
<li><code>Qt::AlignTop</code></li>
<li><code>Qt::AlignVCenter</code></li>
<li><code>Qt::AlignBottom</code></li>
</ul>
<p>By default, the widget stays rooted to the top-left corner of the scroll area.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::Alignment </td><td class="memItemRight bottomAlign"><span class="name"><b>alignment</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAlignment</b></span>(<i>Qt::Alignment</i>)</td></tr>
</table></div>
<!-- @@@alignment -->
<!-- $$$widgetResizable-prop$$$widgetResizable$$$setWidgetResizablebool -->
<h3 class="fn" id="widgetResizable-prop"><a name="widgetResizable-prop"></a><span class="name">widgetResizable</span> : <span class="type">bool</span></h3>
<p>This property holds whether the scroll area should resize the view widget</p>
<p>If this property is set to false (the default), the scroll area honors the size of its widget. Regardless of this property, you can programmatically resize the widget using <a href="qscrollarea.html#widget">widget</a>()-&gt;<a href="qwidget.html#size-prop">resize</a>(), and the scroll area will automatically adjust itself to the new size.</p>
<p>If this property is set to true, the scroll area will automatically resize the widget in order to avoid scroll bars where they can be avoided, or to take advantage of extra space.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>widgetResizable</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setWidgetResizable</b></span>(bool <i>resizable</i>)</td></tr>
</table></div>
<!-- @@@widgetResizable -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QScrollArea[overload1]$$$QScrollAreaQWidget* -->
<h3 class="fn" id="QScrollArea"><a name="QScrollArea"></a>QScrollArea::<span class="name">QScrollArea</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs an empty scroll area with the given <i>parent</i>.</p>
<p><b>See also </b><a href="qscrollarea.html#setWidget">setWidget</a>().</p>
<!-- @@@QScrollArea -->
<!-- $$$~QScrollArea[overload1]$$$~QScrollArea -->
<h3 class="fn" id="dtor.QScrollArea"><a name="dtor.QScrollArea"></a>QScrollArea::<span class="name">~QScrollArea</span>()</h3>
<p>Destroys the scroll area and its child widget.</p>
<p><b>See also </b><a href="qscrollarea.html#setWidget">setWidget</a>().</p>
<!-- @@@~QScrollArea -->
<!-- $$$ensureVisible[overload1]$$$ensureVisibleintintintint -->
<h3 class="fn" id="ensureVisible"><a name="ensureVisible"></a><span class="type">void</span> QScrollArea::<span class="name">ensureVisible</span>(<span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>xmargin</i> = 50, <span class="type">int</span> <i>ymargin</i> = 50)</h3>
<p>Scrolls the contents of the scroll area so that the point (<i>x</i>, <i>y</i>) is visible inside the region of the viewport with margins specified in pixels by <i>xmargin</i> and <i>ymargin</i>. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.</p>
<!-- @@@ensureVisible -->
<!-- $$$ensureWidgetVisible[overload1]$$$ensureWidgetVisibleQWidget*intint -->
<h3 class="fn" id="ensureWidgetVisible"><a name="ensureWidgetVisible"></a><span class="type">void</span> QScrollArea::<span class="name">ensureWidgetVisible</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>childWidget</i>, <span class="type">int</span> <i>xmargin</i> = 50, <span class="type">int</span> <i>ymargin</i> = 50)</h3>
<p>Scrolls the contents of the scroll area so that the <i>childWidget</i> of <a href="qscrollarea.html#widget">QScrollArea::widget</a>() is visible inside the viewport with margins specified in pixels by <i>xmargin</i> and <i>ymargin</i>. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.</p>
<p>This function was introduced in  Qt 4.2.</p>
<!-- @@@ensureWidgetVisible -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[virtual protected] </code><span class="type">bool</span> QScrollArea::<span class="name">event</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$eventFilter[overload1]$$$eventFilterQObject*QEvent* -->
<h3 class="fn" id="eventFilter"><a name="eventFilter"></a><code>[virtual protected] </code><span class="type">bool</span> QScrollArea::<span class="name">eventFilter</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>o</i>, <span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qobject.html#eventFilter">QObject::eventFilter</a>().</p>
<!-- @@@eventFilter -->
<!-- $$$focusNextPrevChild[overload1]$$$focusNextPrevChildbool -->
<h3 class="fn" id="focusNextPrevChild"><a name="focusNextPrevChild"></a><code>[virtual] </code><span class="type">bool</span> QScrollArea::<span class="name">focusNextPrevChild</span>(<span class="type">bool</span> <i>next</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#focusNextPrevChild">QWidget::focusNextPrevChild</a>().</p>
<!-- @@@focusNextPrevChild -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQResizeEvent* -->
<h3 class="fn" id="resizeEvent"><a name="resizeEvent"></a><code>[virtual protected] </code><span class="type">void</span> QScrollArea::<span class="name">resizeEvent</span>(<i>QResizeEvent *</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget::resizeEvent</a>().</p>
<!-- @@@resizeEvent -->
<!-- $$$scrollContentsBy[overload1]$$$scrollContentsByintint -->
<h3 class="fn" id="scrollContentsBy"><a name="scrollContentsBy"></a><code>[virtual protected] </code><span class="type">void</span> QScrollArea::<span class="name">scrollContentsBy</span>(<span class="type">int</span> <i>dx</i>, <span class="type">int</span> <i>dy</i>)</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#scrollContentsBy">QAbstractScrollArea::scrollContentsBy</a>().</p>
<!-- @@@scrollContentsBy -->
<!-- $$$setWidget[overload1]$$$setWidgetQWidget* -->
<h3 class="fn" id="setWidget"><a name="setWidget"></a><span class="type">void</span> QScrollArea::<span class="name">setWidget</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>widget</i>)</h3>
<p>Sets the scroll area's <i>widget</i>.</p>
<p>The <i>widget</i> becomes a child of the scroll area, and will be destroyed when the scroll area is deleted or when a new widget is set.</p>
<p>The widget's <a href="qwidget.html#autoFillBackground-prop">autoFillBackground</a> property will be set to <code>true</code>.</p>
<p>If the scroll area is visible when the <i>widget</i> is added, you must <a href="qwidget.html#show">show()</a> it explicitly.</p>
<p>Note that You must add the layout of <i>widget</i> before you call this function; if you add it later, the <i>widget</i> will not be visible - regardless of when you <a href="qwidget.html#show">show()</a> the scroll area. In this case, you can also not <a href="qwidget.html#show">show()</a> the <i>widget</i> later.</p>
<p><b>See also </b><a href="qscrollarea.html#widget">widget</a>().</p>
<!-- @@@setWidget -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn" id="sizeHint"><a name="sizeHint"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QScrollArea::<span class="name">sizeHint</span>() const</h3>
<p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$takeWidget[overload1]$$$takeWidget -->
<h3 class="fn" id="takeWidget"><a name="takeWidget"></a><span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *QScrollArea::<span class="name">takeWidget</span>()</h3>
<p>Removes the scroll area's widget, and passes ownership of the widget to the caller.</p>
<p><b>See also </b><a href="qscrollarea.html#widget">widget</a>().</p>
<!-- @@@takeWidget -->
<!-- $$$viewportSizeHint[overload1]$$$viewportSizeHint -->
<h3 class="fn" id="viewportSizeHint"><a name="viewportSizeHint"></a><code>[virtual protected] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QScrollArea::<span class="name">viewportSizeHint</span>() const</h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#viewportSizeHint">QAbstractScrollArea::viewportSizeHint</a>().</p>
<!-- @@@viewportSizeHint -->
<!-- $$$widget[overload1]$$$widget -->
<h3 class="fn" id="widget"><a name="widget"></a><span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *QScrollArea::<span class="name">widget</span>() const</h3>
<p>Returns the scroll area's widget, or 0 if there is none.</p>
<p><b>See also </b><a href="qscrollarea.html#setWidget">setWidget</a>().</p>
<!-- @@@widget -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>