Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 6160

qt-doc-4.8.5-10.fc18.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" />
<!-- qplatformwindowformat_qpa.cpp -->
  <title>Qt 4.8: QPlatformWindowFormat 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>QPlatformWindowFormat</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="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QPlatformWindowFormat Class Reference</h1>
<!-- $$$QPlatformWindowFormat-brief -->
<p>The QPlatformWindowFormat class specifies the display format of an <a href="qplatformwindowformat.html#WindowApi-enum">OpenGL</a> rendering context and if possible attributes of the corresponding QPlatformWindow. <a href="#details">More...</a></p>
<!-- @@@QPlatformWindowFormat -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QPlatformWindowFormat&gt;</span></pre><p>This class was introduced in Qt 4.8.</p>
<ul>
<li><a href="qplatformwindowformat-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#FormatOption-enum">FormatOption</a></b> { DoubleBuffer, DepthBuffer, Rgba, AlphaChannel, ..., NoWindowSurface }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#FormatOption-enum">FormatOptions</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#WindowApi-enum">WindowApi</a></b> { Raster, OpenGL, OpenVG }</td></tr>
</table>
<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="qplatformwindowformat.html#QPlatformWindowFormat">QPlatformWindowFormat</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#QPlatformWindowFormat-2">QPlatformWindowFormat</a></b> ( FormatOptions <i>options</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#QPlatformWindowFormat-3">QPlatformWindowFormat</a></b> ( const QPlatformWindowFormat &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#dtor.QPlatformWindowFormat">~QPlatformWindowFormat</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#accum">accum</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#accumBufferSize">accumBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#alpha">alpha</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#alphaBufferSize">alphaBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#blueBufferSize">blueBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#depth">depth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#depthBufferSize">depthBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#directRendering">directRendering</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#doubleBuffer">doubleBuffer</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#greenBufferSize">greenBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#hasWindowSurface">hasWindowSurface</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#redBufferSize">redBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#rgba">rgba</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#sampleBuffers">sampleBuffers</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#samples">samples</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setAccum">setAccum</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setAccumBufferSize">setAccumBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setAlpha">setAlpha</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setAlphaBufferSize">setAlphaBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setBlueBufferSize">setBlueBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setDepth">setDepth</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setDepthBufferSize">setDepthBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setDirectRendering">setDirectRendering</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setDoubleBuffer">setDoubleBuffer</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setGreenBufferSize">setGreenBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setOption">setOption</a></b> ( QPlatformWindowFormat::FormatOptions <i>opt</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setRedBufferSize">setRedBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setRgba">setRgba</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setSampleBuffers">setSampleBuffers</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setSamples">setSamples</a></b> ( int <i>numSamples</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setSharedContext">setSharedContext</a></b> ( QPlatformGLContext * <i>context</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setStencil">setStencil</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setStencilBufferSize">setStencilBufferSize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setStereo">setStereo</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setSwapInterval">setSwapInterval</a></b> ( int <i>interval</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setWindowApi">setWindowApi</a></b> ( QPlatformWindowFormat::WindowApi <i>api</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setWindowSurface">setWindowSurface</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPlatformGLContext * </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#sharedGLContext">sharedGLContext</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#stencil">stencil</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#stencilBufferSize">stencilBufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#stereo">stereo</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#swapInterval">swapInterval</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#testOption">testOption</a></b> ( QPlatformWindowFormat::FormatOptions <i>opt</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> WindowApi </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#windowApi">windowApi</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPlatformWindowFormat &amp; </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#operator-eq">operator=</a></b> ( const QPlatformWindowFormat &amp; <i>other</i> )</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QPlatformWindowFormat </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#defaultFormat">defaultFormat</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#setDefaultFormat">setDefaultFormat</a></b> ( const QPlatformWindowFormat &amp; <i>f</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#operator-not-eq-49">operator!=</a></b> ( const QPlatformWindowFormat &amp; <i>a</i>, const QPlatformWindowFormat &amp; <i>b</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qplatformwindowformat.html#operator-eq-eq-68">operator==</a></b> ( const QPlatformWindowFormat &amp; <i>a</i>, const QPlatformWindowFormat &amp; <i>b</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QPlatformWindowFormat-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QPlatformWindowFormat class specifies the display format of an <a href="qplatformwindowformat.html#WindowApi-enum">OpenGL</a> rendering context and if possible attributes of the corresponding QPlatformWindow.</p>
<p><a href="qwidget.html">QWidget</a> has a setter and getter function for QPlatformWindowFormat. These functions can be used by the application programmer to signal what kind of format he wants to the window and glcontext should have. However, it is not always possible to fulfill these requirements. The application programmer should therefore check the resulting QPlatformWindowFormat from QPlatformGLContext to see the format that was actually created.</p>
<p>A display format has several characteristics:</p>
<ul>
<li><a href="qplatformwindowformat.html#setDoubleBuffer">Double or single buffering.</a></li>
<li><a href="qplatformwindowformat.html#setDepth">Depth buffer.</a></li>
<li><a href="qplatformwindowformat.html#setRgba">RGBA or color index mode.</a></li>
<li><a href="qplatformwindowformat.html#setAlpha">Alpha channel.</a></li>
<li><a href="qplatformwindowformat.html#setAccum">Accumulation buffer.</a></li>
<li><a href="qplatformwindowformat.html#setStencil">Stencil buffer.</a></li>
<li><a href="qplatformwindowformat.html#setStereo">Stereo buffers.</a></li>
<li><a href="qplatformwindowformat.html#setDirectRendering">Direct rendering.</a></li>
<li><a href="qplatformwindowformat.html#setSampleBuffers">Multisample buffers.</a></li>
</ul>
<p>You can also specify preferred bit depths for the color buffer, depth buffer, alpha buffer, accumulation buffer and the stencil buffer with the functions: <a href="qplatformwindowformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qplatformwindowformat.html#setGreenBufferSize">setGreenBufferSize</a>(), <a href="qplatformwindowformat.html#setBlueBufferSize">setBlueBufferSize</a>(), <a href="qplatformwindowformat.html#setDepthBufferSize">setDepthBufferSize</a>(), <a href="qplatformwindowformat.html#setAlphaBufferSize">setAlphaBufferSize</a>(), <a href="qplatformwindowformat.html#setAccumBufferSize">setAccumBufferSize</a>() and <a href="qplatformwindowformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>
<p>Note that even if you specify that you prefer a 32 bit depth buffer (e.g&#x2e; with setDepthBufferSize(32)), the format that is chosen may not have a 32 bit depth buffer, even if there is a format available with a 32 bit depth buffer. The main reason for this is how the system dependant picking algorithms work on the different platforms, and some format options may have higher precedence than others.</p>
<p>You create and tell a QPlatformWindowFormat object what rendering options you want from an <a href="qplatformwindowformat.html#WindowApi-enum">OpenGL</a> rendering context.</p>
<p><a href="qplatformwindowformat.html#WindowApi-enum">OpenGL</a> drivers or accelerated hardware may or may not support advanced features such as alpha channel or stereographic viewing. If you request some features that the driver/hardware does not provide when you create a <a href="qglwidget.html">QGLWidget</a>, you will get a rendering context with the nearest subset of features.</p>
<p>There are different ways to define the display characteristics of a rendering context. One is to create a QPlatformWindowFormat and make it the default for the entire application:</p>
<pre class="cpp"> <span class="type"><a href="qglformat.html">QGLFormat</a></span> fmt;
 fmt<span class="operator">.</span><a href="qplatformwindowformat.html#setAlpha">setAlpha</a>(<span class="keyword">true</span>);
 fmt<span class="operator">.</span><a href="qplatformwindowformat.html#setStereo">setStereo</a>(<span class="keyword">true</span>);
 <span class="type"><a href="qglformat.html">QGLFormat</a></span><span class="operator">::</span><a href="qplatformwindowformat.html#setDefaultFormat">setDefaultFormat</a>(fmt);</pre>
<p>Or you can specify the desired format when creating an object of your <a href="qglwidget.html">QGLWidget</a> subclass:</p>
<pre class="cpp"> <span class="type"><a href="qglformat.html">QGLFormat</a></span> fmt;
 fmt<span class="operator">.</span><a href="qplatformwindowformat.html#setDoubleBuffer">setDoubleBuffer</a>(<span class="keyword">false</span>);                 <span class="comment">// single buffer</span>
 fmt<span class="operator">.</span><a href="qplatformwindowformat.html#setDirectRendering">setDirectRendering</a>(<span class="keyword">false</span>);              <span class="comment">// software rendering</span>
 MyGLWidget<span class="operator">*</span> myWidget <span class="operator">=</span> <span class="keyword">new</span> MyGLWidget(fmt<span class="operator">,</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>);</pre>
<p>After the widget has been created, you can find out which of the requested features the system was able to provide:</p>
<pre class="cpp"> <span class="type"><a href="qglformat.html">QGLFormat</a></span> fmt;
 fmt<span class="operator">.</span>setOverlay(<span class="keyword">true</span>);
 fmt<span class="operator">.</span><a href="qplatformwindowformat.html#setStereo">setStereo</a>(<span class="keyword">true</span>);
 MyGLWidget<span class="operator">*</span> myWidget <span class="operator">=</span> <span class="keyword">new</span> MyGLWidget(fmt<span class="operator">,</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>);
 <span class="keyword">if</span> (<span class="operator">!</span>myWidget<span class="operator">-</span><span class="operator">&gt;</span>format()<span class="operator">.</span>stereo()) {
     <span class="comment">// ok, goggles off</span>
     <span class="keyword">if</span> (<span class="operator">!</span>myWidget<span class="operator">-</span><span class="operator">&gt;</span>format()<span class="operator">.</span>hasOverlay()) {
         <a href="qtglobal.html#qFatal">qFatal</a>(<span class="string">&quot;Cool hardware required&quot;</span>);
     }
 }</pre>
<div class="LegaleseLeft"><p><a href="qplatformwindowformat.html#WindowApi-enum">OpenGL</a> is a trademark of Silicon Graphics, Inc. in the United States and other countries.</p>
</div></div>
<p><b>See also </b>QPlatformGLContext and <a href="qwidget.html">QWidget</a>.</p>
<!-- @@@QPlatformWindowFormat -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$FormatOption$$$DoubleBuffer$$$DepthBuffer$$$Rgba$$$AlphaChannel$$$AccumBuffer$$$StencilBuffer$$$StereoBuffers$$$DirectRendering$$$HasOverlay$$$SampleBuffers$$$DeprecatedFunctions$$$HasWindowSurface$$$SingleBuffer$$$NoDepthBuffer$$$ColorIndex$$$NoAlphaChannel$$$NoAccumBuffer$$$NoStencilBuffer$$$NoStereoBuffers$$$IndirectRendering$$$NoOverlay$$$NoSampleBuffers$$$NoDeprecatedFunctions$$$NoWindowSurface -->
<h3 class="flags"><a name="FormatOption-enum"></a>enum QPlatformWindowFormat::<span class="name">FormatOption</span><br/>flags QPlatformWindowFormat::<span class="name">FormatOptions</span></h3>
<p>The FormatOptions type is a typedef for <a href="qflags.html">QFlags</a>&lt;FormatOption&gt;. It stores an OR combination of FormatOption values.</p>
<!-- @@@FormatOption -->
<!-- $$$WindowApi$$$Raster$$$OpenGL$$$OpenVG -->
<h3 class="fn"><a name="WindowApi-enum"></a>enum QPlatformWindowFormat::<span class="name">WindowApi</span></h3>
<!-- @@@WindowApi -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPlatformWindowFormat[overload1]$$$QPlatformWindowFormat -->
<h3 class="fn"><a name="QPlatformWindowFormat"></a>QPlatformWindowFormat::<span class="name">QPlatformWindowFormat</span> ()</h3>
<p>Constructs a <a href="qplatformwindowformat.html">QPlatformWindowFormat</a> object with the following default settings:</p>
<ul>
<li><a href="qplatformwindowformat.html#setDoubleBuffer">Double buffer:</a> Enabled.</li>
<li><a href="qplatformwindowformat.html#setDepth">Depth buffer:</a> Enabled.</li>
<li><a href="qplatformwindowformat.html#setRgba">RGBA:</a> Enabled (i.e&#x2e;, color index disabled).</li>
<li><a href="qplatformwindowformat.html#setAlpha">Alpha channel:</a> Disabled.</li>
<li><a href="qplatformwindowformat.html#setAccum">Accumulator buffer:</a> Disabled.</li>
<li><a href="qplatformwindowformat.html#setStencil">Stencil buffer:</a> Enabled.</li>
<li><a href="qplatformwindowformat.html#setStereo">Stereo:</a> Disabled.</li>
<li><a href="qplatformwindowformat.html#setDirectRendering">Direct rendering:</a> Enabled.</li>
<li><a href="qplatformwindowformat.html#setSampleBuffers">Multisample buffers:</a> Disabled.</li>
</ul>
<!-- @@@QPlatformWindowFormat -->
<!-- $$$QPlatformWindowFormat$$$QPlatformWindowFormatFormatOptions -->
<h3 class="fn"><a name="QPlatformWindowFormat-2"></a>QPlatformWindowFormat::<span class="name">QPlatformWindowFormat</span> ( <span class="type"><a href="qplatformwindowformat.html#FormatOption-enum">FormatOptions</a></span> <i>options</i> )</h3>
<p>Creates a <a href="qplatformwindowformat.html">QPlatformWindowFormat</a> object that is a copy of the current <a href="qplatformwindowformat.html#defaultFormat">defaultFormat</a>().</p>
<p>If <i>options</i> is not 0, the default format is modified by the specified format options. The <i>options</i> parameter should be <a href="qgl.html#FormatOption-enum">QGL::FormatOption</a> values OR'ed together.</p>
<p>This constructor makes it easy to specify a certain desired format in classes derived from <a href="qglwidget.html">QGLWidget</a>, for example:</p>
<pre class="cpp"> <span class="comment">// The rendering in MyGLWidget depends on using</span>
 <span class="comment">// stencil buffer and alpha channel</span>
 MyGLWidget<span class="operator">::</span>MyGLWidget(<span class="type"><a href="qwidget.html">QWidget</a></span><span class="operator">*</span> parent)
     : <span class="type"><a href="qglwidget.html">QGLWidget</a></span>(<span class="type"><a href="qglformat.html">QGLFormat</a></span>(QGL<span class="operator">::</span>StencilBuffer <span class="operator">|</span> QGL<span class="operator">::</span>AlphaChannel)<span class="operator">,</span> parent)
 {
     <span class="keyword">if</span> (<span class="operator">!</span>format()<span class="operator">.</span>stencil())
         <a href="qtglobal.html#qWarning">qWarning</a>(<span class="string">&quot;Could not get stencil buffer; results will be suboptimal&quot;</span>);
     <span class="keyword">if</span> (<span class="operator">!</span>format()<span class="operator">.</span>alpha())
         <a href="qtglobal.html#qWarning">qWarning</a>(<span class="string">&quot;Could not get alpha channel; results will be suboptimal&quot;</span>);
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 }</pre>
<p>Note that there are <a href="qgl.html#FormatOption-enum">QGL::FormatOption</a> values to turn format settings both on and off; e.g&#x2e;, <a href="qgl.html#FormatOption-enum">QGL::DepthBuffer</a> and <a href="qgl.html#FormatOption-enum">QGL::NoDepthBuffer</a>, <a href="qgl.html#FormatOption-enum">QGL::DirectRendering</a> and <a href="qgl.html#FormatOption-enum">QGL::IndirectRendering</a>, etc.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#defaultFormat">defaultFormat</a>() and <a href="qplatformwindowformat.html#setOption">setOption</a>().</p>
<!-- @@@QPlatformWindowFormat -->
<!-- $$$QPlatformWindowFormat$$$QPlatformWindowFormatconstQPlatformWindowFormat& -->
<h3 class="fn"><a name="QPlatformWindowFormat-3"></a>QPlatformWindowFormat::<span class="name">QPlatformWindowFormat</span> ( const <span class="type">QPlatformWindowFormat</span> &amp; <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>.</p>
<!-- @@@QPlatformWindowFormat -->
<!-- $$$~QPlatformWindowFormat[overload1]$$$~QPlatformWindowFormat -->
<h3 class="fn"><a name="dtor.QPlatformWindowFormat"></a>QPlatformWindowFormat::<span class="name">~QPlatformWindowFormat</span> ()</h3>
<p>Destroys the <a href="qplatformwindowformat.html">QPlatformWindowFormat</a>.</p>
<!-- @@@~QPlatformWindowFormat -->
<!-- $$$accum[overload1]$$$accum -->
<h3 class="fn"><a name="accum"></a><span class="type">bool</span> QPlatformWindowFormat::<span class="name">accum</span> () const</h3>
<p>Returns true if the accumulation buffer is enabled; otherwise returns false. The accumulation buffer is disabled by default.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setAccum">setAccum</a>() and <a href="qplatformwindowformat.html#setAccumBufferSize">setAccumBufferSize</a>().</p>
<!-- @@@accum -->
<!-- $$$accumBufferSize[overload1]$$$accumBufferSize -->
<h3 class="fn"><a name="accumBufferSize"></a><span class="type">int</span> QPlatformWindowFormat::<span class="name">accumBufferSize</span> () const</h3>
<p>Returns the accumulation buffer size.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setAccumBufferSize">setAccumBufferSize</a>(), <a href="qplatformwindowformat.html#accum">accum</a>(), and <a href="qplatformwindowformat.html#setAccum">setAccum</a>().</p>
<!-- @@@accumBufferSize -->
<!-- $$$alpha[overload1]$$$alpha -->
<h3 class="fn"><a name="alpha"></a><span class="type">bool</span> QPlatformWindowFormat::<span class="name">alpha</span> () const</h3>
<p>Returns true if the alpha buffer in the framebuffer is enabled; otherwise returns false. The alpha buffer is disabled by default.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setAlpha">setAlpha</a>() and <a href="qplatformwindowformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@alpha -->
<!-- $$$alphaBufferSize[overload1]$$$alphaBufferSize -->
<h3 class="fn"><a name="alphaBufferSize"></a><span class="type">int</span> QPlatformWindowFormat::<span class="name">alphaBufferSize</span> () const</h3>
<p>Returns the alpha buffer size.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#alpha">alpha</a>(), <a href="qplatformwindowformat.html#setAlpha">setAlpha</a>(), and <a href="qplatformwindowformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@alphaBufferSize -->
<!-- $$$blueBufferSize[overload1]$$$blueBufferSize -->
<h3 class="fn"><a name="blueBufferSize"></a><span class="type">int</span> QPlatformWindowFormat::<span class="name">blueBufferSize</span> () const</h3>
<p>Returns the blue buffer size.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setBlueBufferSize">setBlueBufferSize</a>().</p>
<!-- @@@blueBufferSize -->
<!-- $$$defaultFormat[overload1]$$$defaultFormat -->
<h3 class="fn"><a name="defaultFormat"></a><span class="type">QPlatformWindowFormat</span> QPlatformWindowFormat::<span class="name">defaultFormat</span> ()<tt> [static]</tt></h3>
<p>Returns the default <a href="qplatformwindowformat.html">QPlatformWindowFormat</a> for the application. All <a href="qglwidget.html">QGLWidget</a> objects that are created use this format unless another format is specified, e.g&#x2e; when they are constructed.</p>
<p>If no special default format has been set using <a href="qplatformwindowformat.html#setDefaultFormat">setDefaultFormat</a>(), the default format is the same as that created with <a href="qplatformwindowformat.html#QPlatformWindowFormat">QPlatformWindowFormat</a>().</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setDefaultFormat">setDefaultFormat</a>().</p>
<!-- @@@defaultFormat -->
<!-- $$$depth[overload1]$$$depth -->
<h3 class="fn"><a name="depth"></a><span class="type">bool</span> QPlatformWindowFormat::<span class="name">depth</span> () const</h3>
<p>Returns true if the depth buffer is enabled; otherwise returns false. The depth buffer is enabled by default.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setDepth">setDepth</a>() and <a href="qplatformwindowformat.html#setDepthBufferSize">setDepthBufferSize</a>().</p>
<!-- @@@depth -->
<!-- $$$depthBufferSize[overload1]$$$depthBufferSize -->
<h3 class="fn"><a name="depthBufferSize"></a><span class="type">int</span> QPlatformWindowFormat::<span class="name">depthBufferSize</span> () const</h3>
<p>Returns the depth buffer size.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#depth">depth</a>(), <a href="qplatformwindowformat.html#setDepth">setDepth</a>(), and <a href="qplatformwindowformat.html#setDepthBufferSize">setDepthBufferSize</a>().</p>
<!-- @@@depthBufferSize -->
<!-- $$$directRendering[overload1]$$$directRendering -->
<h3 class="fn"><a name="directRendering"></a><span class="type">bool</span> QPlatformWindowFormat::<span class="name">directRendering</span> () const</h3>
<p>Returns true if direct rendering is enabled; otherwise returns false.</p>
<p>Direct rendering is enabled by default.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setDirectRendering">setDirectRendering</a>().</p>
<!-- @@@directRendering -->
<!-- $$$doubleBuffer[overload1]$$$doubleBuffer -->
<h3 class="fn"><a name="doubleBuffer"></a><span class="type">bool</span> QPlatformWindowFormat::<span class="name">doubleBuffer</span> () const</h3>
<p>Returns true if double buffering is enabled; otherwise returns false. Double buffering is enabled by default.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setDoubleBuffer">setDoubleBuffer</a>().</p>
<!-- @@@doubleBuffer -->
<!-- $$$greenBufferSize[overload1]$$$greenBufferSize -->
<h3 class="fn"><a name="greenBufferSize"></a><span class="type">int</span> QPlatformWindowFormat::<span class="name">greenBufferSize</span> () const</h3>
<p>Returns the green buffer size.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setGreenBufferSize">setGreenBufferSize</a>().</p>
<!-- @@@greenBufferSize -->
<!-- $$$hasWindowSurface[overload1]$$$hasWindowSurface -->
<h3 class="fn"><a name="hasWindowSurface"></a><span class="type">bool</span> QPlatformWindowFormat::<span class="name">hasWindowSurface</span> () const</h3>
<p>Returns true if the corresponding widget has an instance of QWindowSurface.</p>
<p>Otherwise returns false.</p>
<p>WindowSurface is enabled by default.</p>
<!-- @@@hasWindowSurface -->
<!-- $$$redBufferSize[overload1]$$$redBufferSize -->
<h3 class="fn"><a name="redBufferSize"></a><span class="type">int</span> QPlatformWindowFormat::<span class="name">redBufferSize</span> () const</h3>
<p>Returns the red buffer size.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setRedBufferSize">setRedBufferSize</a>().</p>
<!-- @@@redBufferSize -->
<!-- $$$rgba[overload1]$$$rgba -->
<h3 class="fn"><a name="rgba"></a><span class="type">bool</span> QPlatformWindowFormat::<span class="name">rgba</span> () const</h3>
<p>Returns true if RGBA color mode is set. Returns false if color index mode is set. The default color mode is RGBA.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setRgba">setRgba</a>().</p>
<!-- @@@rgba -->
<!-- $$$sampleBuffers[overload1]$$$sampleBuffers -->
<h3 class="fn"><a name="sampleBuffers"></a><span class="type">bool</span> QPlatformWindowFormat::<span class="name">sampleBuffers</span> () const</h3>
<p>Returns true if multisample buffer support is enabled; otherwise returns false.</p>
<p>The multisample buffer is disabled by default.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setSampleBuffers">setSampleBuffers</a>().</p>
<!-- @@@sampleBuffers -->
<!-- $$$samples[overload1]$$$samples -->
<h3 class="fn"><a name="samples"></a><span class="type">int</span> QPlatformWindowFormat::<span class="name">samples</span> () const</h3>
<p>Returns the number of samples per pixel when multisampling is enabled. By default, the highest number of samples that is available is used.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setSampleBuffers">setSampleBuffers</a>(), <a href="qplatformwindowformat.html#sampleBuffers">sampleBuffers</a>(), and <a href="qplatformwindowformat.html#setSamples">setSamples</a>().</p>
<!-- @@@samples -->
<!-- $$$setAccum[overload1]$$$setAccumbool -->
<h3 class="fn"><a name="setAccum"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setAccum</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>If <i>enable</i> is true enables the accumulation buffer; otherwise disables the accumulation buffer.</p>
<p>The accumulation buffer is disabled by default.</p>
<p>The accumulation buffer is used to create blur effects and multiple exposures.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#accum">accum</a>() and <a href="qplatformwindowformat.html#setAccumBufferSize">setAccumBufferSize</a>().</p>
<!-- @@@setAccum -->
<!-- $$$setAccumBufferSize[overload1]$$$setAccumBufferSizeint -->
<h3 class="fn"><a name="setAccumBufferSize"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setAccumBufferSize</span> ( <span class="type">int</span> <i>size</i> )</h3>
<p>Set the preferred accumulation buffer size, where <i>size</i> is the bit depth for each RGBA component.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#accum">accum</a>(), <a href="qplatformwindowformat.html#setAccum">setAccum</a>(), and <a href="qplatformwindowformat.html#accumBufferSize">accumBufferSize</a>().</p>
<!-- @@@setAccumBufferSize -->
<!-- $$$setAlpha[overload1]$$$setAlphabool -->
<h3 class="fn"><a name="setAlpha"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setAlpha</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>If <i>enable</i> is true enables the alpha buffer; otherwise disables the alpha buffer.</p>
<p>The alpha buffer is disabled by default.</p>
<p>The alpha buffer is typically used for implementing transparency or translucency. The A in RGBA specifies the transparency of a pixel.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#alpha">alpha</a>() and <a href="qplatformwindowformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@setAlpha -->
<!-- $$$setAlphaBufferSize[overload1]$$$setAlphaBufferSizeint -->
<h3 class="fn"><a name="setAlphaBufferSize"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setAlphaBufferSize</span> ( <span class="type">int</span> <i>size</i> )</h3>
<p>Set the preferred alpha buffer size to <i>size</i>. This function implicitly enables the alpha channel.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qplatformwindowformat.html#setGreenBufferSize">setGreenBufferSize</a>(), and <a href="qplatformwindowformat.html#alphaBufferSize">alphaBufferSize</a>().</p>
<!-- @@@setAlphaBufferSize -->
<!-- $$$setBlueBufferSize[overload1]$$$setBlueBufferSizeint -->
<h3 class="fn"><a name="setBlueBufferSize"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setBlueBufferSize</span> ( <span class="type">int</span> <i>size</i> )</h3>
<p>Set the preferred blue buffer size to <i>size</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#blueBufferSize">blueBufferSize</a>(), <a href="qplatformwindowformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qplatformwindowformat.html#setGreenBufferSize">setGreenBufferSize</a>(), and <a href="qplatformwindowformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@setBlueBufferSize -->
<!-- $$$setDefaultFormat[overload1]$$$setDefaultFormatconstQPlatformWindowFormat& -->
<h3 class="fn"><a name="setDefaultFormat"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setDefaultFormat</span> ( const <span class="type">QPlatformWindowFormat</span> &amp; <i>f</i> )<tt> [static]</tt></h3>
<p>Sets a new default <a href="qplatformwindowformat.html">QPlatformWindowFormat</a> for the application to <i>f</i>. For example, to set single buffering as the default instead of double buffering, your main() might contain code like this:</p>
<pre class="cpp"> <span class="type"><a href="qapplication.html">QApplication</a></span> a(argc<span class="operator">,</span> argv);
 <span class="type"><a href="qglformat.html">QGLFormat</a></span> f;
 f<span class="operator">.</span><a href="qplatformwindowformat.html#setDoubleBuffer">setDoubleBuffer</a>(<span class="keyword">false</span>);
 <span class="type"><a href="qglformat.html">QGLFormat</a></span><span class="operator">::</span>setDefaultFormat(f);</pre>
<p><b>See also </b><a href="qplatformwindowformat.html#defaultFormat">defaultFormat</a>().</p>
<!-- @@@setDefaultFormat -->
<!-- $$$setDepth[overload1]$$$setDepthbool -->
<h3 class="fn"><a name="setDepth"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setDepth</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>If <i>enable</i> is true enables the depth buffer; otherwise disables the depth buffer.</p>
<p>The depth buffer is enabled by default.</p>
<p>The purpose of a depth buffer (or Z-buffering) is to remove hidden surfaces. Pixels are assigned Z values based on the distance to the viewer. A pixel with a high Z value is closer to the viewer than a pixel with a low Z value. This information is used to decide whether to draw a pixel or not.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#depth">depth</a>() and <a href="qplatformwindowformat.html#setDepthBufferSize">setDepthBufferSize</a>().</p>
<!-- @@@setDepth -->
<!-- $$$setDepthBufferSize[overload1]$$$setDepthBufferSizeint -->
<h3 class="fn"><a name="setDepthBufferSize"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setDepthBufferSize</span> ( <span class="type">int</span> <i>size</i> )</h3>
<p>Set the minimum depth buffer size to <i>size</i>.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#depthBufferSize">depthBufferSize</a>(), <a href="qplatformwindowformat.html#setDepth">setDepth</a>(), and <a href="qplatformwindowformat.html#depth">depth</a>().</p>
<!-- @@@setDepthBufferSize -->
<!-- $$$setDirectRendering[overload1]$$$setDirectRenderingbool -->
<h3 class="fn"><a name="setDirectRendering"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setDirectRendering</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>If <i>enable</i> is true enables direct rendering; otherwise disables direct rendering.</p>
<p>Direct rendering is enabled by default.</p>
<p>Enabling this option will make <a href="qplatformwindowformat.html#WindowApi-enum">OpenGL</a> bypass the underlying window system and render directly from hardware to the screen, if this is supported by the system.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#directRendering">directRendering</a>().</p>
<!-- @@@setDirectRendering -->
<!-- $$$setDoubleBuffer[overload1]$$$setDoubleBufferbool -->
<h3 class="fn"><a name="setDoubleBuffer"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setDoubleBuffer</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>If <i>enable</i> is true sets double buffering; otherwise sets single buffering.</p>
<p>Double buffering is enabled by default.</p>
<p>Double buffering is a technique where graphics are rendered on an off-screen buffer and not directly to the screen. When the drawing has been completed, the program calls a swapBuffers() function to exchange the screen contents with the buffer. The result is flicker-free drawing and often better performance.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#doubleBuffer">doubleBuffer</a>(), <a href="qglcontext.html#swapBuffers">QGLContext::swapBuffers</a>(), and <a href="qglwidget.html#swapBuffers">QGLWidget::swapBuffers</a>().</p>
<!-- @@@setDoubleBuffer -->
<!-- $$$setGreenBufferSize[overload1]$$$setGreenBufferSizeint -->
<h3 class="fn"><a name="setGreenBufferSize"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setGreenBufferSize</span> ( <span class="type">int</span> <i>size</i> )</h3>
<p>Set the preferred green buffer size to <i>size</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#greenBufferSize">greenBufferSize</a>(), <a href="qplatformwindowformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qplatformwindowformat.html#setBlueBufferSize">setBlueBufferSize</a>(), and <a href="qplatformwindowformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@setGreenBufferSize -->
<!-- $$$setOption[overload1]$$$setOptionQPlatformWindowFormat::FormatOptions -->
<h3 class="fn"><a name="setOption"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setOption</span> ( <span class="type"><a href="qplatformwindowformat.html#FormatOption-enum">QPlatformWindowFormat::FormatOptions</a></span> <i>opt</i> )</h3>
<p>Sets the format option to <i>opt</i>.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#testOption">testOption</a>().</p>
<!-- @@@setOption -->
<!-- $$$setRedBufferSize[overload1]$$$setRedBufferSizeint -->
<h3 class="fn"><a name="setRedBufferSize"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setRedBufferSize</span> ( <span class="type">int</span> <i>size</i> )</h3>
<p>Set the preferred red buffer size to <i>size</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#redBufferSize">redBufferSize</a>(), <a href="qplatformwindowformat.html#setGreenBufferSize">setGreenBufferSize</a>(), <a href="qplatformwindowformat.html#setBlueBufferSize">setBlueBufferSize</a>(), and <a href="qplatformwindowformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@setRedBufferSize -->
<!-- $$$setRgba[overload1]$$$setRgbabool -->
<h3 class="fn"><a name="setRgba"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setRgba</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>If <i>enable</i> is true sets RGBA mode. If <i>enable</i> is false sets color index mode.</p>
<p>The default color mode is RGBA.</p>
<p>RGBA is the preferred mode for most <a href="qplatformwindowformat.html#WindowApi-enum">OpenGL</a> applications. In RGBA color mode you specify colors as red + green + blue + alpha quadruplets.</p>
<p>In color index mode you specify an index into a color lookup table.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#rgba">rgba</a>().</p>
<!-- @@@setRgba -->
<!-- $$$setSampleBuffers[overload1]$$$setSampleBuffersbool -->
<h3 class="fn"><a name="setSampleBuffers"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setSampleBuffers</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>If <i>enable</i> is true, a GL context with multisample buffer support is picked; otherwise ignored.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#sampleBuffers">sampleBuffers</a>(), <a href="qplatformwindowformat.html#setSamples">setSamples</a>(), and <a href="qplatformwindowformat.html#samples">samples</a>().</p>
<!-- @@@setSampleBuffers -->
<!-- $$$setSamples[overload1]$$$setSamplesint -->
<h3 class="fn"><a name="setSamples"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setSamples</span> ( <span class="type">int</span> <i>numSamples</i> )</h3>
<p>Set the preferred number of samples per pixel when multisampling is enabled to <i>numSamples</i>. By default, the highest number of samples available is used.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setSampleBuffers">setSampleBuffers</a>(), <a href="qplatformwindowformat.html#sampleBuffers">sampleBuffers</a>(), and <a href="qplatformwindowformat.html#samples">samples</a>().</p>
<!-- @@@setSamples -->
<!-- $$$setSharedContext[overload1]$$$setSharedContextQPlatformGLContext* -->
<h3 class="fn"><a name="setSharedContext"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setSharedContext</span> ( <span class="type">QPlatformGLContext</span> * <i>context</i> )</h3>
<!-- @@@setSharedContext -->
<!-- $$$setStencil[overload1]$$$setStencilbool -->
<h3 class="fn"><a name="setStencil"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setStencil</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>If <i>enable</i> is true enables the stencil buffer; otherwise disables the stencil buffer.</p>
<p>The stencil buffer is enabled by default.</p>
<p>The stencil buffer masks certain parts of the drawing area so that masked parts are not drawn on.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#stencil">stencil</a>() and <a href="qplatformwindowformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>
<!-- @@@setStencil -->
<!-- $$$setStencilBufferSize[overload1]$$$setStencilBufferSizeint -->
<h3 class="fn"><a name="setStencilBufferSize"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setStencilBufferSize</span> ( <span class="type">int</span> <i>size</i> )</h3>
<p>Set the preferred stencil buffer size to <i>size</i>.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#stencilBufferSize">stencilBufferSize</a>(), <a href="qplatformwindowformat.html#setStencil">setStencil</a>(), and <a href="qplatformwindowformat.html#stencil">stencil</a>().</p>
<!-- @@@setStencilBufferSize -->
<!-- $$$setStereo[overload1]$$$setStereobool -->
<h3 class="fn"><a name="setStereo"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setStereo</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>If <i>enable</i> is true enables stereo buffering; otherwise disables stereo buffering.</p>
<p>Stereo buffering is disabled by default.</p>
<p>Stereo buffering provides extra color buffers to generate left-eye and right-eye images.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#stereo">stereo</a>().</p>
<!-- @@@setStereo -->
<!-- $$$setSwapInterval[overload1]$$$setSwapIntervalint -->
<h3 class="fn"><a name="setSwapInterval"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setSwapInterval</span> ( <span class="type">int</span> <i>interval</i> )</h3>
<p>Set the preferred swap interval. This can be used to sync the GL drawing into a system window to the vertical refresh of the screen. Setting an <i>interval</i> value of 0 will turn the vertical refresh syncing off, any value higher than 0 will turn the vertical syncing on.</p>
<p>Under Windows and under X11, where the <tt>WGL_EXT_swap_control</tt> and <tt>GLX_SGI_video_sync</tt> extensions are used, the <i>interval</i> parameter can be used to set the minimum number of video frames that are displayed before a buffer swap will occur. In effect, setting the <i>interval</i> to 10, means there will be 10 vertical retraces between every buffer swap.</p>
<p>Under Windows the <tt>WGL_EXT_swap_control</tt> extension has to be present, and under X11 the <tt>GLX_SGI_video_sync</tt> extension has to be present.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#swapInterval">swapInterval</a>().</p>
<!-- @@@setSwapInterval -->
<!-- $$$setWindowApi[overload1]$$$setWindowApiQPlatformWindowFormat::WindowApi -->
<h3 class="fn"><a name="setWindowApi"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setWindowApi</span> ( <span class="type"><a href="qplatformwindowformat.html#WindowApi-enum">QPlatformWindowFormat::WindowApi</a></span> <i>api</i> )</h3>
<p><b>See also </b><a href="qplatformwindowformat.html#windowApi">windowApi</a>().</p>
<!-- @@@setWindowApi -->
<!-- $$$setWindowSurface[overload1]$$$setWindowSurfacebool -->
<h3 class="fn"><a name="setWindowSurface"></a><span class="type">void</span> QPlatformWindowFormat::<span class="name">setWindowSurface</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>If <i>enable</i> is true a top level <a href="qwidget.html">QWidget</a> will create a QWindowSurface at creation;</p>
<p>otherwise the <a href="qwidget.html">QWidget</a> will only have a QPlatformWindow.</p>
<p>This is useful for <a href="qglwidget.html">QGLWidget</a> where the QPlatformGLContext controls the surface.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#hasWindowSurface">hasWindowSurface</a>().</p>
<!-- @@@setWindowSurface -->
<!-- $$$sharedGLContext[overload1]$$$sharedGLContext -->
<h3 class="fn"><a name="sharedGLContext"></a><span class="type">QPlatformGLContext</span> * QPlatformWindowFormat::<span class="name">sharedGLContext</span> () const</h3>
<!-- @@@sharedGLContext -->
<!-- $$$stencil[overload1]$$$stencil -->
<h3 class="fn"><a name="stencil"></a><span class="type">bool</span> QPlatformWindowFormat::<span class="name">stencil</span> () const</h3>
<p>Returns true if the stencil buffer is enabled; otherwise returns false. The stencil buffer is enabled by default.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setStencil">setStencil</a>() and <a href="qplatformwindowformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>
<!-- @@@stencil -->
<!-- $$$stencilBufferSize[overload1]$$$stencilBufferSize -->
<h3 class="fn"><a name="stencilBufferSize"></a><span class="type">int</span> QPlatformWindowFormat::<span class="name">stencilBufferSize</span> () const</h3>
<p>Returns the stencil buffer size.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#stencil">stencil</a>(), <a href="qplatformwindowformat.html#setStencil">setStencil</a>(), and <a href="qplatformwindowformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>
<!-- @@@stencilBufferSize -->
<!-- $$$stereo[overload1]$$$stereo -->
<h3 class="fn"><a name="stereo"></a><span class="type">bool</span> QPlatformWindowFormat::<span class="name">stereo</span> () const</h3>
<p>Returns true if stereo buffering is enabled; otherwise returns false. Stereo buffering is disabled by default.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setStereo">setStereo</a>().</p>
<!-- @@@stereo -->
<!-- $$$swapInterval[overload1]$$$swapInterval -->
<h3 class="fn"><a name="swapInterval"></a><span class="type">int</span> QPlatformWindowFormat::<span class="name">swapInterval</span> () const</h3>
<p>Returns the currently set swap interval. -1 is returned if setting the swap interval isn't supported in the system GL implementation.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setSwapInterval">setSwapInterval</a>().</p>
<!-- @@@swapInterval -->
<!-- $$$testOption[overload1]$$$testOptionQPlatformWindowFormat::FormatOptions -->
<h3 class="fn"><a name="testOption"></a><span class="type">bool</span> QPlatformWindowFormat::<span class="name">testOption</span> ( <span class="type"><a href="qplatformwindowformat.html#FormatOption-enum">QPlatformWindowFormat::FormatOptions</a></span> <i>opt</i> ) const</h3>
<p>Returns true if format option <i>opt</i> is set; otherwise returns false.</p>
<p><b>See also </b><a href="qplatformwindowformat.html#setOption">setOption</a>().</p>
<!-- @@@testOption -->
<!-- $$$windowApi[overload1]$$$windowApi -->
<h3 class="fn"><a name="windowApi"></a><span class="type"><a href="qplatformwindowformat.html#WindowApi-enum">WindowApi</a></span> QPlatformWindowFormat::<span class="name">windowApi</span> () const</h3>
<p><b>See also </b><a href="qplatformwindowformat.html#setWindowApi">setWindowApi</a>().</p>
<!-- @@@windowApi -->
<!-- $$$operator=[overload1]$$$operator=constQPlatformWindowFormat& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QPlatformWindowFormat</span> &amp; QPlatformWindowFormat::<span class="name">operator=</span> ( const <span class="type">QPlatformWindowFormat</span> &amp; <i>other</i> )</h3>
<p>Assigns <i>other</i> to this object.</p>
<!-- @@@operator= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator!=$$$operator!=constQPlatformWindowFormat&constQPlatformWindowFormat& -->
<h3 class="fn"><a name="operator-not-eq-49"></a><span class="type">bool</span> <span class="name">operator!=</span> ( const <span class="type">QPlatformWindowFormat</span> &amp; <i>a</i>, const <span class="type">QPlatformWindowFormat</span> &amp; <i>b</i> )</h3>
<p>Returns false if all the options of the two <a href="qplatformwindowformat.html">QPlatformWindowFormat</a> objects <i>a</i> and <i>b</i> are equal; otherwise returns true.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@operator!= -->
<!-- $$$operator==$$$operator==constQPlatformWindowFormat&constQPlatformWindowFormat& -->
<h3 class="fn"><a name="operator-eq-eq-68"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type">QPlatformWindowFormat</span> &amp; <i>a</i>, const <span class="type">QPlatformWindowFormat</span> &amp; <i>b</i> )</h3>
<p>Returns true if all the options of the two <a href="qplatformwindowformat.html">QPlatformWindowFormat</a> objects <i>a</i> and <i>b</i> are equal; otherwise returns false.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@operator== -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. 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>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      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>