Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6311

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qscrollarea.cpp -->
  <title>Qt 4.8: QScrollArea Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QScrollArea</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<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="#protected-functions">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>
<h1 class="title">QScrollArea Class Reference</h1>
<!-- $$$QScrollArea-brief -->
<p>The QScrollArea class provides a scrolling view onto another widget. <a href="#details">More...</a></p>
<!-- @@@QScrollArea -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QScrollArea&gt;</span></pre><p><b>Inherits: </b><a href="qabstractscrollarea.html">QAbstractScrollArea</a>.</p>
<ul>
<li><a href="qscrollarea-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>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">2 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">58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<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> = 0 )</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> ( Qt::Alignment )</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>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<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>
<ul>
<li class="fn">17 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">221 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<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> ( QResizeEvent * )</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>
</table>
<ul>
<li class="fn">18 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
<li class="fn">3 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="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="qobject.html#public-slots">QObject</a></li>
<li class="fn">1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li class="fn">4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">18 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
<li class="fn">3 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li class="fn">1 protected slot inherited from <a href="qabstractscrollarea.html#protected-slots">QAbstractScrollArea</a></li>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QScrollArea-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QScrollArea 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="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="qpixmap.html">QPixmap</a></span><span class="operator">::</span>fromImage(image));

 scrollArea <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QScrollArea</span>;
 scrollArea<span class="operator">-</span><span class="operator">&gt;</span><a href="qwidget.html#setBackgroundRole">setBackgroundRole</a>(<span class="type"><a href="qpalette.html">QPalette</a></span><span class="operator">::</span>Dark);
 scrollArea<span class="operator">-</span><span class="operator">&gt;</span><a href="qscrollarea.html#setWidget">setWidget</a>(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>
<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>
<p>The scroll bars appearance depends on the currently set <a href="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 QScrollArea class, see the <a href="widgets-imageviewer.html">Image Viewer</a> example. The example shows how to combine <a href="qlabel.html">QLabel</a> and QScrollArea 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="widgets-imageviewer.html">Image Viewer Example</a>.</p>
<!-- @@@QScrollArea -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$alignment-prop$$$alignment$$$setAlignmentQt::Alignment -->
<h3 class="fn"><a name="alignment-prop"></a><span class="name">alignment</span> : <span class="type"><a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a></span></h3>
<p>This property holds the alignment of the scroll area's widget.</p>
<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>
<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> ( Qt::Alignment )</td></tr>
</table>
<!-- @@@alignment -->
<!-- $$$widgetResizable-prop$$$widgetResizable$$$setWidgetResizablebool -->
<h3 class="fn"><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>
<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>
<!-- @@@widgetResizable -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QScrollArea[overload1]$$$QScrollAreaQWidget* -->
<h3 class="fn"><a name="QScrollArea"></a>QScrollArea::<span class="name">QScrollArea</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0 )</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"><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"><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"><a name="ensureWidgetVisible"></a><span class="type">void</span> QScrollArea::<span class="name">ensureWidgetVisible</span> ( <span class="type"><a href="qwidget.html">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"><a name="event"></a><span class="type">bool</span> QScrollArea::<span class="name">event</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$eventFilter[overload1]$$$eventFilterQObject*QEvent* -->
<h3 class="fn"><a name="eventFilter"></a><span class="type">bool</span> QScrollArea::<span class="name">eventFilter</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>o</i>, <span class="type"><a href="qevent.html">QEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#eventFilter">QObject::eventFilter</a>().</p>
<!-- @@@eventFilter -->
<!-- $$$focusNextPrevChild[overload1]$$$focusNextPrevChildbool -->
<h3 class="fn"><a name="focusNextPrevChild"></a><span class="type">bool</span> QScrollArea::<span class="name">focusNextPrevChild</span> ( <span class="type">bool</span> <i>next</i> )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusNextPrevChild">QWidget::focusNextPrevChild</a>().</p>
<!-- @@@focusNextPrevChild -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQResizeEvent* -->
<h3 class="fn"><a name="resizeEvent"></a><span class="type">void</span> QScrollArea::<span class="name">resizeEvent</span> ( <span class="type"><a href="qresizeevent.html">QResizeEvent</a></span> * )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget::resizeEvent</a>().</p>
<!-- @@@resizeEvent -->
<!-- $$$scrollContentsBy[overload1]$$$scrollContentsByintint -->
<h3 class="fn"><a name="scrollContentsBy"></a><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> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qabstractscrollarea.html#scrollContentsBy">QAbstractScrollArea::scrollContentsBy</a>().</p>
<!-- @@@scrollContentsBy -->
<!-- $$$setWidget[overload1]$$$setWidgetQWidget* -->
<h3 class="fn"><a name="setWidget"></a><span class="type">void</span> QScrollArea::<span class="name">setWidget</span> ( <span class="type"><a href="qwidget.html">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 <tt>true</tt>.</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"><a name="sizeHint"></a><span class="type"><a href="qsize.html">QSize</a></span> QScrollArea::<span class="name">sizeHint</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$takeWidget[overload1]$$$takeWidget -->
<h3 class="fn"><a name="takeWidget"></a><span class="type"><a href="qwidget.html">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 -->
<!-- $$$widget[overload1]$$$widget -->
<h3 class="fn"><a name="widget"></a><span class="type"><a href="qwidget.html">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 class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      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.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      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. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>