Sophie

Sophie

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

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" />
<!-- qapplication.cpp -->
  <title>Qt 4.8: QApplication 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>QApplication</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="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#macros">Macros</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QApplication Class Reference</h1>
<!-- $$$QApplication-brief -->
<p>The QApplication class manages the GUI application's control flow and main settings. <a href="#details">More...</a></p>
<!-- @@@QApplication -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QApplication&gt;</span></pre><p><b>Inherits: </b><a href="qcoreapplication.html">QCoreApplication</a>.</p>
<ul>
<li><a href="qapplication-members.html">List of all members, including inherited members</a></li>
<li><a href="qapplication-qt3.html">Qt 3 support 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="qapplication.html#ColorSpec-enum">ColorSpec</a></b> { NormalColor, CustomColor, ManyColor }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#QS60MainApplicationFactory-typedef">QS60MainApplicationFactory</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#Type-enum">Type</a></b> { Tty, GuiClient, GuiServer }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qapplication.html#autoMaximizeThreshold-prop">autoMaximizeThreshold</a></b> : int</li>
<li class="fn"><b><a href="qapplication.html#autoSipEnabled-prop">autoSipEnabled</a></b> : bool</li>
<li class="fn"><b><a href="qapplication.html#cursorFlashTime-prop">cursorFlashTime</a></b> : int</li>
<li class="fn"><b><a href="qapplication.html#doubleClickInterval-prop">doubleClickInterval</a></b> : int</li>
<li class="fn"><b><a href="qapplication.html#globalStrut-prop">globalStrut</a></b> : QSize</li>
<li class="fn"><b><a href="qapplication.html#keyboardInputInterval-prop">keyboardInputInterval</a></b> : int</li>
<li class="fn"><b><a href="qapplication.html#layoutDirection-prop">layoutDirection</a></b> : Qt::LayoutDirection</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qapplication.html#quitOnLastWindowClosed-prop">quitOnLastWindowClosed</a></b> : bool</li>
<li class="fn"><b><a href="qapplication.html#startDragDistance-prop">startDragDistance</a></b> : int</li>
<li class="fn"><b><a href="qapplication.html#startDragTime-prop">startDragTime</a></b> : int</li>
<li class="fn"><b><a href="qapplication.html#styleSheet-prop">styleSheet</a></b> : QString</li>
<li class="fn"><b><a href="qapplication.html#wheelScrollLines-prop">wheelScrollLines</a></b> : int</li>
<li class="fn"><b><a href="qapplication.html#windowIcon-prop">windowIcon</a></b> : QIcon</li>
</ul>
</td></tr>
</table>
<ul>
<li class="fn">4 properties inherited from <a href="qcoreapplication.html#properties">QCoreApplication</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="qapplication.html#QApplication">QApplication</a></b> ( int &amp; <i>argc</i>, char ** <i>argv</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#QApplication-2">QApplication</a></b> ( int &amp; <i>argc</i>, char ** <i>argv</i>, bool <i>GUIenabled</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#QApplication-3">QApplication</a></b> ( int &amp; <i>argc</i>, char ** <i>argv</i>, Type <i>type</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#QApplication-4">QApplication</a></b> ( Display * <i>display</i>, Qt::HANDLE <i>visual</i> = 0, Qt::HANDLE <i>colormap</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#QApplication-5">QApplication</a></b> ( Display * <i>display</i>, int &amp; <i>argc</i>, char ** <i>argv</i>, Qt::HANDLE <i>visual</i> = 0, Qt::HANDLE <i>colormap</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#QApplication-6">QApplication</a></b> ( QApplication::QS60MainApplicationFactory <i>factory</i>, int &amp; <i>argc</i>, char ** <i>argv</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#dtor.QApplication">~QApplication</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#commitData">commitData</a></b> ( QSessionManager &amp; <i>manager</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QInputContext * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#inputContext">inputContext</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#isSessionRestored">isSessionRestored</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#macEventFilter">macEventFilter</a></b> ( EventHandlerCallRef <i>caller</i>, EventRef <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#qwsEventFilter">qwsEventFilter</a></b> ( QWSEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#qwsSetCustomColors">qwsSetCustomColors</a></b> ( QRgb * <i>colorTable</i>, int <i>start</i>, int <i>numColors</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#saveState">saveState</a></b> ( QSessionManager &amp; <i>manager</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#sessionId">sessionId</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#sessionKey">sessionKey</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setInputContext">setInputContext</a></b> ( QInputContext * <i>inputContext</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#styleSheet-prop">styleSheet</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#symbianEventFilter">symbianEventFilter</a></b> ( const QSymbianEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#symbianProcessEvent">symbianProcessEvent</a></b> ( const QSymbianEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#x11EventFilter">x11EventFilter</a></b> ( XEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#x11ProcessEvent">x11ProcessEvent</a></b> ( XEvent * <i>event</i> )</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="qapplication.html#notify">notify</a></b> ( QObject * <i>receiver</i>, QEvent * <i>e</i> )</td></tr>
</table>
<ul>
<li class="fn">4 public functions inherited from <a href="qcoreapplication.html#public-functions">QCoreApplication</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#aboutQt">aboutQt</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#autoMaximizeThreshold-prop">autoMaximizeThreshold</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#autoSipEnabled-prop">autoSipEnabled</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#closeAllWindows">closeAllWindows</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#autoMaximizeThreshold-prop">setAutoMaximizeThreshold</a></b> ( const int <i>threshold</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#autoSipEnabled-prop">setAutoSipEnabled</a></b> ( const bool <i>enabled</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#styleSheet-prop">setStyleSheet</a></b> ( const QString &amp; <i>sheet</i> )</td></tr>
</table>
<ul>
<li class="fn">1 public slot inherited from <a href="qcoreapplication.html#public-slots">QCoreApplication</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#aboutToReleaseGpuResources">aboutToReleaseGpuResources</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#aboutToUseGpuResources">aboutToUseGpuResources</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#commitDataRequest">commitDataRequest</a></b> ( QSessionManager &amp; <i>manager</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#focusChanged">focusChanged</a></b> ( QWidget * <i>old</i>, QWidget * <i>now</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#fontDatabaseChanged">fontDatabaseChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#lastWindowClosed">lastWindowClosed</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#saveStateRequest">saveStateRequest</a></b> ( QSessionManager &amp; <i>manager</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qcoreapplication.html#signals">QCoreApplication</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#activeModalWidget">activeModalWidget</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#activePopupWidget">activePopupWidget</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#activeWindow">activeWindow</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#alert">alert</a></b> ( QWidget * <i>widget</i>, int <i>msec</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidgetList </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#allWidgets">allWidgets</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#beep">beep</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#changeOverrideCursor">changeOverrideCursor</a></b> ( const QCursor &amp; <i>cursor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QClipboard * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#clipboard">clipboard</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#colorSpec">colorSpec</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#cursorFlashTime-prop">cursorFlashTime</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDesktopWidget * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#desktop">desktop</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#desktopSettingsAware">desktopSettingsAware</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#doubleClickInterval-prop">doubleClickInterval</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#exec">exec</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#focusWidget">focusWidget</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#font">font</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#font-2">font</a></b> ( const QWidget * <i>widget</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#font-3">font</a></b> ( const char * <i>className</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFontMetrics </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#fontMetrics">fontMetrics</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#globalStrut-prop">globalStrut</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#isEffectEnabled">isEffectEnabled</a></b> ( Qt::UIEffect <i>effect</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#isLeftToRight">isLeftToRight</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#isRightToLeft">isRightToLeft</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::LayoutDirection </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#keyboardInputDirection">keyboardInputDirection</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#keyboardInputInterval-prop">keyboardInputInterval</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QLocale </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#keyboardInputLocale">keyboardInputLocale</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::KeyboardModifiers </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#keyboardModifiers">keyboardModifiers</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#keypadNavigationEnabled">keypadNavigationEnabled</a></b> ()<tt> (deprecated)</tt></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::LayoutDirection </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#layoutDirection-prop">layoutDirection</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::MouseButtons </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#mouseButtons">mouseButtons</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::NavigationMode </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#navigationMode">navigationMode</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCursor * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#overrideCursor">overrideCursor</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPalette </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#palette">palette</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPalette </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#palette-2">palette</a></b> ( const QWidget * <i>widget</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPalette </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#palette-3">palette</a></b> ( const char * <i>className</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::KeyboardModifiers </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#queryKeyboardModifiers">queryKeyboardModifiers</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#quitOnLastWindowClosed-prop">quitOnLastWindowClosed</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDecoration &amp; </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#qwsDecoration">qwsDecoration</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#qwsSetDecoration">qwsSetDecoration</a></b> ( QDecoration * <i>decoration</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDecoration * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#qwsSetDecoration-2">qwsSetDecoration</a></b> ( const QString &amp; <i>decoration</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setActiveWindow">setActiveWindow</a></b> ( QWidget * <i>active</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setColorSpec">setColorSpec</a></b> ( int <i>spec</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#cursorFlashTime-prop">setCursorFlashTime</a></b> ( int )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setDesktopSettingsAware">setDesktopSettingsAware</a></b> ( bool <i>on</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#doubleClickInterval-prop">setDoubleClickInterval</a></b> ( int )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setEffectEnabled">setEffectEnabled</a></b> ( Qt::UIEffect <i>effect</i>, bool <i>enable</i> = true )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setFont">setFont</a></b> ( const QFont &amp; <i>font</i>, const char * <i>className</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#globalStrut-prop">setGlobalStrut</a></b> ( const QSize &amp; )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setGraphicsSystem">setGraphicsSystem</a></b> ( const QString &amp; <i>system</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#keyboardInputInterval-prop">setKeyboardInputInterval</a></b> ( int )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#layoutDirection-prop">setLayoutDirection</a></b> ( Qt::LayoutDirection <i>direction</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setNavigationMode">setNavigationMode</a></b> ( Qt::NavigationMode <i>mode</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setOverrideCursor">setOverrideCursor</a></b> ( const QCursor &amp; <i>cursor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setPalette">setPalette</a></b> ( const QPalette &amp; <i>palette</i>, const char * <i>className</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#quitOnLastWindowClosed-prop">setQuitOnLastWindowClosed</a></b> ( bool <i>quit</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#startDragDistance-prop">setStartDragDistance</a></b> ( int <i>l</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#startDragTime-prop">setStartDragTime</a></b> ( int <i>ms</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setStyle">setStyle</a></b> ( QStyle * <i>style</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStyle * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#setStyle-2">setStyle</a></b> ( const QString &amp; <i>style</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#wheelScrollLines-prop">setWheelScrollLines</a></b> ( int )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#windowIcon-prop">setWindowIcon</a></b> ( const QIcon &amp; <i>icon</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#startDragDistance-prop">startDragDistance</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#startDragTime-prop">startDragTime</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStyle * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#style">style</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#syncX">syncX</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#topLevelAt">topLevelAt</a></b> ( const QPoint &amp; <i>point</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#topLevelAt-2">topLevelAt</a></b> ( int <i>x</i>, int <i>y</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidgetList </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#topLevelWidgets">topLevelWidgets</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Type </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#type">type</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#wheelScrollLines-prop">wheelScrollLines</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#widgetAt">widgetAt</a></b> ( const QPoint &amp; <i>point</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#widgetAt-4">widgetAt</a></b> ( int <i>x</i>, int <i>y</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIcon </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#windowIcon-prop">windowIcon</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">38 static public members inherited from <a href="qcoreapplication.html#static-public-members">QCoreApplication</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</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="qapplication.html#event">event</a></b> ( QEvent * <i>e</i> )</td></tr>
</table>
<ul>
<li class="fn">1 protected function inherited from <a href="qcoreapplication.html#protected-functions">QCoreApplication</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="macros"></a>
<h2>Macros</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qapplication.html#qApp">qApp</a></b></td></tr>
</table>
<a name="details"></a>
<!-- $$$QApplication-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QApplication class manages the GUI application's control flow and main settings.</p>
<p>QApplication contains the main event loop, where all events from the window system and other sources are processed and dispatched. It also handles the application's initialization, finalization, and provides session management. In addition, QApplication handles most of the system-wide and application-wide settings.</p>
<p>For any GUI application using Qt, there is precisely <b>one</b> QApplication object, no matter whether the application has 0, 1, 2 or more windows at any given time. For non-GUI Qt applications, use <a href="qcoreapplication.html">QCoreApplication</a> instead, as it does not depend on the <a href="qtgui.html">QtGui</a> library.</p>
<p>The QApplication object is accessible through the <a href="qcoreapplication.html#instance">instance</a>() function that returns a pointer equivalent to the global <a href="qapplication.html#qApp">qApp</a> pointer.</p>
<p>QApplication's main areas of responsibility are:</p>
<ul>
<li>It initializes the application with the user's desktop settings such as <a href="qapplication.html#palette">palette</a>(), <a href="qapplication.html#font">font</a>() and <a href="qapplication.html#doubleClickInterval-prop">doubleClickInterval</a>(). It keeps track of these properties in case the user changes the desktop globally, for example through some kind of control panel.</li>
<li>It performs event handling, meaning that it receives events from the underlying window system and dispatches them to the relevant widgets. By using <a href="qcoreapplication.html#sendEvent">sendEvent</a>() and <a href="qcoreapplication.html#postEvent">postEvent</a>() you can send your own events to widgets.</li>
<li>It parses common command line arguments and sets its internal state accordingly. See the <a href="qapplication.html#QApplication">constructor documentation</a> below for more details.</li>
<li>It defines the application's look and feel, which is encapsulated in a <a href="qstyle.html">QStyle</a> object. This can be changed at runtime with <a href="qapplication.html#setStyle">setStyle</a>().</li>
<li>It specifies how the application is to allocate colors. See <a href="qapplication.html#setColorSpec">setColorSpec</a>() for details.</li>
<li>It provides localization of strings that are visible to the user via <a href="qcoreapplication.html#translate">translate</a>().</li>
<li>It provides some magical objects like the <a href="qapplication.html#desktop">desktop</a>() and the <a href="qapplication.html#clipboard">clipboard</a>().</li>
<li>It knows about the application's windows. You can ask which widget is at a certain position using <a href="qapplication.html#widgetAt">widgetAt</a>(), get a list of <a href="qapplication.html#topLevelWidgets">topLevelWidgets</a>() and <a href="qapplication.html#closeAllWindows">closeAllWindows</a>(), etc.</li>
<li>It manages the application's mouse cursor handling, see <a href="qapplication.html#setOverrideCursor">setOverrideCursor</a>()</li>
<li>On the X window system, it provides functions to flush and sync the communication stream, see <a href="qapplication-qt3.html#flushX" class="compat">flushX</a>() and <a href="qapplication.html#syncX">syncX</a>().</li>
<li>It provides support for sophisticated <a href="session.html">session management</a>. This makes it possible for applications to terminate gracefully when the user logs out, to cancel a shutdown process if termination isn't possible and even to preserve the entire application's state for a future session. See <a href="qapplication.html#isSessionRestored">isSessionRestored</a>(), <a href="qapplication.html#sessionId">sessionId</a>() and <a href="qapplication.html#commitData">commitData</a>() and <a href="qapplication.html#saveState">saveState</a>() for details.</li>
</ul>
<p>Since the QApplication object does so much initialization, it <i>must</i> be created before any other objects related to the user interface are created. QApplication also deals with common command line arguments. Hence, it is usually a good idea to create it <i>before</i> any interpretation or modification of <tt>argv</tt> is done in the application itself.</p>
<table class="generic">
<thead><tr class="qt-style"><th  colspan="2">Groups of functions</th></tr></thead>
<tr valign="top" class="odd"><td >System settings</td><td ><a href="qapplication.html#desktopSettingsAware">desktopSettingsAware</a>(), <a href="qapplication.html#setDesktopSettingsAware">setDesktopSettingsAware</a>(), <a href="qapplication.html#cursorFlashTime-prop">cursorFlashTime</a>(), <a href="qapplication.html#cursorFlashTime-prop">setCursorFlashTime</a>(), <a href="qapplication.html#doubleClickInterval-prop">doubleClickInterval</a>(), <a href="qapplication.html#doubleClickInterval-prop">setDoubleClickInterval</a>(), <a href="qapplication.html#keyboardInputInterval-prop">setKeyboardInputInterval</a>(), <a href="qapplication.html#wheelScrollLines-prop">wheelScrollLines</a>(), <a href="qapplication.html#wheelScrollLines-prop">setWheelScrollLines</a>(), <a href="qapplication.html#palette">palette</a>(), <a href="qapplication.html#setPalette">setPalette</a>(), <a href="qapplication.html#font">font</a>(), <a href="qapplication.html#setFont">setFont</a>(), <a href="qapplication.html#fontMetrics">fontMetrics</a>().</td></tr>
<tr valign="top" class="even"><td >Event handling</td><td ><a href="qapplication.html#exec">exec</a>(), <a href="qcoreapplication.html#processEvents">processEvents</a>(), <a href="qcoreapplication.html#exit">exit</a>(), <a href="qcoreapplication.html#quit">quit</a>(). <a href="qcoreapplication.html#sendEvent">sendEvent</a>(), <a href="qcoreapplication.html#postEvent">postEvent</a>(), <a href="qcoreapplication.html#sendPostedEvents">sendPostedEvents</a>(), <a href="qcoreapplication.html#removePostedEvents">removePostedEvents</a>(), <a href="qcoreapplication.html#hasPendingEvents">hasPendingEvents</a>(), <a href="qapplication.html#notify">notify</a>(), <a href="qapplication.html#macEventFilter">macEventFilter</a>(), <a href="qapplication.html#qwsEventFilter">qwsEventFilter</a>(), <a href="qapplication.html#x11EventFilter">x11EventFilter</a>(), <a href="qapplication.html#x11ProcessEvent">x11ProcessEvent</a>(), <a href="qcoreapplication.html#winEventFilter">winEventFilter</a>().</td></tr>
<tr valign="top" class="odd"><td >GUI Styles</td><td ><a href="qapplication.html#style">style</a>(), <a href="qapplication.html#setStyle">setStyle</a>().</td></tr>
<tr valign="top" class="even"><td >Color usage</td><td ><a href="qapplication.html#colorSpec">colorSpec</a>(), <a href="qapplication.html#setColorSpec">setColorSpec</a>(), <a href="qapplication.html#qwsSetCustomColors">qwsSetCustomColors</a>().</td></tr>
<tr valign="top" class="odd"><td >Text handling</td><td ><a href="qcoreapplication.html#installTranslator">installTranslator</a>(), <a href="qcoreapplication.html#removeTranslator">removeTranslator</a>() <a href="qcoreapplication.html#translate">translate</a>().</td></tr>
<tr valign="top" class="even"><td >Widgets</td><td ><a href="qapplication.html#allWidgets">allWidgets</a>(), <a href="qapplication.html#topLevelWidgets">topLevelWidgets</a>(), <a href="qapplication.html#desktop">desktop</a>(), <a href="qapplication.html#activePopupWidget">activePopupWidget</a>(), <a href="qapplication.html#activeModalWidget">activeModalWidget</a>(), <a href="qapplication.html#clipboard">clipboard</a>(), <a href="qapplication.html#focusWidget">focusWidget</a>(), <a href="qapplication.html#activeWindow">activeWindow</a>(), <a href="qapplication.html#widgetAt">widgetAt</a>().</td></tr>
<tr valign="top" class="odd"><td >Advanced cursor handling</td><td ><a href="qapplication.html#overrideCursor">overrideCursor</a>(), <a href="qapplication.html#setOverrideCursor">setOverrideCursor</a>(), <a href="qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>().</td></tr>
<tr valign="top" class="even"><td >X Window System synchronization</td><td ><a href="qapplication-qt3.html#flushX" class="compat">flushX</a>(), <a href="qapplication.html#syncX">syncX</a>().</td></tr>
<tr valign="top" class="odd"><td >Session management</td><td ><a href="qapplication.html#isSessionRestored">isSessionRestored</a>(), <a href="qapplication.html#sessionId">sessionId</a>(), <a href="qapplication.html#commitData">commitData</a>(), <a href="qapplication.html#saveState">saveState</a>().</td></tr>
<tr valign="top" class="even"><td >Miscellaneous</td><td ><a href="qapplication.html#closeAllWindows">closeAllWindows</a>(), <a href="qcoreapplication.html#startingUp">startingUp</a>(), <a href="qcoreapplication.html#closingDown">closingDown</a>(), <a href="qapplication.html#type">type</a>().</td></tr>
</table>
</div>
<p><b>See also </b><a href="qcoreapplication.html">QCoreApplication</a>, <a href="qabstracteventdispatcher.html">QAbstractEventDispatcher</a>, <a href="qeventloop.html">QEventLoop</a>, and <a href="qsettings.html">QSettings</a>.</p>
<!-- @@@QApplication -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ColorSpec$$$NormalColor$$$CustomColor$$$ManyColor -->
<h3 class="fn"><a name="ColorSpec-enum"></a>enum QApplication::<span class="name">ColorSpec</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QApplication::NormalColor</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">the default color allocation policy</td></tr>
<tr><td class="topAlign"><tt>QApplication::CustomColor</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">the same as NormalColor for X11; allocates colors to a palette on demand under Windows</td></tr>
<tr><td class="topAlign"><tt>QApplication::ManyColor</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">the right choice for applications that use thousands of colors</td></tr>
</table>
<p>See <a href="qapplication.html#setColorSpec">setColorSpec</a>() for full details.</p>
<!-- @@@ColorSpec -->
<!-- $$$QS60MainApplicationFactory -->
<h3 class="fn"><a name="QS60MainApplicationFactory-typedef"></a>typedef QApplication::<span class="name">QS60MainApplicationFactory</span></h3>
<p>This is a typedef for a pointer to a function with the following signature:</p>
<pre class="cpp"> CApaApplication <span class="operator">*</span>myApplicationFactory();</pre>
<p>This typedef was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qapplication.html#QApplication">QApplication::QApplication</a>().</p>
<!-- @@@QS60MainApplicationFactory -->
<!-- $$$Type$$$Tty$$$GuiClient$$$GuiServer -->
<h3 class="fn"><a name="Type-enum"></a>enum QApplication::<span class="name">Type</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QApplication::Tty</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">a console application</td></tr>
<tr><td class="topAlign"><tt>QApplication::GuiClient</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">a GUI client application</td></tr>
<tr><td class="topAlign"><tt>QApplication::GuiServer</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">a GUI server application (for Qt for Embedded Linux)</td></tr>
</table>
<!-- @@@Type -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$autoMaximizeThreshold-prop$$$autoMaximizeThreshold$$$setAutoMaximizeThresholdconstint -->
<h3 class="fn"><a name="autoMaximizeThreshold-prop"></a><span class="name">autoMaximizeThreshold</span> : <span class="type">int</span></h3>
<p>This property defines a threshold for auto maximizing widgets.</p>
<p><b>The auto maximize threshold is only available as part of Qt for Windows CE.</b></p>
<p>This property defines a threshold for the size of a window as a percentage of the screen size. If the minimum size hint of a window exceeds the threshold, calling show() will cause the window to be maximized automatically.</p>
<p>Setting the threshold to 100 or greater means that the widget will always be maximized. Alternatively, setting the threshold to 50 means that the widget will be maximized only if the vertical minimum size hint is at least 50% of the vertical screen size.</p>
<p>Setting the threshold to -1 disables the feature.</p>
<p>On Windows CE the default is -1 (i.e&#x2e;, it is disabled). On Windows Mobile the default is 40.</p>
<p>This property was introduced in Qt 4.4.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>autoMaximizeThreshold</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoMaximizeThreshold</b></span> ( const int <i>threshold</i> )</td></tr>
</table>
<!-- @@@autoMaximizeThreshold -->
<!-- $$$autoSipEnabled-prop$$$autoSipEnabled$$$setAutoSipEnabledconstbool -->
<h3 class="fn"><a name="autoSipEnabled-prop"></a><span class="name">autoSipEnabled</span> : <span class="type">bool</span></h3>
<p>This property holds toggles automatic SIP (software input panel) visibility.</p>
<p>Set this property to <tt>true</tt> to automatically display the SIP when entering widgets that accept keyboard input. This property only affects widgets with the WA_InputMethodEnabled attribute set, and is typically used to launch a virtual keyboard on devices which have very few or no keys.</p>
<p><b> The property only has an effect on platforms which use software input panels, such as Windows CE and Symbian.</b></p>
<p>The default is platform dependent.</p>
<p>This property was introduced in Qt 4.5.</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>autoSipEnabled</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoSipEnabled</b></span> ( const bool <i>enabled</i> )</td></tr>
</table>
<!-- @@@autoSipEnabled -->
<!-- $$$cursorFlashTime-prop$$$cursorFlashTime$$$setCursorFlashTimeint -->
<h3 class="fn"><a name="cursorFlashTime-prop"></a><span class="name">cursorFlashTime</span> : <span class="type">int</span></h3>
<p>This property holds the text cursor's flash (blink) time in milliseconds.</p>
<p>The flash time is the time required to display, invert and restore the caret display. Usually the text cursor is displayed for half the cursor flash time, then hidden for the same amount of time, but this may vary.</p>
<p>The default value on X11 is 1000 milliseconds. On Windows, the <b>Control Panel</b> value is used and setting this property sets the cursor flash time for all applications.</p>
<p>We recommend that widgets do not cache this value as it may change at any time if the user changes the global desktop settings.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>cursorFlashTime</b></span> ()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCursorFlashTime</b></span> ( int )</td></tr>
</table>
<!-- @@@cursorFlashTime -->
<!-- $$$doubleClickInterval-prop$$$doubleClickInterval$$$setDoubleClickIntervalint -->
<h3 class="fn"><a name="doubleClickInterval-prop"></a><span class="name">doubleClickInterval</span> : <span class="type">int</span></h3>
<p>This property holds the time limit in milliseconds that distinguishes a double click from two consecutive mouse clicks.</p>
<p>The default value on X11 is 400 milliseconds. On Windows and Mac OS, the operating system's value is used. However, on Windows and Symbian OS, calling this function sets the double click interval for all applications.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>doubleClickInterval</b></span> ()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDoubleClickInterval</b></span> ( int )</td></tr>
</table>
<!-- @@@doubleClickInterval -->
<!-- $$$globalStrut-prop$$$globalStrut$$$setGlobalStrutconstQSize& -->
<h3 class="fn"><a name="globalStrut-prop"></a><span class="name">globalStrut</span> : <span class="type"><a href="qsize.html">QSize</a></span></h3>
<p>This property holds the minimum size that any GUI element that the user can interact with should have.</p>
<p>For example, no button should be resized to be smaller than the global strut size. The strut size should be considered when reimplementing GUI controls that may be used on touch-screens or similar I/O devices.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qsize.html">QSize</a></span> MyWidget<span class="operator">::</span>sizeHint() <span class="keyword">const</span>
 {
     <span class="keyword">return</span> <span class="type"><a href="qsize.html">QSize</a></span>(<span class="number">80</span><span class="operator">,</span> <span class="number">25</span>)<span class="operator">.</span>expandedTo(<span class="type"><a href="qapplication.html">QApplication</a></span><span class="operator">::</span>globalStrut());
 }</pre>
<p>By default, this property contains a <a href="qsize.html">QSize</a> object with zero width and height.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QSize </td><td class="memItemRight bottomAlign"><span class="name"><b>globalStrut</b></span> ()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setGlobalStrut</b></span> ( const QSize &amp; )</td></tr>
</table>
<!-- @@@globalStrut -->
<!-- $$$keyboardInputInterval-prop$$$keyboardInputInterval$$$setKeyboardInputIntervalint -->
<h3 class="fn"><a name="keyboardInputInterval-prop"></a><span class="name">keyboardInputInterval</span> : <span class="type">int</span></h3>
<p>This property holds the time limit in milliseconds that distinguishes a key press from two consecutive key presses.</p>
<p>The default value on X11 is 400 milliseconds. On Windows and Mac OS, the operating system's value is used.</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"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>keyboardInputInterval</b></span> ()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setKeyboardInputInterval</b></span> ( int )</td></tr>
</table>
<!-- @@@keyboardInputInterval -->
<!-- $$$layoutDirection-prop$$$layoutDirection$$$setLayoutDirectionQt::LayoutDirection -->
<h3 class="fn"><a name="layoutDirection-prop"></a><span class="name">layoutDirection</span> : <span class="type"><a href="qt.html#LayoutDirection-enum">Qt::LayoutDirection</a></span></h3>
<p>This property holds the default layout direction for this application.</p>
<p>On system start-up, the default layout direction depends on the application's language.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::LayoutDirection </td><td class="memItemRight bottomAlign"><span class="name"><b>layoutDirection</b></span> ()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setLayoutDirection</b></span> ( Qt::LayoutDirection <i>direction</i> )</td></tr>
</table>
<p><b>See also </b><a href="qwidget.html#layoutDirection-prop">QWidget::layoutDirection</a>, <a href="qapplication.html#isLeftToRight">isLeftToRight</a>(), and <a href="qapplication.html#isRightToLeft">isRightToLeft</a>().</p>
<!-- @@@layoutDirection -->
<!-- $$$quitOnLastWindowClosed-prop$$$quitOnLastWindowClosed$$$setQuitOnLastWindowClosedbool -->
<h3 class="fn"><a name="quitOnLastWindowClosed-prop"></a><span class="name">quitOnLastWindowClosed</span> : <span class="type">bool</span></h3>
<p>This property holds whether the application implicitly quits when the last window is closed.</p>
<p>The default is true.</p>
<p>If this property is true, the applications quits when the last visible primary window (i.e&#x2e; window with no parent) with the <a href="qt.html#WidgetAttribute-enum">Qt::WA_QuitOnClose</a> attribute set is closed. By default this attribute is set for all widgets except for sub-windows. Refer to <a href="qt.html#WindowType-enum">Qt::WindowType</a> for a detailed list of <a href="qt.html#WindowType-enum">Qt::Window</a> objects.</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>quitOnLastWindowClosed</b></span> ()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setQuitOnLastWindowClosed</b></span> ( bool <i>quit</i> )</td></tr>
</table>
<p><b>See also </b><a href="qcoreapplication.html#quit">quit</a>() and <a href="qwidget.html#close">QWidget::close</a>().</p>
<!-- @@@quitOnLastWindowClosed -->
<!-- $$$startDragDistance-prop$$$startDragDistance$$$setStartDragDistanceint -->
<h3 class="fn"><a name="startDragDistance-prop"></a><span class="name">startDragDistance</span> : <span class="type">int</span></h3>
<p>If you support drag and drop in your application, and want to start a drag and drop operation after the user has moved the cursor a certain distance with a button held down, you should use this property's value as the minimum distance required.</p>
<p>For example, if the mouse position of the click is stored in <tt>startPos</tt> and the current position (e.g&#x2e; in the mouse move event) is <tt>currentPos</tt>, you can find out if a drag should be started with code like this:</p>
<pre class="cpp"> <span class="keyword">if</span> ((startPos <span class="operator">-</span> currentPos)<span class="operator">.</span>manhattanLength() <span class="operator">&gt;</span><span class="operator">=</span>
         <span class="type"><a href="qapplication.html">QApplication</a></span><span class="operator">::</span>startDragDistance())
     startTheDrag();</pre>
<p>Qt uses this value internally, e.g&#x2e; in <a href="qfiledialog.html">QFileDialog</a>.</p>
<p>The default value is 4 pixels.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>startDragDistance</b></span> ()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setStartDragDistance</b></span> ( int <i>l</i> )</td></tr>
</table>
<p><b>See also </b><a href="qapplication.html#startDragTime-prop">startDragTime</a>(), <a href="qpoint.html#manhattanLength">QPoint::manhattanLength</a>(), and <a href="dnd.html">Drag and Drop</a>.</p>
<!-- @@@startDragDistance -->
<!-- $$$startDragTime-prop$$$startDragTime$$$setStartDragTimeint -->
<h3 class="fn"><a name="startDragTime-prop"></a><span class="name">startDragTime</span> : <span class="type">int</span></h3>
<p>This property holds the time in milliseconds that a mouse button must be held down before a drag and drop operation will begin.</p>
<p>If you support drag and drop in your application, and want to start a drag and drop operation after the user has held down a mouse button for a certain amount of time, you should use this property's value as the delay.</p>
<p>Qt also uses this delay internally, e.g&#x2e; in <a href="qtextedit.html">QTextEdit</a> and <a href="qlineedit.html">QLineEdit</a>, for starting a drag.</p>
<p>The default value is 500 ms.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>startDragTime</b></span> ()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setStartDragTime</b></span> ( int <i>ms</i> )</td></tr>
</table>
<p><b>See also </b><a href="qapplication.html#startDragDistance-prop">startDragDistance</a>() and <a href="dnd.html">Drag and Drop</a>.</p>
<!-- @@@startDragTime -->
<!-- $$$styleSheet-prop$$$styleSheet$$$setStyleSheetconstQString& -->
<h3 class="fn"><a name="styleSheet-prop"></a><span class="name">styleSheet</span> : <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>This property holds the application style sheet.</p>
<p>By default, this property returns an empty string unless the user specifies the <tt>-stylesheet</tt> option on the command line when running the application.</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"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>styleSheet</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setStyleSheet</b></span> ( const QString &amp; <i>sheet</i> )</td></tr>
</table>
<p><b>See also </b><a href="qwidget.html#setStyle">QWidget::setStyle</a>() and <a href="stylesheet.html">Qt Style Sheets</a>.</p>
<!-- @@@styleSheet -->
<!-- $$$wheelScrollLines-prop$$$wheelScrollLines$$$setWheelScrollLinesint -->
<h3 class="fn"><a name="wheelScrollLines-prop"></a><span class="name">wheelScrollLines</span> : <span class="type">int</span></h3>
<p>This property holds the number of lines to scroll a widget, when the mouse wheel is rotated.</p>
<p>If the value exceeds the widget's number of visible lines, the widget should interpret the scroll operation as a single <i>page up</i> or <i>page down</i>. If the widget is an <a href="qabstractitemview.html">item view class</a>, then the result of scrolling one <i>line</i> depends on the setting of the widget's <a href="qabstractitemview.html#verticalScrollMode-prop">scroll mode</a>. Scroll one <i>line</i> can mean <a href="qabstractitemview.html#ScrollMode-enum">scroll one item</a> or <a href="qabstractitemview.html#ScrollMode-enum">scroll one pixel</a>.</p>
<p>By default, this property has a value of 3.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>wheelScrollLines</b></span> ()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setWheelScrollLines</b></span> ( int )</td></tr>
</table>
<!-- @@@wheelScrollLines -->
<!-- $$$windowIcon-prop$$$windowIcon$$$setWindowIconconstQIcon& -->
<h3 class="fn"><a name="windowIcon-prop"></a><span class="name">windowIcon</span> : <span class="type"><a href="qicon.html">QIcon</a></span></h3>
<p>This property holds the default window icon.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QIcon </td><td class="memItemRight bottomAlign"><span class="name"><b>windowIcon</b></span> ()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setWindowIcon</b></span> ( const QIcon &amp; <i>icon</i> )</td></tr>
</table>
<p><b>See also </b><a href="qwidget.html#windowIcon-prop">QWidget::setWindowIcon</a>() and <a href="appicon.html">Setting the Application Icon</a>.</p>
<!-- @@@windowIcon -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QApplication[overload1]$$$QApplicationint&char** -->
<h3 class="fn"><a name="QApplication"></a>QApplication::<span class="name">QApplication</span> ( <span class="type">int</span> &amp; <i>argc</i>, <span class="type">char</span> ** <i>argv</i> )</h3>
<p>Initializes the window system and constructs an application object with <i>argc</i> command line arguments in <i>argv</i>.</p>
<p><b>Warning:</b> The data referred to by <i>argc</i> and <i>argv</i> must stay valid for the entire lifetime of the <a href="qapplication.html">QApplication</a> object. In addition, <i>argc</i> must be greater than zero and <i>argv</i> must contain at least one valid character string.</p>
<p>The global <tt>qApp</tt> pointer refers to this application object. Only one application object should be created.</p>
<p>This application object must be constructed before any <a href="qpaintdevice.html">paint devices</a> (including widgets, pixmaps, bitmaps etc.)&#x2e;</p>
<p><b>Note:</b> <i>argc</i> and <i>argv</i> might be changed as Qt removes command line arguments that it recognizes.</p>
<p>Qt debugging options (not available if Qt was compiled without the QT_DEBUG flag defined):</p>
<ul>
<li>-nograb, tells Qt that it must never grab the mouse or the keyboard.</li>
<li>-dograb (only under X11), running under a debugger can cause an implicit -nograb, use -dograb to override.</li>
<li>-sync (only under X11), switches to synchronous mode for debugging.</li>
</ul>
<p>See <a href="debug.html">Debugging Techniques</a> for a more detailed explanation.</p>
<p>All Qt programs automatically support the following command line options:</p>
<ul>
<li>-style= <i>style</i>, sets the application GUI style. Possible values are <tt>motif</tt>, <tt>windows</tt>, and <tt>platinum</tt>. If you compiled Qt with additional styles or have additional styles as plugins these will be available to the <tt>-style</tt> command line option.</li>
<li>-style <i>style</i>, is the same as listed above.</li>
<li>-stylesheet= <i>stylesheet</i>, sets the application <a href="qapplication.html#styleSheet-prop">styleSheet</a>. The value must be a path to a file that contains the Style Sheet. <b>Note:</b> Relative URLs in the Style Sheet file are relative to the Style Sheet file's path.</li>
<li>-stylesheet <i>stylesheet</i>, is the same as listed above.</li>
<li>-session= <i>session</i>, restores the application from an earlier <a href="session.html">session</a>.</li>
<li>-session <i>session</i>, is the same as listed above.</li>
<li>-widgetcount, prints debug message at the end about number of widgets left undestroyed and maximum number of widgets existed at the same time</li>
<li>-reverse, sets the application's layout direction to <a href="qt.html#LayoutDirection-enum">Qt::RightToLeft</a></li>
<li>-graphicssystem, sets the backend to be used for on-screen widgets and QPixmaps. Available options are <tt>raster</tt> and <tt>opengl</tt>.</li>
<li>-qmljsdebugger=, activates the QML/JS debugger with a specified port. The value must be of format port:1234[,block], where block is optional and will make the application wait until a debugger connects to it.</li>
</ul>
<p>The X11 version of Qt supports some traditional X11 command line options:</p>
<ul>
<li>-display <i>display</i>, sets the X display (default is $DISPLAY).</li>
<li>-geometry <i>geometry</i>, sets the client geometry of the first window that is shown.</li>
<li>-fn or <tt>-font</tt> <i>font</i>, defines the application font. The font should be specified using an X logical font description. Note that this option is ignored when Qt is built with fontconfig support enabled.</li>
<li>-bg or <tt>-background</tt> <i>color</i>, sets the default background color and an application palette (light and dark shades are calculated).</li>
<li>-fg or <tt>-foreground</tt> <i>color</i>, sets the default foreground color.</li>
<li>-btn or <tt>-button</tt> <i>color</i>, sets the default button color.</li>
<li>-name <i>name</i>, sets the application name.</li>
<li>-title <i>title</i>, sets the application title.</li>
<li>-visual <tt>TrueColor</tt>, forces the application to use a TrueColor visual on an 8-bit display.</li>
<li>-ncols <i>count</i>, limits the number of colors allocated in the color cube on an 8-bit display, if the application is using the <a href="qapplication.html#ColorSpec-enum">QApplication::ManyColor</a> color specification. If <i>count</i> is 216 then a 6x6x6 color cube is used (i.e&#x2e; 6 levels of red, 6 of green, and 6 of blue); for other values, a cube approximately proportional to a 2x3x1 cube is used.</li>
<li>-cmap, causes the application to install a private color map on an 8-bit display.</li>
<li>-im, sets the input method server (equivalent to setting the XMODIFIERS environment variable)</li>
<li>-inputstyle, defines how the input is inserted into the given widget, e.g&#x2e;, <tt>onTheSpot</tt> makes the input appear directly in the widget, while <tt>overTheSpot</tt> makes the input appear in a box floating over the widget and is not inserted until the editing is done.</li>
</ul>
<a name="x11-notes"></a>
<h4>X11 Notes</h4>
<p>If <a href="qapplication.html">QApplication</a> fails to open the X11 display, it will terminate the process. This behavior is consistent with most X11 applications.</p>
<p><b>See also </b><a href="qcoreapplication.html#arguments">arguments</a>().</p>
<!-- @@@QApplication -->
<!-- $$$QApplication$$$QApplicationint&char**bool -->
<h3 class="fn"><a name="QApplication-2"></a>QApplication::<span class="name">QApplication</span> ( <span class="type">int</span> &amp; <i>argc</i>, <span class="type">char</span> ** <i>argv</i>, <span class="type">bool</span> <i>GUIenabled</i> )</h3>
<p>Constructs an application object with <i>argc</i> command line arguments in <i>argv</i>. If <i>GUIenabled</i> is true, a GUI application is constructed, otherwise a non-GUI (console) application is created.</p>
<p><b>Warning:</b> The data referred to by <i>argc</i> and <i>argv</i> must stay valid for the entire lifetime of the <a href="qapplication.html">QApplication</a> object. In addition, <i>argc</i> must be greater than zero and <i>argv</i> must contain at least one valid character string.</p>
<p>Set <i>GUIenabled</i> to false for programs without a graphical user interface that should be able to run without a window system.</p>
<p>On X11, the window system is initialized if <i>GUIenabled</i> is true. If <i>GUIenabled</i> is false, the application does not connect to the X server. On Windows and Mac OS, currently the window system is always initialized, regardless of the value of GUIenabled. This may change in future versions of Qt.</p>
<p>The following example shows how to create an application that uses a graphical interface when available.</p>
<pre class="cpp"> <span class="type">int</span> main(<span class="type">int</span> argc<span class="operator">,</span> <span class="type">char</span> <span class="operator">*</span><span class="operator">*</span>argv)
 {
 <span class="preprocessor">#ifdef Q_WS_X11</span>
     <span class="type">bool</span> useGUI <span class="operator">=</span> getenv(<span class="string">&quot;DISPLAY&quot;</span>) <span class="operator">!</span><span class="operator">=</span> <span class="number">0</span>;
 <span class="preprocessor">#else</span>
     <span class="type">bool</span> useGUI <span class="operator">=</span> <span class="keyword">true</span>;
 <span class="preprocessor">#endif</span>
     <span class="type"><a href="qapplication.html">QApplication</a></span> app(argc<span class="operator">,</span> argv<span class="operator">,</span> useGUI);

     <span class="keyword">if</span> (useGUI) {
        <span class="comment">// start GUI version</span>
        <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     } <span class="keyword">else</span> {
        <span class="comment">// start non-GUI version</span>
        <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     }
     <span class="keyword">return</span> app<span class="operator">.</span>exec();
 }</pre>
<!-- @@@QApplication -->
<!-- $$$QApplication$$$QApplicationint&char**Type -->
<h3 class="fn"><a name="QApplication-3"></a>QApplication::<span class="name">QApplication</span> ( <span class="type">int</span> &amp; <i>argc</i>, <span class="type">char</span> ** <i>argv</i>, <span class="type"><a href="qapplication.html#Type-enum">Type</a></span> <i>type</i> )</h3>
<p>Constructs an application object with <i>argc</i> command line arguments in <i>argv</i>.</p>
<p><b>Warning:</b> The data referred to by <i>argc</i> and <i>argv</i> must stay valid for the entire lifetime of the <a href="qapplication.html">QApplication</a> object. In addition, <i>argc</i> must be greater than zero and <i>argv</i> must contain at least one valid character string.</p>
<p>With Qt for Embedded Linux, passing <a href="qapplication.html#Type-enum">QApplication::GuiServer</a> for <i>type</i> makes this application the server (equivalent to running with the <tt>-qws</tt> option).</p>
<!-- @@@QApplication -->
<!-- $$$QApplication$$$QApplicationDisplay*Qt::HANDLEQt::HANDLE -->
<h3 class="fn"><a name="QApplication-4"></a>QApplication::<span class="name">QApplication</span> ( <span class="type">Display</span> * <i>display</i>, <span class="type"><a href="qt.html#HANDLE-typedef">Qt::HANDLE</a></span> <i>visual</i> = 0, <span class="type"><a href="qt.html#HANDLE-typedef">Qt::HANDLE</a></span> <i>colormap</i> = 0 )</h3>
<p>Creates an application, given an already open display <i>display</i>. If <i>visual</i> and <i>colormap</i> are non-zero, the application will use those values as the default Visual and Colormap contexts.</p>
<p><b>Warning:</b> Qt only supports TrueColor visuals at depths higher than 8 bits-per-pixel.</p>
<p>This function is only available on X11.</p>
<!-- @@@QApplication -->
<!-- $$$QApplication$$$QApplicationDisplay*int&char**Qt::HANDLEQt::HANDLE -->
<h3 class="fn"><a name="QApplication-5"></a>QApplication::<span class="name">QApplication</span> ( <span class="type">Display</span> * <i>display</i>, <span class="type">int</span> &amp; <i>argc</i>, <span class="type">char</span> ** <i>argv</i>, <span class="type"><a href="qt.html#HANDLE-typedef">Qt::HANDLE</a></span> <i>visual</i> = 0, <span class="type"><a href="qt.html#HANDLE-typedef">Qt::HANDLE</a></span> <i>colormap</i> = 0 )</h3>
<p>Creates an application, given an already open <i>display</i> and using <i>argc</i> command line arguments in <i>argv</i>. If <i>visual</i> and <i>colormap</i> are non-zero, the application will use those values as the default Visual and Colormap contexts.</p>
<p><b>Warning:</b> Qt only supports TrueColor visuals at depths higher than 8 bits-per-pixel.</p>
<p>This function is only available on X11.</p>
<!-- @@@QApplication -->
<!-- $$$QApplication$$$QApplicationQApplication::QS60MainApplicationFactoryint&char** -->
<h3 class="fn"><a name="QApplication-6"></a>QApplication::<span class="name">QApplication</span> ( <span class="type"><a href="qapplication.html#QS60MainApplicationFactory-typedef">QApplication::QS60MainApplicationFactory</a></span> <i>factory</i>, <span class="type">int</span> &amp; <i>argc</i>, <span class="type">char</span> ** <i>argv</i> )</h3>
<p>Creates an application using the application factory given in <i>factory</i>, and using <i>argc</i> command line arguments in <i>argv</i>. <i>factory</i> can be leaving, but the error will be converted to a standard exception.</p>
<p>This function is only available on S60.</p>
<p>This function was introduced in Qt 4.6.</p>
<!-- @@@QApplication -->
<!-- $$$~QApplication[overload1]$$$~QApplication -->
<h3 class="fn"><a name="dtor.QApplication"></a>QApplication::<span class="name">~QApplication</span> ()<tt> [virtual]</tt></h3>
<p>Cleans up any window system resources that were allocated by this application. Sets the global variable <tt>qApp</tt> to 0.</p>
<!-- @@@~QApplication -->
<!-- $$$aboutQt[overload1]$$$aboutQt -->
<h3 class="fn"><a name="aboutQt"></a><span class="type">void</span> QApplication::<span class="name">aboutQt</span> ()<tt> [static slot]</tt></h3>
<p>Displays a simple message box about Qt. The message includes the version number of Qt being used by the application.</p>
<p>This is useful for inclusion in the <b>Help</b> menu of an application, as shown in the <a href="mainwindows-menus.html">Menus</a> example.</p>
<p>This function is a convenience slot for <a href="qmessagebox.html#aboutQt">QMessageBox::aboutQt</a>().</p>
<!-- @@@aboutQt -->
<!-- $$$aboutToReleaseGpuResources[overload1]$$$aboutToReleaseGpuResources -->
<h3 class="fn"><a name="aboutToReleaseGpuResources"></a><span class="type">void</span> QApplication::<span class="name">aboutToReleaseGpuResources</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when application is about to release all GPU resources associated to contexts owned by application.</p>
<p>The signal is particularly useful if your application has allocated GPU resources directly apart from Qt and needs to do some last-second cleanup.</p>
<p><b>Warning:</b> This signal is only emitted on Symbian.</p>
<p>This function was introduced in Qt 4.7&#x2e;4.</p>
<p><b>See also </b><a href="qapplication.html#aboutToUseGpuResources">aboutToUseGpuResources</a>().</p>
<!-- @@@aboutToReleaseGpuResources -->
<!-- $$$aboutToUseGpuResources[overload1]$$$aboutToUseGpuResources -->
<h3 class="fn"><a name="aboutToUseGpuResources"></a><span class="type">void</span> QApplication::<span class="name">aboutToUseGpuResources</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when application is about to use GPU resources.</p>
<p>The signal is particularly useful if your application needs to know when GPU resources are be available.</p>
<p><b>Warning:</b> This signal is only emitted on Symbian.</p>
<p>This function was introduced in Qt 4.7&#x2e;4.</p>
<p><b>See also </b><a href="qapplication.html#aboutToReleaseGpuResources">aboutToReleaseGpuResources</a>().</p>
<!-- @@@aboutToUseGpuResources -->
<!-- $$$activeModalWidget[overload1]$$$activeModalWidget -->
<h3 class="fn"><a name="activeModalWidget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QApplication::<span class="name">activeModalWidget</span> ()<tt> [static]</tt></h3>
<p>Returns the active modal widget.</p>
<p>A modal widget is a special top-level widget which is a subclass of <a href="qdialog.html">QDialog</a> that specifies the modal parameter of the constructor as true. A modal widget must be closed before the user can continue with other parts of the program.</p>
<p>Modal widgets are organized in a stack. This function returns the active modal widget at the top of the stack.</p>
<p><b>See also </b><a href="qapplication.html#activePopupWidget">activePopupWidget</a>() and <a href="qapplication.html#topLevelWidgets">topLevelWidgets</a>().</p>
<!-- @@@activeModalWidget -->
<!-- $$$activePopupWidget[overload1]$$$activePopupWidget -->
<h3 class="fn"><a name="activePopupWidget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QApplication::<span class="name">activePopupWidget</span> ()<tt> [static]</tt></h3>
<p>Returns the active popup widget.</p>
<p>A popup widget is a special top-level widget that sets the <tt>Qt::WType_Popup</tt> widget flag, e.g&#x2e; the <a href="qmenu.html">QMenu</a> widget. When the application opens a popup widget, all events are sent to the popup. Normal widgets and modal widgets cannot be accessed before the popup widget is closed.</p>
<p>Only other popup widgets may be opened when a popup widget is shown. The popup widgets are organized in a stack. This function returns the active popup widget at the top of the stack.</p>
<p><b>See also </b><a href="qapplication.html#activeModalWidget">activeModalWidget</a>() and <a href="qapplication.html#topLevelWidgets">topLevelWidgets</a>().</p>
<!-- @@@activePopupWidget -->
<!-- $$$activeWindow[overload1]$$$activeWindow -->
<h3 class="fn"><a name="activeWindow"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QApplication::<span class="name">activeWindow</span> ()<tt> [static]</tt></h3>
<p>Returns the application top-level window that has the keyboard input focus, or 0 if no application window has the focus. There might be an activeWindow() even if there is no <a href="qapplication.html#focusWidget">focusWidget</a>(), for example if no widget in that window accepts key events.</p>
<p><b>See also </b><a href="qapplication.html#setActiveWindow">setActiveWindow</a>(), <a href="qwidget.html#setFocus">QWidget::setFocus</a>(), <a href="qwidget.html#focus-prop">QWidget::hasFocus</a>(), and <a href="qapplication.html#focusWidget">focusWidget</a>().</p>
<!-- @@@activeWindow -->
<!-- $$$alert[overload1]$$$alertQWidget*int -->
<h3 class="fn"><a name="alert"></a><span class="type">void</span> QApplication::<span class="name">alert</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, <span class="type">int</span> <i>msec</i> = 0 )<tt> [static]</tt></h3>
<p>Causes an alert to be shown for <i>widget</i> if the window is not the active window. The alert is shown for <i>msec</i> miliseconds. If <i>msec</i> is zero (the default), then the alert is shown indefinitely until the window becomes active again.</p>
<p>Currently this function does nothing on Qt for Embedded Linux.</p>
<p>On Mac OS X, this works more at the application level and will cause the application icon to bounce in the dock.</p>
<p>On Windows, this causes the window's taskbar entry to flash for a time. If <i>msec</i> is zero, the flashing will stop and the taskbar entry will turn a different color (currently orange).</p>
<p>On X11, this will cause the window to be marked as &quot;demands attention&quot;, the window must not be hidden (i.e&#x2e; not have hide() called on it, but be visible in some sort of way) in order for this to work.</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@alert -->
<!-- $$$allWidgets[overload1]$$$allWidgets -->
<h3 class="fn"><a name="allWidgets"></a><span class="type"><a href="qwidget.html#QWidgetList-typedef">QWidgetList</a></span> QApplication::<span class="name">allWidgets</span> ()<tt> [static]</tt></h3>
<p>Returns a list of all the widgets in the application.</p>
<p>The list is empty (<a href="qlist.html#isEmpty">QList::isEmpty</a>()) if there are no widgets.</p>
<p><b>Note:</b> Some of the widgets may be hidden.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type">void</span> updateAllWidgets()
 {
     foreach (<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>widget<span class="operator">,</span> <span class="type"><a href="qapplication.html">QApplication</a></span><span class="operator">::</span>allWidgets())
         widget<span class="operator">-</span><span class="operator">&gt;</span>update();
 }</pre>
<p><b>See also </b><a href="qapplication.html#topLevelWidgets">topLevelWidgets</a>() and <a href="qwidget.html#visible-prop">QWidget::isVisible</a>().</p>
<!-- @@@allWidgets -->
<!-- $$$beep[overload1]$$$beep -->
<h3 class="fn"><a name="beep"></a><span class="type">void</span> QApplication::<span class="name">beep</span> ()<tt> [static]</tt></h3>
<p>Sounds the bell, using the default volume and sound. The function is <i>not</i> available in Qt for Embedded Linux.</p>
<!-- @@@beep -->
<!-- $$$changeOverrideCursor[overload1]$$$changeOverrideCursorconstQCursor& -->
<h3 class="fn"><a name="changeOverrideCursor"></a><span class="type">void</span> QApplication::<span class="name">changeOverrideCursor</span> ( const <span class="type"><a href="qcursor.html">QCursor</a></span> &amp; <i>cursor</i> )<tt> [static]</tt></h3>
<p>Changes the currently active application override cursor to <i>cursor</i>.</p>
<p>This function has no effect if <a href="qapplication.html#setOverrideCursor">setOverrideCursor</a>() was not called.</p>
<p><b>See also </b><a href="qapplication.html#setOverrideCursor">setOverrideCursor</a>(), <a href="qapplication.html#overrideCursor">overrideCursor</a>(), <a href="qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>(), and <a href="qwidget.html#cursor-prop">QWidget::setCursor</a>().</p>
<!-- @@@changeOverrideCursor -->
<!-- $$$clipboard[overload1]$$$clipboard -->
<h3 class="fn"><a name="clipboard"></a><span class="type"><a href="qclipboard.html">QClipboard</a></span> * QApplication::<span class="name">clipboard</span> ()<tt> [static]</tt></h3>
<p>Returns a pointer to the application global clipboard.</p>
<p><b>Note:</b> The <a href="qapplication.html">QApplication</a> object should already be constructed before accessing the clipboard.</p>
<!-- @@@clipboard -->
<!-- $$$closeAllWindows[overload1]$$$closeAllWindows -->
<h3 class="fn"><a name="closeAllWindows"></a><span class="type">void</span> QApplication::<span class="name">closeAllWindows</span> ()<tt> [static slot]</tt></h3>
<p>Closes all top-level windows.</p>
<p>This function is particularly useful for applications with many top-level windows. It could, for example, be connected to a <b>Exit</b> entry in the <b>File</b> menu:</p>
<pre class="cpp">     exitAct <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qaction.html">QAction</a></span>(tr(<span class="string">&quot;E&amp;xit&quot;</span>)<span class="operator">,</span> <span class="keyword">this</span>);
     exitAct<span class="operator">-</span><span class="operator">&gt;</span>setShortcuts(<span class="type"><a href="qkeysequence.html">QKeySequence</a></span><span class="operator">::</span>Quit);
     exitAct<span class="operator">-</span><span class="operator">&gt;</span>setStatusTip(tr(<span class="string">&quot;Exit the application&quot;</span>));
     connect(exitAct<span class="operator">,</span> SIGNAL(triggered())<span class="operator">,</span> qApp<span class="operator">,</span> SLOT(closeAllWindows()));</pre>
<p>The windows are closed in random order, until one window does not accept the close event. The application quits when the last window was successfully closed; this can be turned off by setting <a href="qapplication.html#quitOnLastWindowClosed-prop">quitOnLastWindowClosed</a> to false.</p>
<p><b>See also </b><a href="qapplication.html#quitOnLastWindowClosed-prop">quitOnLastWindowClosed</a>, <a href="qapplication.html#lastWindowClosed">lastWindowClosed</a>(), <a href="qwidget.html#close">QWidget::close</a>(), <a href="qwidget.html#closeEvent">QWidget::closeEvent</a>(), <a href="qapplication.html#lastWindowClosed">lastWindowClosed</a>(), <a href="qcoreapplication.html#quit">quit</a>(), <a href="qapplication.html#topLevelWidgets">topLevelWidgets</a>(), and <a href="qwidget.html#isWindow">QWidget::isWindow</a>().</p>
<!-- @@@closeAllWindows -->
<!-- $$$colorSpec[overload1]$$$colorSpec -->
<h3 class="fn"><a name="colorSpec"></a><span class="type">int</span> QApplication::<span class="name">colorSpec</span> ()<tt> [static]</tt></h3>
<p>Returns the color specification.</p>
<p><b>See also </b><a href="qapplication.html#setColorSpec">QApplication::setColorSpec</a>().</p>
<!-- @@@colorSpec -->
<!-- $$$commitData[overload1]$$$commitDataQSessionManager& -->
<h3 class="fn"><a name="commitData"></a><span class="type">void</span> QApplication::<span class="name">commitData</span> ( <span class="type"><a href="qsessionmanager.html">QSessionManager</a></span> &amp; <i>manager</i> )<tt> [virtual]</tt></h3>
<p>This function deals with <a href="session.html">session management</a>. It is invoked when the <a href="qsessionmanager.html">QSessionManager</a> wants the application to commit all its data.</p>
<p>Usually this means saving all open files, after getting permission from the user. Furthermore you may want to provide a means by which the user can cancel the shutdown.</p>
<p>You should not exit the application within this function. Instead, the session manager may or may not do this afterwards, depending on the context.</p>
<p><b>Warning:</b> Within this function, no user interaction is possible, <i>unless</i> you ask the <i>manager</i> for explicit permission. See <a href="qsessionmanager.html#allowsInteraction">QSessionManager::allowsInteraction</a>() and <a href="qsessionmanager.html#allowsErrorInteraction">QSessionManager::allowsErrorInteraction</a>() for details and example usage.</p>
<p>The default implementation requests interaction and sends a close event to all visible top-level widgets. If any event was rejected, the shutdown is canceled.</p>
<p><b>See also </b><a href="qapplication.html#isSessionRestored">isSessionRestored</a>(), <a href="qapplication.html#sessionId">sessionId</a>(), <a href="qapplication.html#saveState">saveState</a>(), and <a href="session.html">Session Management</a>.</p>
<!-- @@@commitData -->
<!-- $$$commitDataRequest[overload1]$$$commitDataRequestQSessionManager& -->
<h3 class="fn"><a name="commitDataRequest"></a><span class="type">void</span> QApplication::<span class="name">commitDataRequest</span> ( <span class="type"><a href="qsessionmanager.html">QSessionManager</a></span> &amp; <i>manager</i> )<tt> [signal]</tt></h3>
<p>This signal deals with <a href="session.html">session management</a>. It is emitted when the <a href="qsessionmanager.html">QSessionManager</a> wants the application to commit all its data.</p>
<p>Usually this means saving all open files, after getting permission from the user. Furthermore you may want to provide a means by which the user can cancel the shutdown.</p>
<p>You should not exit the application within this signal. Instead, the session manager may or may not do this afterwards, depending on the context.</p>
<p><b>Warning:</b> Within this signal, no user interaction is possible, <i>unless</i> you ask the <i>manager</i> for explicit permission. See <a href="qsessionmanager.html#allowsInteraction">QSessionManager::allowsInteraction</a>() and <a href="qsessionmanager.html#allowsErrorInteraction">QSessionManager::allowsErrorInteraction</a>() for details and example usage.</p>
<p><b>Note:</b> You should use <a href="qt.html#ConnectionType-enum">Qt::DirectConnection</a> when connecting to this signal.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qapplication.html#isSessionRestored">isSessionRestored</a>(), <a href="qapplication.html#sessionId">sessionId</a>(), <a href="qapplication.html#saveState">saveState</a>(), and <a href="session.html">Session Management</a>.</p>
<!-- @@@commitDataRequest -->
<!-- $$$desktop[overload1]$$$desktop -->
<h3 class="fn"><a name="desktop"></a><span class="type"><a href="qdesktopwidget.html">QDesktopWidget</a></span> * QApplication::<span class="name">desktop</span> ()<tt> [static]</tt></h3>
<p>Returns the desktop widget (also called the root window).</p>
<p>The desktop may be composed of multiple screens, so it would be incorrect, for example, to attempt to <i>center</i> some widget in the desktop's geometry. <a href="qdesktopwidget.html">QDesktopWidget</a> has various functions for obtaining useful geometries upon the desktop, such as <a href="qdesktopwidget.html#screenGeometry">QDesktopWidget::screenGeometry</a>() and <a href="qdesktopwidget.html#availableGeometry">QDesktopWidget::availableGeometry</a>().</p>
<p>On X11, it is also possible to draw on the desktop.</p>
<!-- @@@desktop -->
<!-- $$$desktopSettingsAware[overload1]$$$desktopSettingsAware -->
<h3 class="fn"><a name="desktopSettingsAware"></a><span class="type">bool</span> QApplication::<span class="name">desktopSettingsAware</span> ()<tt> [static]</tt></h3>
<p>Returns true if Qt is set to use the system's standard colors, fonts, etc.; otherwise returns false. The default is true.</p>
<p><b>See also </b><a href="qapplication.html#setDesktopSettingsAware">setDesktopSettingsAware</a>().</p>
<!-- @@@desktopSettingsAware -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn"><a name="event"></a><span class="type">bool</span> QApplication::<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 -->
<!-- $$$exec[overload1]$$$exec -->
<h3 class="fn"><a name="exec"></a><span class="type">int</span> QApplication::<span class="name">exec</span> ()<tt> [static]</tt></h3>
<p>Enters the main event loop and waits until <a href="qcoreapplication.html#exit">exit</a>() is called, then returns the value that was set to <a href="qcoreapplication.html#exit">exit</a>() (which is 0 if <a href="qcoreapplication.html#exit">exit</a>() is called via <a href="qcoreapplication.html#quit">quit</a>()).</p>
<p>It is necessary to call this function to start event handling. The main event loop receives events from the window system and dispatches these to the application widgets.</p>
<p>Generally, no user interaction can take place before calling exec(). As a special case, modal widgets like <a href="qmessagebox.html">QMessageBox</a> can be used before calling exec(), because modal widgets call exec() to start a local event loop.</p>
<p>To make your application perform idle processing, i.e&#x2e;, executing a special function whenever there are no pending events, use a <a href="qtimer.html">QTimer</a> with 0 timeout. More advanced idle processing schemes can be achieved using <a href="qcoreapplication.html#processEvents">processEvents</a>().</p>
<p>We recommend that you connect clean-up code to the <a href="qcoreapplication.html#aboutToQuit">aboutToQuit()</a> signal, instead of putting it in your application's <tt>main()</tt> function. This is because, on some platforms the QApplication::exec() call may not return. For example, on the Windows platform, when the user logs off, the system terminates the process after Qt closes all top-level windows. Hence, there is <i>no guarantee</i> that the application will have time to exit its event loop and execute code at the end of the <tt>main()</tt> function, after the QApplication::exec() call.</p>
<p><b>See also </b><a href="qapplication.html#quitOnLastWindowClosed-prop">quitOnLastWindowClosed</a>, <a href="qcoreapplication.html#quit">quit</a>(), <a href="qcoreapplication.html#exit">exit</a>(), <a href="qcoreapplication.html#processEvents">processEvents</a>(), and <a href="qcoreapplication.html#exec">QCoreApplication::exec</a>().</p>
<!-- @@@exec -->
<!-- $$$focusChanged[overload1]$$$focusChangedQWidget*QWidget* -->
<h3 class="fn"><a name="focusChanged"></a><span class="type">void</span> QApplication::<span class="name">focusChanged</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>old</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>now</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the widget that has keyboard focus changed from <i>old</i> to <i>now</i>, i.e&#x2e;, because the user pressed the tab-key, clicked into a widget or changed the active window. Both <i>old</i> and <i>now</i> can be the null-pointer.</p>
<p>The signal is emitted after both widget have been notified about the change through <a href="qfocusevent.html">QFocusEvent</a>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also </b><a href="qwidget.html#setFocus">QWidget::setFocus</a>(), <a href="qwidget.html#clearFocus">QWidget::clearFocus</a>(), and <a href="qt.html#FocusReason-enum">Qt::FocusReason</a>.</p>
<!-- @@@focusChanged -->
<!-- $$$focusWidget[overload1]$$$focusWidget -->
<h3 class="fn"><a name="focusWidget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QApplication::<span class="name">focusWidget</span> ()<tt> [static]</tt></h3>
<p>Returns the application widget that has the keyboard input focus, or 0 if no widget in this application has the focus.</p>
<p><b>See also </b><a href="qwidget.html#setFocus">QWidget::setFocus</a>(), <a href="qwidget.html#focus-prop">QWidget::hasFocus</a>(), <a href="qapplication.html#activeWindow">activeWindow</a>(), and <a href="qapplication.html#focusChanged">focusChanged</a>().</p>
<!-- @@@focusWidget -->
<!-- $$$font[overload1]$$$font -->
<h3 class="fn"><a name="font"></a><span class="type"><a href="qfont.html">QFont</a></span> QApplication::<span class="name">font</span> ()<tt> [static]</tt></h3>
<p>Returns the default application font.</p>
<p><b>See also </b><a href="qapplication.html#setFont">setFont</a>(), <a href="qapplication.html#fontMetrics">fontMetrics</a>(), and <a href="qwidget.html#font-prop">QWidget::font</a>().</p>
<!-- @@@font -->
<!-- $$$font$$$fontconstQWidget* -->
<h3 class="fn"><a name="font-2"></a><span class="type"><a href="qfont.html">QFont</a></span> QApplication::<span class="name">font</span> ( const <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Returns the default font for the <i>widget</i>.</p>
<p><b>See also </b><a href="qapplication.html#fontMetrics">fontMetrics</a>() and <a href="qwidget.html#font-prop">QWidget::setFont</a>().</p>
<!-- @@@font -->
<!-- $$$font$$$fontconstchar* -->
<h3 class="fn"><a name="font-3"></a><span class="type"><a href="qfont.html">QFont</a></span> QApplication::<span class="name">font</span> ( const <span class="type">char</span> * <i>className</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Returns the font for widgets of the given <i>className</i>.</p>
<p><b>See also </b><a href="qapplication.html#setFont">setFont</a>() and <a href="qwidget.html#font-prop">QWidget::font</a>().</p>
<!-- @@@font -->
<!-- $$$fontDatabaseChanged[overload1]$$$fontDatabaseChanged -->
<h3 class="fn"><a name="fontDatabaseChanged"></a><span class="type">void</span> QApplication::<span class="name">fontDatabaseChanged</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when application fonts are loaded or removed.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qfontdatabase.html#addApplicationFont">QFontDatabase::addApplicationFont</a>(), <a href="qfontdatabase.html#addApplicationFontFromData">QFontDatabase::addApplicationFontFromData</a>(), <a href="qfontdatabase.html#removeAllApplicationFonts">QFontDatabase::removeAllApplicationFonts</a>(), and <a href="qfontdatabase.html#removeApplicationFont">QFontDatabase::removeApplicationFont</a>().</p>
<!-- @@@fontDatabaseChanged -->
<!-- $$$fontMetrics[overload1]$$$fontMetrics -->
<h3 class="fn"><a name="fontMetrics"></a><span class="type"><a href="qfontmetrics.html">QFontMetrics</a></span> QApplication::<span class="name">fontMetrics</span> ()<tt> [static]</tt></h3>
<p>Returns display (screen) font metrics for the application font.</p>
<p><b>See also </b><a href="qapplication.html#font">font</a>(), <a href="qapplication.html#setFont">setFont</a>(), <a href="qwidget.html#fontMetrics">QWidget::fontMetrics</a>(), and <a href="qpainter.html#fontMetrics">QPainter::fontMetrics</a>().</p>
<!-- @@@fontMetrics -->
<!-- $$$inputContext[overload1]$$$inputContext -->
<h3 class="fn"><a name="inputContext"></a><span class="type"><a href="qinputcontext.html">QInputContext</a></span> * QApplication::<span class="name">inputContext</span> () const</h3>
<p>Returns the <a href="qinputcontext.html">QInputContext</a> instance used by the application.</p>
<p><b>See also </b><a href="qapplication.html#setInputContext">setInputContext</a>().</p>
<!-- @@@inputContext -->
<!-- $$$isEffectEnabled[overload1]$$$isEffectEnabledQt::UIEffect -->
<h3 class="fn"><a name="isEffectEnabled"></a><span class="type">bool</span> QApplication::<span class="name">isEffectEnabled</span> ( <span class="type"><a href="qt.html#UIEffect-enum">Qt::UIEffect</a></span> <i>effect</i> )<tt> [static]</tt></h3>
<p>Returns true if <i>effect</i> is enabled; otherwise returns false.</p>
<p>By default, Qt will try to use the desktop settings. To prevent this, call setDesktopSettingsAware(false).</p>
<p><b>Note:</b> All effects are disabled on screens running at less than 16-bit color depth.</p>
<p><b>See also </b><a href="qapplication.html#setEffectEnabled">setEffectEnabled</a>() and <a href="qt.html#UIEffect-enum">Qt::UIEffect</a>.</p>
<!-- @@@isEffectEnabled -->
<!-- $$$isLeftToRight[overload1]$$$isLeftToRight -->
<h3 class="fn"><a name="isLeftToRight"></a><span class="type">bool</span> QApplication::<span class="name">isLeftToRight</span> ()<tt> [static]</tt></h3>
<p>Returns true if the application's layout direction is <a href="qt.html#LayoutDirection-enum">Qt::LeftToRight</a>; otherwise returns false.</p>
<p><b>See also </b><a href="qapplication.html#layoutDirection-prop">layoutDirection</a>() and <a href="qapplication.html#isRightToLeft">isRightToLeft</a>().</p>
<!-- @@@isLeftToRight -->
<!-- $$$isRightToLeft[overload1]$$$isRightToLeft -->
<h3 class="fn"><a name="isRightToLeft"></a><span class="type">bool</span> QApplication::<span class="name">isRightToLeft</span> ()<tt> [static]</tt></h3>
<p>Returns true if the application's layout direction is <a href="qt.html#LayoutDirection-enum">Qt::RightToLeft</a>; otherwise returns false.</p>
<p><b>See also </b><a href="qapplication.html#layoutDirection-prop">layoutDirection</a>() and <a href="qapplication.html#isLeftToRight">isLeftToRight</a>().</p>
<!-- @@@isRightToLeft -->
<!-- $$$isSessionRestored[overload1]$$$isSessionRestored -->
<h3 class="fn"><a name="isSessionRestored"></a><span class="type">bool</span> QApplication::<span class="name">isSessionRestored</span> () const</h3>
<p>Returns true if the application has been restored from an earlier <a href="session.html">session</a>; otherwise returns false.</p>
<p><b>See also </b><a href="qapplication.html#sessionId">sessionId</a>(), <a href="qapplication.html#commitData">commitData</a>(), and <a href="qapplication.html#saveState">saveState</a>().</p>
<!-- @@@isSessionRestored -->
<!-- $$$keyboardInputDirection[overload1]$$$keyboardInputDirection -->
<h3 class="fn"><a name="keyboardInputDirection"></a><span class="type"><a href="qt.html#LayoutDirection-enum">Qt::LayoutDirection</a></span> QApplication::<span class="name">keyboardInputDirection</span> ()<tt> [static]</tt></h3>
<p>Returns the current keyboard input direction.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@keyboardInputDirection -->
<!-- $$$keyboardInputLocale[overload1]$$$keyboardInputLocale -->
<h3 class="fn"><a name="keyboardInputLocale"></a><span class="type"><a href="qlocale.html">QLocale</a></span> QApplication::<span class="name">keyboardInputLocale</span> ()<tt> [static]</tt></h3>
<p>Returns the current keyboard input locale.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@keyboardInputLocale -->
<!-- $$$keyboardModifiers[overload1]$$$keyboardModifiers -->
<h3 class="fn"><a name="keyboardModifiers"></a><span class="type"><a href="qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a></span> QApplication::<span class="name">keyboardModifiers</span> ()<tt> [static]</tt></h3>
<p>Returns the current state of the modifier keys on the keyboard. The current state is updated sychronously as the event queue is emptied of events that will spontaneously change the keyboard state (<a href="qevent.html#Type-enum">QEvent::KeyPress</a> and <a href="qevent.html#Type-enum">QEvent::KeyRelease</a> events).</p>
<p>It should be noted this may not reflect the actual keys held on the input device at the time of calling but rather the modifiers as last reported in one of the above events. If no keys are being held <a href="qt.html#KeyboardModifier-enum">Qt::NoModifier</a> is returned.</p>
<p><b>See also </b><a href="qapplication.html#mouseButtons">mouseButtons</a>() and <a href="qapplication.html#queryKeyboardModifiers">queryKeyboardModifiers</a>().</p>
<!-- @@@keyboardModifiers -->
<!-- $$$keypadNavigationEnabled[overload1]$$$keypadNavigationEnabled -->
<h3 class="fn"><a name="keypadNavigationEnabled"></a><span class="type">bool</span> QApplication::<span class="name">keypadNavigationEnabled</span> ()<tt> [static]</tt></h3>
<p>This function is deprecated.</p>
<p>Returns true if Qt is set to use keypad navigation; otherwise returns false. The default value is true on Symbian, but false on other platforms.</p>
<p>This feature is available in Qt for Embedded Linux, Symbian and Windows CE only.</p>
<p><b>Note:</b> On Windows CE this feature is disabled by default for touch device mkspecs. To enable keypad navigation, build Qt with QT_KEYPAD_NAVIGATION defined.</p>
<p><b>See also </b><a href="qapplication.html#navigationMode">navigationMode</a>().</p>
<!-- @@@keypadNavigationEnabled -->
<!-- $$$lastWindowClosed[overload1]$$$lastWindowClosed -->
<h3 class="fn"><a name="lastWindowClosed"></a><span class="type">void</span> QApplication::<span class="name">lastWindowClosed</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted from <a href="qapplication.html#exec">QApplication::exec</a>() when the last visible primary window (i.e&#x2e; window with no parent) with the <a href="qt.html#WidgetAttribute-enum">Qt::WA_QuitOnClose</a> attribute set is closed.</p>
<p>By default,</p>
<ul>
<li>this attribute is set for all widgets except transient windows such as splash screens, tool windows, and popup menus</li>
<li><a href="qapplication.html">QApplication</a> implicitly quits when this signal is emitted.</li>
</ul>
<p>This feature can be turned off by setting <a href="qapplication.html#quitOnLastWindowClosed-prop">quitOnLastWindowClosed</a> to false.</p>
<p><b>See also </b><a href="qwidget.html#close">QWidget::close</a>().</p>
<!-- @@@lastWindowClosed -->
<!-- $$$macEventFilter[overload1]$$$macEventFilterEventHandlerCallRefEventRef -->
<h3 class="fn"><a name="macEventFilter"></a><span class="type">bool</span> QApplication::<span class="name">macEventFilter</span> ( <span class="type">EventHandlerCallRef</span> <i>caller</i>, <span class="type">EventRef</span> <i>event</i> )<tt> [virtual]</tt></h3>
<p><b>Warning:</b> This virtual function is only used under Mac OS X, and behaves different depending on if Qt is based on Carbon or Cocoa.</p>
<p>For the Carbon port, If you create an application that inherits <a href="qapplication.html">QApplication</a> and reimplement this function, you get direct access to all Carbon Events that Qt registers for from Mac OS X with this function being called with the <i>caller</i> and the <i>event</i>.</p>
<p>For the Cocoa port, If you create an application that inherits <a href="qapplication.html">QApplication</a> and reimplement this function, you get direct access to all Cocoa Events that Qt receives from Mac OS X with this function being called with the <i>caller</i> being 0 and the <i>event</i> being an NSEvent pointer:</p>
<p>NSEvent *e = reinterpret_cast&lt;NSEvent *&gt;(event);</p>
<p>Return true if you want to stop the event from being processed. Return false for normal event dispatching. The default implementation returns false.</p>
<!-- @@@macEventFilter -->
<!-- $$$mouseButtons[overload1]$$$mouseButtons -->
<h3 class="fn"><a name="mouseButtons"></a><span class="type"><a href="qt.html#MouseButton-enum">Qt::MouseButtons</a></span> QApplication::<span class="name">mouseButtons</span> ()<tt> [static]</tt></h3>
<p>Returns the current state of the buttons on the mouse. The current state is updated syncronously as the event queue is emptied of events that will spontaneously change the mouse state (<a href="qevent.html#Type-enum">QEvent::MouseButtonPress</a> and <a href="qevent.html#Type-enum">QEvent::MouseButtonRelease</a> events).</p>
<p>It should be noted this may not reflect the actual buttons held on the input device at the time of calling but rather the mouse buttons as last reported in one of the above events. If no mouse buttons are being held <a href="qt.html#MouseButton-enum">Qt::NoButton</a> is returned.</p>
<p><b>See also </b><a href="qapplication.html#keyboardModifiers">keyboardModifiers</a>().</p>
<!-- @@@mouseButtons -->
<!-- $$$navigationMode[overload1]$$$navigationMode -->
<h3 class="fn"><a name="navigationMode"></a><span class="type"><a href="qt.html#NavigationMode-enum">Qt::NavigationMode</a></span> QApplication::<span class="name">navigationMode</span> ()<tt> [static]</tt></h3>
<p>Returns what kind of focus navigation Qt is using.</p>
<p>This feature is available in Qt for Embedded Linux, Symbian and Windows CE only.</p>
<p><b>Note:</b> On Windows CE this feature is disabled by default for touch device mkspecs. To enable keypad navigation, build Qt with QT_KEYPAD_NAVIGATION defined.</p>
<p><b>Note:</b> On Symbian, the default mode is <a href="qt.html#NavigationMode-enum">Qt::NavigationModeNone</a> for touch devices, and <a href="qt.html#NavigationMode-enum">Qt::NavigationModeKeypadDirectional</a>.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qapplication.html#setNavigationMode">setNavigationMode</a>() and <a href="qapplication.html#keypadNavigationEnabled">keypadNavigationEnabled</a>().</p>
<!-- @@@navigationMode -->
<!-- $$$notify[overload1]$$$notifyQObject*QEvent* -->
<h3 class="fn"><a name="notify"></a><span class="type">bool</span> QApplication::<span class="name">notify</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>receiver</i>, <span class="type"><a href="qevent.html">QEvent</a></span> * <i>e</i> )<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qcoreapplication.html#notify">QCoreApplication::notify</a>().</p>
<!-- @@@notify -->
<!-- $$$overrideCursor[overload1]$$$overrideCursor -->
<h3 class="fn"><a name="overrideCursor"></a><span class="type"><a href="qcursor.html">QCursor</a></span> * QApplication::<span class="name">overrideCursor</span> ()<tt> [static]</tt></h3>
<p>Returns the active application override cursor.</p>
<p>This function returns 0 if no application cursor has been defined (i.e&#x2e; the internal cursor stack is empty).</p>
<p><b>See also </b><a href="qapplication.html#setOverrideCursor">setOverrideCursor</a>() and <a href="qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>().</p>
<!-- @@@overrideCursor -->
<!-- $$$palette[overload1]$$$palette -->
<h3 class="fn"><a name="palette"></a><span class="type"><a href="qpalette.html">QPalette</a></span> QApplication::<span class="name">palette</span> ()<tt> [static]</tt></h3>
<p>Returns the application palette.</p>
<p><b>See also </b><a href="qapplication.html#setPalette">setPalette</a>() and <a href="qwidget.html#palette-prop">QWidget::palette</a>().</p>
<!-- @@@palette -->
<!-- $$$palette$$$paletteconstQWidget* -->
<h3 class="fn"><a name="palette-2"></a><span class="type"><a href="qpalette.html">QPalette</a></span> QApplication::<span class="name">palette</span> ( const <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>If a <i>widget</i> is passed, the default palette for the widget's class is returned. This may or may not be the application palette. In most cases there is no special palette for certain types of widgets, but one notable exception is the popup menu under Windows, if the user has defined a special background color for menus in the display settings.</p>
<p><b>See also </b><a href="qapplication.html#setPalette">setPalette</a>() and <a href="qwidget.html#palette-prop">QWidget::palette</a>().</p>
<!-- @@@palette -->
<!-- $$$palette$$$paletteconstchar* -->
<h3 class="fn"><a name="palette-3"></a><span class="type"><a href="qpalette.html">QPalette</a></span> QApplication::<span class="name">palette</span> ( const <span class="type">char</span> * <i>className</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Returns the palette for widgets of the given <i>className</i>.</p>
<p><b>See also </b><a href="qapplication.html#setPalette">setPalette</a>() and <a href="qwidget.html#palette-prop">QWidget::palette</a>().</p>
<!-- @@@palette -->
<!-- $$$queryKeyboardModifiers[overload1]$$$queryKeyboardModifiers -->
<h3 class="fn"><a name="queryKeyboardModifiers"></a><span class="type"><a href="qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a></span> QApplication::<span class="name">queryKeyboardModifiers</span> ()<tt> [static]</tt></h3>
<p>Queries and returns the state of the modifier keys on the keyboard. Unlike keyboardModifiers, this method returns the actual keys held on the input device at the time of calling the method.</p>
<p>It does not rely on the keypress events having been received by this process, which makes it possible to check the modifiers while moving a window, for instance. Note that in most cases, you should use <a href="qapplication.html#keyboardModifiers">keyboardModifiers</a>(), which is faster and more accurate since it contains the state of the modifiers as they were when the currently processed event was received.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qapplication.html#keyboardModifiers">keyboardModifiers</a>().</p>
<!-- @@@queryKeyboardModifiers -->
<!-- $$$qwsDecoration[overload1]$$$qwsDecoration -->
<h3 class="fn"><a name="qwsDecoration"></a><span class="type"><a href="qdecoration.html">QDecoration</a></span> &amp; QApplication::<span class="name">qwsDecoration</span> ()<tt> [static]</tt></h3>
<p>Return the QWSDecoration used for decorating windows.</p>
<p><b>Warning:</b> This method is non-portable. It is only available in Qt for Embedded Linux.</p>
<p><b>See also </b><a href="qdecoration.html">QDecoration</a>.</p>
<!-- @@@qwsDecoration -->
<!-- $$$qwsEventFilter[overload1]$$$qwsEventFilterQWSEvent* -->
<h3 class="fn"><a name="qwsEventFilter"></a><span class="type">bool</span> QApplication::<span class="name">qwsEventFilter</span> ( <span class="type"><a href="qwsevent.html">QWSEvent</a></span> * <i>event</i> )<tt> [virtual]</tt></h3>
<p>This virtual function is only implemented under Qt for Embedded Linux.</p>
<p>If you create an application that inherits <a href="qapplication.html">QApplication</a> and reimplement this function, you get direct access to all QWS (Q Window System) events that the are received from the QWS master process. The events are passed in the <i>event</i> parameter.</p>
<p>Return true if you want to stop the event from being processed. Return false for normal event dispatching. The default implementation returns false.</p>
<!-- @@@qwsEventFilter -->
<!-- $$$qwsSetCustomColors[overload1]$$$qwsSetCustomColorsQRgb*intint -->
<h3 class="fn"><a name="qwsSetCustomColors"></a><span class="type">void</span> QApplication::<span class="name">qwsSetCustomColors</span> ( <span class="type"><a href="qcolor.html#QRgb-typedef">QRgb</a></span> * <i>colorTable</i>, <span class="type">int</span> <i>start</i>, <span class="type">int</span> <i>numColors</i> )</h3>
<p>Set Qt for Embedded Linux custom color table.</p>
<p>Qt for Embedded Linux on 8-bpp displays allocates a standard 216 color cube. The remaining 40 colors may be used by setting a custom color table in the QWS master process before any clients connect.</p>
<p><i>colorTable</i> is an array of up to 40 custom colors. <i>start</i> is the starting index (0-39) and <i>numColors</i> is the number of colors to be set (1-40).</p>
<p>This method is non-portable. It is available <i>only</i> in Qt for Embedded Linux.</p>
<p><b>Note:</b> The custom colors will not be used by the default screen driver. To make use of the new colors, implement a custom screen driver, or use <a href="qdirectpainter.html">QDirectPainter</a>.</p>
<!-- @@@qwsSetCustomColors -->
<!-- $$$qwsSetDecoration[overload1]$$$qwsSetDecorationQDecoration* -->
<h3 class="fn"><a name="qwsSetDecoration"></a><span class="type">void</span> QApplication::<span class="name">qwsSetDecoration</span> ( <span class="type"><a href="qdecoration.html">QDecoration</a></span> * <i>decoration</i> )<tt> [static]</tt></h3>
<p>Sets the <a href="qdecoration.html">QDecoration</a> derived class to use for decorating the windows used by Qt for Embedded Linux to the <i>decoration</i> specified.</p>
<p>This method is non-portable. It is only available in Qt for Embedded Linux.</p>
<p><b>See also </b><a href="qdecoration.html">QDecoration</a>.</p>
<!-- @@@qwsSetDecoration -->
<!-- $$$qwsSetDecoration$$$qwsSetDecorationconstQString& -->
<h3 class="fn"><a name="qwsSetDecoration-2"></a><span class="type"><a href="qdecoration.html">QDecoration</a></span> * QApplication::<span class="name">qwsSetDecoration</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>decoration</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Requests a <a href="qdecoration.html">QDecoration</a> object for <i>decoration</i> from the <a href="qdecorationfactory.html">QDecorationFactory</a>.</p>
<p>The string must be one of the <a href="qdecorationfactory.html#keys">QDecorationFactory::keys</a>(). Keys are case insensitive.</p>
<p>A later call to the <a href="qapplication.html">QApplication</a> constructor will override the requested style when a &quot;-style&quot; option is passed in as a commandline parameter.</p>
<p>Returns 0 if an unknown <i>decoration</i> is passed, otherwise the <a href="qstyle.html">QStyle</a> object returned is set as the application's GUI style.</p>
<!-- @@@qwsSetDecoration -->
<!-- $$$restoreOverrideCursor[overload1]$$$restoreOverrideCursor -->
<h3 class="fn"><a name="restoreOverrideCursor"></a><span class="type">void</span> QApplication::<span class="name">restoreOverrideCursor</span> ()<tt> [static]</tt></h3>
<p>Undoes the last <a href="qapplication.html#setOverrideCursor">setOverrideCursor</a>().</p>
<p>If <a href="qapplication.html#setOverrideCursor">setOverrideCursor</a>() has been called twice, calling restoreOverrideCursor() will activate the first cursor set. Calling this function a second time restores the original widgets' cursors.</p>
<p><b>See also </b><a href="qapplication.html#setOverrideCursor">setOverrideCursor</a>() and <a href="qapplication.html#overrideCursor">overrideCursor</a>().</p>
<!-- @@@restoreOverrideCursor -->
<!-- $$$saveState[overload1]$$$saveStateQSessionManager& -->
<h3 class="fn"><a name="saveState"></a><span class="type">void</span> QApplication::<span class="name">saveState</span> ( <span class="type"><a href="qsessionmanager.html">QSessionManager</a></span> &amp; <i>manager</i> )<tt> [virtual]</tt></h3>
<p>This function deals with <a href="session.html">session management</a>. It is invoked when the <a href="qsessionmanager.html">session manager</a> wants the application to preserve its state for a future session.</p>
<p>For example, a text editor would create a temporary file that includes the current contents of its edit buffers, the location of the cursor and other aspects of the current editing session.</p>
<p>You should never exit the application within this function. Instead, the session manager may or may not do this afterwards, depending on the context. Futhermore, most session managers will very likely request a saved state immediately after the application has been started. This permits the session manager to learn about the application's restart policy.</p>
<p><b>Warning:</b> Within this function, no user interaction is possible, <i>unless</i> you ask the <i>manager</i> for explicit permission. See <a href="qsessionmanager.html#allowsInteraction">QSessionManager::allowsInteraction</a>() and <a href="qsessionmanager.html#allowsErrorInteraction">QSessionManager::allowsErrorInteraction</a>() for details.</p>
<p><b>See also </b><a href="qapplication.html#isSessionRestored">isSessionRestored</a>(), <a href="qapplication.html#sessionId">sessionId</a>(), <a href="qapplication.html#commitData">commitData</a>(), and <a href="session.html">Session Management</a>.</p>
<!-- @@@saveState -->
<!-- $$$saveStateRequest[overload1]$$$saveStateRequestQSessionManager& -->
<h3 class="fn"><a name="saveStateRequest"></a><span class="type">void</span> QApplication::<span class="name">saveStateRequest</span> ( <span class="type"><a href="qsessionmanager.html">QSessionManager</a></span> &amp; <i>manager</i> )<tt> [signal]</tt></h3>
<p>This signal deals with <a href="session.html">session management</a>. It is invoked when the <a href="qsessionmanager.html">session manager</a> wants the application to preserve its state for a future session.</p>
<p>For example, a text editor would create a temporary file that includes the current contents of its edit buffers, the location of the cursor and other aspects of the current editing session.</p>
<p>You should never exit the application within this signal. Instead, the session manager may or may not do this afterwards, depending on the context. Futhermore, most session managers will very likely request a saved state immediately after the application has been started. This permits the session manager to learn about the application's restart policy.</p>
<p><b>Warning:</b> Within this function, no user interaction is possible, <i>unless</i> you ask the <i>manager</i> for explicit permission. See <a href="qsessionmanager.html#allowsInteraction">QSessionManager::allowsInteraction</a>() and <a href="qsessionmanager.html#allowsErrorInteraction">QSessionManager::allowsErrorInteraction</a>() for details.</p>
<p><b>Note:</b> You should use <a href="qt.html#ConnectionType-enum">Qt::DirectConnection</a> when connecting to this signal.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qapplication.html#isSessionRestored">isSessionRestored</a>(), <a href="qapplication.html#sessionId">sessionId</a>(), <a href="qapplication.html#commitData">commitData</a>(), and <a href="session.html">Session Management</a>.</p>
<!-- @@@saveStateRequest -->
<!-- $$$sessionId[overload1]$$$sessionId -->
<h3 class="fn"><a name="sessionId"></a><span class="type"><a href="qstring.html">QString</a></span> QApplication::<span class="name">sessionId</span> () const</h3>
<p>Returns the current <a href="session.html">session's</a> identifier.</p>
<p>If the application has been restored from an earlier session, this identifier is the same as it was in that previous session. The session identifier is guaranteed to be unique both for different applications and for different instances of the same application.</p>
<p><b>See also </b><a href="qapplication.html#isSessionRestored">isSessionRestored</a>(), <a href="qapplication.html#sessionKey">sessionKey</a>(), <a href="qapplication.html#commitData">commitData</a>(), and <a href="qapplication.html#saveState">saveState</a>().</p>
<!-- @@@sessionId -->
<!-- $$$sessionKey[overload1]$$$sessionKey -->
<h3 class="fn"><a name="sessionKey"></a><span class="type"><a href="qstring.html">QString</a></span> QApplication::<span class="name">sessionKey</span> () const</h3>
<p>Returns the session key in the current <a href="session.html">session</a>.</p>
<p>If the application has been restored from an earlier session, this key is the same as it was when the previous session ended.</p>
<p>The session key changes with every call of <a href="qapplication.html#commitData">commitData</a>() or <a href="qapplication.html#saveState">saveState</a>().</p>
<p><b>See also </b><a href="qapplication.html#isSessionRestored">isSessionRestored</a>(), <a href="qapplication.html#sessionId">sessionId</a>(), <a href="qapplication.html#commitData">commitData</a>(), and <a href="qapplication.html#saveState">saveState</a>().</p>
<!-- @@@sessionKey -->
<!-- $$$setActiveWindow[overload1]$$$setActiveWindowQWidget* -->
<h3 class="fn"><a name="setActiveWindow"></a><span class="type">void</span> QApplication::<span class="name">setActiveWindow</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>active</i> )<tt> [static]</tt></h3>
<p>Sets the active window to the <i>active</i> widget in response to a system event. The function is called from the platform specific event handlers.</p>
<p><b>Warning:</b> This function does <i>not</i> set the keyboard focus to the active widget. Call <a href="qwidget.html#activateWindow">QWidget::activateWindow</a>() instead.</p>
<p>It sets the <a href="qapplication.html#activeWindow">activeWindow</a>() and <a href="qapplication.html#focusWidget">focusWidget</a>() attributes and sends proper <a href="qevent.html#Type-enum">WindowActivate</a>/<a href="qevent.html#Type-enum">WindowDeactivate</a> and <a href="qevent.html#Type-enum">FocusIn</a>/<a href="qevent.html#Type-enum">FocusOut</a> events to all appropriate widgets. The window will then be painted in active state (e.g&#x2e; cursors in line edits will blink), and it will have tool tips enabled.</p>
<p><b>See also </b><a href="qapplication.html#activeWindow">activeWindow</a>() and <a href="qwidget.html#activateWindow">QWidget::activateWindow</a>().</p>
<!-- @@@setActiveWindow -->
<!-- $$$setColorSpec[overload1]$$$setColorSpecint -->
<h3 class="fn"><a name="setColorSpec"></a><span class="type">void</span> QApplication::<span class="name">setColorSpec</span> ( <span class="type">int</span> <i>spec</i> )<tt> [static]</tt></h3>
<p>Sets the color specification for the application to <i>spec</i>.</p>
<p>The color specification controls how the application allocates colors when run on a display with a limited amount of colors, e.g&#x2e; 8 bit / 256 color displays.</p>
<p>The color specification must be set before you create the <a href="qapplication.html">QApplication</a> object.</p>
<p>The options are:</p>
<ul>
<li><a href="qapplication.html#ColorSpec-enum">QApplication::NormalColor</a>. This is the default color allocation strategy. Use this option if your application uses buttons, menus, texts and pixmaps with few colors. With this option, the application uses system global colors. This works fine for most applications under X11, but on the Windows platform, it may cause dithering of non-standard colors.</li>
<li><a href="qapplication.html#ColorSpec-enum">QApplication::CustomColor</a>. Use this option if your application needs a small number of custom colors. On X11, this option is the same as <a href="qapplication.html#ColorSpec-enum">NormalColor</a>. On Windows, Qt creates a Windows palette, and allocates colors to it on demand.</li>
<li><a href="qapplication.html#ColorSpec-enum">QApplication::ManyColor</a>. Use this option if your application is very color hungry, e.g&#x2e;, it requires thousands of colors. <br /> Under X11 the effect is:<ul>
<li>For 256-color displays which have at best a 256 color true color visual, the default visual is used, and colors are allocated from a color cube. The color cube is the 6x6x6 (216 color) &quot;Web palette&quot; (the red, green, and blue components always have one of the following values: 0x00, 0x33, 0x66, 0x99, 0xCC, or 0xFF), but the number of colors can be changed by the <i>-ncols</i> option. The user can force the application to use the true color visual with the <a href="qapplication.html#QApplication">-visual</a> option.</li>
<li>For 256-color displays which have a true color visual with more than 256 colors, use that visual. Silicon Graphics X servers this feature, for example. They provide an 8 bit visual by default but can deliver true color when asked.</li>
</ul>
<p>On Windows, Qt creates a Windows palette, and fills it with a color cube.</p>
</li>
</ul>
<p>Be aware that the <a href="qapplication.html#ColorSpec-enum">CustomColor</a> and <a href="qapplication.html#ColorSpec-enum">ManyColor</a> choices may lead to colormap flashing: The foreground application gets (most) of the available colors, while the background windows will look less attractive.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type">int</span> main(<span class="type">int</span> argc<span class="operator">,</span> <span class="type">char</span> <span class="operator">*</span>argv<span class="operator">[</span><span class="operator">]</span>)
 {
     <span class="type"><a href="qapplication.html">QApplication</a></span><span class="operator">::</span>setColorSpec(<span class="type"><a href="qapplication.html">QApplication</a></span><span class="operator">::</span>ManyColor);
     <span class="type"><a href="qapplication.html">QApplication</a></span> app(argc<span class="operator">,</span> argv);
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     <span class="keyword">return</span> app<span class="operator">.</span>exec();
 }</pre>
<p><b>See also </b><a href="qapplication.html#colorSpec">colorSpec</a>().</p>
<!-- @@@setColorSpec -->
<!-- $$$setDesktopSettingsAware[overload1]$$$setDesktopSettingsAwarebool -->
<h3 class="fn"><a name="setDesktopSettingsAware"></a><span class="type">void</span> QApplication::<span class="name">setDesktopSettingsAware</span> ( <span class="type">bool</span> <i>on</i> )<tt> [static]</tt></h3>
<p>Sets whether Qt should use the system's standard colors, fonts, etc., to <i>on</i>. By default, this is true.</p>
<p>This function must be called before creating the <a href="qapplication.html">QApplication</a> object, like this:</p>
<pre class="cpp"> <span class="type">int</span> main(<span class="type">int</span> argc<span class="operator">,</span> <span class="type">char</span> <span class="operator">*</span>argv<span class="operator">[</span><span class="operator">]</span>)
 {
     <span class="type"><a href="qapplication.html">QApplication</a></span><span class="operator">::</span>setDesktopSettingsAware(<span class="keyword">false</span>);
     <span class="type"><a href="qapplication.html">QApplication</a></span> app(argc<span class="operator">,</span> argv);
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     <span class="keyword">return</span> app<span class="operator">.</span>exec();
 }</pre>
<p><b>See also </b><a href="qapplication.html#desktopSettingsAware">desktopSettingsAware</a>().</p>
<!-- @@@setDesktopSettingsAware -->
<!-- $$$setEffectEnabled[overload1]$$$setEffectEnabledQt::UIEffectbool -->
<h3 class="fn"><a name="setEffectEnabled"></a><span class="type">void</span> QApplication::<span class="name">setEffectEnabled</span> ( <span class="type"><a href="qt.html#UIEffect-enum">Qt::UIEffect</a></span> <i>effect</i>, <span class="type">bool</span> <i>enable</i> = true )<tt> [static]</tt></h3>
<p>Enables the UI effect <i>effect</i> if <i>enable</i> is true, otherwise the effect will not be used.</p>
<p><b>Note:</b> All effects are disabled on screens running at less than 16-bit color depth.</p>
<p><b>See also </b><a href="qapplication.html#isEffectEnabled">isEffectEnabled</a>(), <a href="qt.html#UIEffect-enum">Qt::UIEffect</a>, and <a href="qapplication.html#setDesktopSettingsAware">setDesktopSettingsAware</a>().</p>
<!-- @@@setEffectEnabled -->
<!-- $$$setFont[overload1]$$$setFontconstQFont&constchar* -->
<h3 class="fn"><a name="setFont"></a><span class="type">void</span> QApplication::<span class="name">setFont</span> ( const <span class="type"><a href="qfont.html">QFont</a></span> &amp; <i>font</i>, const <span class="type">char</span> * <i>className</i> = 0 )<tt> [static]</tt></h3>
<p>Changes the default application font to <i>font</i>. If <i>className</i> is passed, the change applies only to classes that inherit <i>className</i> (as reported by <a href="qobject.html#inherits">QObject::inherits</a>()).</p>
<p>On application start-up, the default font depends on the window system. It can vary depending on both the window system version and the locale. This function lets you override the default font; but overriding may be a bad idea because, for example, some locales need extra large fonts to support their special characters.</p>
<p><b>Warning:</b> Do not use this function in conjunction with <a href="stylesheet.html">Qt Style Sheets</a>. The font of an application can be customized using the &quot;font&quot; style sheet property. To set a bold font for all QPushButtons, set the application <a href="qapplication.html#styleSheet-prop">styleSheet</a>() as &quot;<a href="qpushbutton.html">QPushButton</a> { font: bold }&quot;</p>
<p><b>See also </b><a href="qapplication.html#font">font</a>(), <a href="qapplication.html#fontMetrics">fontMetrics</a>(), and <a href="qwidget.html#font-prop">QWidget::setFont</a>().</p>
<!-- @@@setFont -->
<!-- $$$setGraphicsSystem[overload1]$$$setGraphicsSystemconstQString& -->
<h3 class="fn"><a name="setGraphicsSystem"></a><span class="type">void</span> QApplication::<span class="name">setGraphicsSystem</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>system</i> )<tt> [static]</tt></h3>
<p>Sets the default graphics backend to <i>system</i>, which will be used for on-screen widgets and QPixmaps. The available systems are <tt>&quot;native&quot;</tt>, <tt>&quot;raster&quot;</tt> and <tt>&quot;opengl&quot;</tt>.</p>
<p>There are several ways to set the graphics backend, in order of decreasing precedence:</p>
<ul>
<li>the application commandline <tt>-graphicssystem</tt> switch</li>
<li>QApplication::setGraphicsSystem()</li>
<li>the QT_GRAPHICSSYSTEM environment variable</li>
<li>the Qt configure <tt>-graphicssystem</tt> switch</li>
</ul>
<p>If the highest precedence switch sets an invalid name, the error will be ignored and the default backend will be used.</p>
<p><b>Warning:</b> This function is only effective before the <a href="qapplication.html">QApplication</a> constructor is called.</p>
<p><b>Note:</b> The <tt>&quot;opengl&quot;</tt> option is currently experimental.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@setGraphicsSystem -->
<!-- $$$setInputContext[overload1]$$$setInputContextQInputContext* -->
<h3 class="fn"><a name="setInputContext"></a><span class="type">void</span> QApplication::<span class="name">setInputContext</span> ( <span class="type"><a href="qinputcontext.html">QInputContext</a></span> * <i>inputContext</i> )</h3>
<p>This function replaces the <a href="qinputcontext.html">QInputContext</a> instance used by the application with <i>inputContext</i>.</p>
<p>Qt takes ownership of the given <i>inputContext</i>.</p>
<p><b>See also </b><a href="qapplication.html#inputContext">inputContext</a>().</p>
<!-- @@@setInputContext -->
<!-- $$$setNavigationMode[overload1]$$$setNavigationModeQt::NavigationMode -->
<h3 class="fn"><a name="setNavigationMode"></a><span class="type">void</span> QApplication::<span class="name">setNavigationMode</span> ( <span class="type"><a href="qt.html#NavigationMode-enum">Qt::NavigationMode</a></span> <i>mode</i> )<tt> [static]</tt></h3>
<p>Sets the kind of focus navigation Qt should use to <i>mode</i>.</p>
<p>This feature is available in Qt for Embedded Linux, Symbian and Windows CE only.</p>
<p><b>Note:</b> On Windows CE this feature is disabled by default for touch device mkspecs. To enable keypad navigation, build Qt with QT_KEYPAD_NAVIGATION defined.</p>
<p><b>Note:</b> On Symbian, setting the mode to <a href="qt.html#NavigationMode-enum">Qt::NavigationModeCursorAuto</a> will enable a virtual mouse cursor on non touchscreen devices, which is controlled by the cursor keys if there is no analog pointer device. On other platforms and on touchscreen devices, it has the same meaning as <a href="qt.html#NavigationMode-enum">Qt::NavigationModeNone</a>.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qapplication.html#navigationMode">navigationMode</a>() and <a href="qapplication.html#keypadNavigationEnabled">keypadNavigationEnabled</a>().</p>
<!-- @@@setNavigationMode -->
<!-- $$$setOverrideCursor[overload1]$$$setOverrideCursorconstQCursor& -->
<h3 class="fn"><a name="setOverrideCursor"></a><span class="type">void</span> QApplication::<span class="name">setOverrideCursor</span> ( const <span class="type"><a href="qcursor.html">QCursor</a></span> &amp; <i>cursor</i> )<tt> [static]</tt></h3>
<p>Sets the application override cursor to <i>cursor</i>.</p>
<p>Application override cursors are intended for showing the user that the application is in a special state, for example during an operation that might take some time.</p>
<p>This cursor will be displayed in all the application's widgets until <a href="qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>() or another setOverrideCursor() is called.</p>
<p>Application cursors are stored on an internal stack. setOverrideCursor() pushes the cursor onto the stack, and <a href="qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>() pops the active cursor off the stack. <a href="qapplication.html#changeOverrideCursor">changeOverrideCursor</a>() changes the curently active application override cursor.</p>
<p>Every setOverrideCursor() must eventually be followed by a corresponding <a href="qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>(), otherwise the stack will never be emptied.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qapplication.html">QApplication</a></span><span class="operator">::</span>setOverrideCursor(<span class="type"><a href="qcursor.html">QCursor</a></span>(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>WaitCursor));
 calculateHugeMandelbrot();              <span class="comment">// lunch time...</span>
 <span class="type"><a href="qapplication.html">QApplication</a></span><span class="operator">::</span><a href="qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>();</pre>
<p><b>See also </b><a href="qapplication.html#overrideCursor">overrideCursor</a>(), <a href="qapplication.html#restoreOverrideCursor">restoreOverrideCursor</a>(), <a href="qapplication.html#changeOverrideCursor">changeOverrideCursor</a>(), and <a href="qwidget.html#cursor-prop">QWidget::setCursor</a>().</p>
<!-- @@@setOverrideCursor -->
<!-- $$$setPalette[overload1]$$$setPaletteconstQPalette&constchar* -->
<h3 class="fn"><a name="setPalette"></a><span class="type">void</span> QApplication::<span class="name">setPalette</span> ( const <span class="type"><a href="qpalette.html">QPalette</a></span> &amp; <i>palette</i>, const <span class="type">char</span> * <i>className</i> = 0 )<tt> [static]</tt></h3>
<p>Changes the default application palette to <i>palette</i>.</p>
<p>If <i>className</i> is passed, the change applies only to widgets that inherit <i>className</i> (as reported by <a href="qobject.html#inherits">QObject::inherits</a>()). If <i>className</i> is left 0, the change affects all widgets, thus overriding any previously set class specific palettes.</p>
<p>The palette may be changed according to the current GUI style in <a href="qstyle.html#polish">QStyle::polish</a>().</p>
<p><b>Warning:</b> Do not use this function in conjunction with <a href="stylesheet.html">Qt Style Sheets</a>. When using style sheets, the palette of a widget can be customized using the &quot;color&quot;, &quot;background-color&quot;, &quot;selection-color&quot;, &quot;selection-background-color&quot; and &quot;alternate-background-color&quot;.</p>
<p><b>Note:</b> Some styles do not use the palette for all drawing, for instance, if they make use of native theme engines. This is the case for the Windows XP, Windows Vista, and Mac OS X styles.</p>
<p><b>See also </b><a href="qwidget.html#palette-prop">QWidget::setPalette</a>(), <a href="qapplication.html#palette">palette</a>(), and <a href="qstyle.html#polish">QStyle::polish</a>().</p>
<!-- @@@setPalette -->
<!-- $$$setStyle[overload1]$$$setStyleQStyle* -->
<h3 class="fn"><a name="setStyle"></a><span class="type">void</span> QApplication::<span class="name">setStyle</span> ( <span class="type"><a href="qstyle.html">QStyle</a></span> * <i>style</i> )<tt> [static]</tt></h3>
<p>Sets the application's GUI style to <i>style</i>. Ownership of the style object is transferred to <a href="qapplication.html">QApplication</a>, so <a href="qapplication.html">QApplication</a> will delete the style object on application exit or when a new style is set and the old style is still the parent of the application object.</p>
<p>Example usage:</p>
<pre class="cpp"> <span class="type"><a href="qapplication.html">QApplication</a></span><span class="operator">::</span>setStyle(<span class="keyword">new</span> <span class="type"><a href="qwindowsstyle.html">QWindowsStyle</a></span>);</pre>
<p>When switching application styles, the color palette is set back to the initial colors or the system defaults. This is necessary since certain styles have to adapt the color palette to be fully style-guide compliant.</p>
<p>Setting the style before a palette has been set, i.e&#x2e;, before creating <a href="qapplication.html">QApplication</a>, will cause the application to use <a href="qstyle.html#standardPalette">QStyle::standardPalette</a>() for the palette.</p>
<p><b>Warning:</b> Qt style sheets are currently not supported for custom <a href="qstyle.html">QStyle</a> subclasses. We plan to address this in some future release.</p>
<p><b>See also </b><a href="qapplication.html#style">style</a>(), <a href="qstyle.html">QStyle</a>, <a href="qapplication.html#setPalette">setPalette</a>(), and <a href="qapplication.html#desktopSettingsAware">desktopSettingsAware</a>().</p>
<!-- @@@setStyle -->
<!-- $$$setStyle$$$setStyleconstQString& -->
<h3 class="fn"><a name="setStyle-2"></a><span class="type"><a href="qstyle.html">QStyle</a></span> * QApplication::<span class="name">setStyle</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>style</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Requests a <a href="qstyle.html">QStyle</a> object for <i>style</i> from the <a href="qstylefactory.html">QStyleFactory</a>.</p>
<p>The string must be one of the <a href="qstylefactory.html#keys">QStyleFactory::keys</a>(), typically one of &quot;windows&quot;, &quot;motif&quot;, &quot;cde&quot;, &quot;plastique&quot;, &quot;windowsxp&quot;, or &quot;macintosh&quot;. Style names are case insensitive.</p>
<p>Returns 0 if an unknown <i>style</i> is passed, otherwise the <a href="qstyle.html">QStyle</a> object returned is set as the application's GUI style.</p>
<p><b>Warning:</b> To ensure that the application's style is set correctly, it is best to call this function before the <a href="qapplication.html">QApplication</a> constructor, if possible.</p>
<!-- @@@setStyle -->
<!-- $$$style[overload1]$$$style -->
<h3 class="fn"><a name="style"></a><span class="type"><a href="qstyle.html">QStyle</a></span> * QApplication::<span class="name">style</span> ()<tt> [static]</tt></h3>
<p>Returns the application's style object.</p>
<p><b>See also </b><a href="qapplication.html#setStyle">setStyle</a>() and <a href="qstyle.html">QStyle</a>.</p>
<!-- @@@style -->
<!-- $$$symbianEventFilter[overload1]$$$symbianEventFilterconstQSymbianEvent* -->
<h3 class="fn"><a name="symbianEventFilter"></a><span class="type">bool</span> QApplication::<span class="name">symbianEventFilter</span> ( const <span class="type"><a href="qsymbianevent.html">QSymbianEvent</a></span> * <i>event</i> )<tt> [virtual]</tt></h3>
<p><b>Warning:</b> This virtual function is only available on Symbian.</p>
<p>If you create an application that inherits <a href="qapplication.html">QApplication</a> and reimplement this function, you get direct access to events that the are received from Symbian. The events are passed in the <i>event</i> parameter.</p>
<p>Return true if you want to stop the event from being processed. Return false for normal event dispatching. The default implementation returns false, and does nothing with <i>event</i>.</p>
<p>This function was introduced in Qt 4.6.</p>
<!-- @@@symbianEventFilter -->
<!-- $$$symbianProcessEvent[overload1]$$$symbianProcessEventconstQSymbianEvent* -->
<h3 class="fn"><a name="symbianProcessEvent"></a><span class="type">int</span> QApplication::<span class="name">symbianProcessEvent</span> ( const <span class="type"><a href="qsymbianevent.html">QSymbianEvent</a></span> * <i>event</i> )</h3>
<p><b>Warning:</b> This function is only available on Symbian.</p>
<p>This function processes an individual Symbian event <i>event</i>. It returns 1 if the event was handled, 0 if the <i>event</i> was not handled, and -1 if the event was not handled because the event is not known to Qt.</p>
<p>This function was introduced in Qt 4.6.</p>
<!-- @@@symbianProcessEvent -->
<!-- $$$syncX[overload1]$$$syncX -->
<h3 class="fn"><a name="syncX"></a><span class="type">void</span> QApplication::<span class="name">syncX</span> ()<tt> [static]</tt></h3>
<p>Synchronizes with the X server in the X11 implementation. This normally takes some time. Does nothing on other platforms.</p>
<!-- @@@syncX -->
<!-- $$$topLevelAt[overload1]$$$topLevelAtconstQPoint& -->
<h3 class="fn"><a name="topLevelAt"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QApplication::<span class="name">topLevelAt</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>point</i> )<tt> [static]</tt></h3>
<p>Returns the top-level widget at the given <i>point</i>; returns 0 if there is no such widget.</p>
<!-- @@@topLevelAt -->
<!-- $$$topLevelAt$$$topLevelAtintint -->
<h3 class="fn"><a name="topLevelAt-2"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QApplication::<span class="name">topLevelAt</span> ( <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Returns the top-level widget at the point (<i>x</i>, <i>y</i>); returns 0 if there is no such widget.</p>
<!-- @@@topLevelAt -->
<!-- $$$topLevelWidgets[overload1]$$$topLevelWidgets -->
<h3 class="fn"><a name="topLevelWidgets"></a><span class="type"><a href="qwidget.html#QWidgetList-typedef">QWidgetList</a></span> QApplication::<span class="name">topLevelWidgets</span> ()<tt> [static]</tt></h3>
<p>Returns a list of the top-level widgets (windows) in the application.</p>
<p><b>Note:</b> Some of the top-level widgets may be hidden, for example a tooltip if no tooltip is currently shown.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type">void</span> showAllHiddenTopLevelWidgets()
 {
     foreach (<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>widget<span class="operator">,</span> <span class="type"><a href="qapplication.html">QApplication</a></span><span class="operator">::</span>topLevelWidgets()) {
         <span class="keyword">if</span> (widget<span class="operator">-</span><span class="operator">&gt;</span>isHidden())
             widget<span class="operator">-</span><span class="operator">&gt;</span>show();
     }
 }</pre>
<p><b>See also </b><a href="qapplication.html#allWidgets">allWidgets</a>(), <a href="qwidget.html#isWindow">QWidget::isWindow</a>(), and <a href="qwidget.html#isHidden">QWidget::isHidden</a>().</p>
<!-- @@@topLevelWidgets -->
<!-- $$$type[overload1]$$$type -->
<h3 class="fn"><a name="type"></a><span class="type"><a href="qapplication.html#Type-enum">Type</a></span> QApplication::<span class="name">type</span> ()<tt> [static]</tt></h3>
<p>Returns the type of application (<a href="qapplication.html#Type-enum">Tty</a>, <a href="qapplication.html#Type-enum">GuiClient</a>, or <a href="qapplication.html#Type-enum">GuiServer</a>). The type is set when constructing the <a href="qapplication.html">QApplication</a> object.</p>
<!-- @@@type -->
<!-- $$$widgetAt[overload1]$$$widgetAtconstQPoint& -->
<h3 class="fn"><a name="widgetAt"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QApplication::<span class="name">widgetAt</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>point</i> )<tt> [static]</tt></h3>
<p>Returns the widget at global screen position <i>point</i>, or 0 if there is no Qt widget there.</p>
<p>This function can be slow.</p>
<p><b>See also </b><a href="qcursor.html#pos">QCursor::pos</a>(), <a href="qwidget.html#grabMouse">QWidget::grabMouse</a>(), and <a href="qwidget.html#grabKeyboard">QWidget::grabKeyboard</a>().</p>
<!-- @@@widgetAt -->
<!-- $$$widgetAt$$$widgetAtintint -->
<h3 class="fn"><a name="widgetAt-4"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QApplication::<span class="name">widgetAt</span> ( <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Returns the widget at global screen position (<i>x</i>, <i>y</i>), or 0 if there is no Qt widget there.</p>
<!-- @@@widgetAt -->
<!-- $$$x11EventFilter[overload1]$$$x11EventFilterXEvent* -->
<h3 class="fn"><a name="x11EventFilter"></a><span class="type">bool</span> QApplication::<span class="name">x11EventFilter</span> ( <span class="type">XEvent</span> * <i>event</i> )<tt> [virtual]</tt></h3>
<p><b>Warning:</b> This virtual function is only implemented under X11.</p>
<p>If you create an application that inherits <a href="qapplication.html">QApplication</a> and reimplement this function, you get direct access to all X events that the are received from the X server. The events are passed in the <i>event</i> parameter.</p>
<p>Return true if you want to stop the event from being processed. Return false for normal event dispatching. The default implementation returns false.</p>
<p>It is only the directly addressed messages that are filtered. You must install an event filter directly on the event dispatcher, which is returned by <a href="qabstracteventdispatcher.html#instance">QAbstractEventDispatcher::instance</a>(), to handle system wide messages.</p>
<p><b>See also </b><a href="qapplication.html#x11ProcessEvent">x11ProcessEvent</a>().</p>
<!-- @@@x11EventFilter -->
<!-- $$$x11ProcessEvent[overload1]$$$x11ProcessEventXEvent* -->
<h3 class="fn"><a name="x11ProcessEvent"></a><span class="type">int</span> QApplication::<span class="name">x11ProcessEvent</span> ( <span class="type">XEvent</span> * <i>event</i> )</h3>
<p>This function does the core processing of individual X <i>event</i>s, normally by dispatching Qt events to the right destination.</p>
<p>It returns 1 if the event was consumed by special handling, 0 if the <i>event</i> was consumed by normal handling, and -1 if the <i>event</i> was for an unrecognized widget.</p>
<p><b>See also </b><a href="qapplication.html#x11EventFilter">x11EventFilter</a>().</p>
<!-- @@@x11ProcessEvent -->
</div>
<div class="macros">
<h2>Macro Documentation</h2>
<!-- $$$qApp[overload1]$$$qApp -->
<h3 class="fn"><a name="qApp"></a><span class="name">qApp</span></h3>
<p>A global pointer referring to the unique application object. It is equivalent to the pointer returned by the <a href="qcoreapplication.html#instance">QCoreApplication::instance</a>() function except that, in GUI applications, it is a pointer to a <a href="qapplication.html">QApplication</a> instance.</p>
<p>Only one application object can be created.</p>
<p><b>See also </b><a href="qcoreapplication.html#instance">QCoreApplication::instance</a>().</p>
<!-- @@@qApp -->
</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>