Sophie

Sophie

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

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qx11embed_x11.cpp -->
  <title>Qt 4.8: QX11EmbedWidget 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>QX11EmbedWidget</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QX11EmbedWidget Class Reference</h1>
<!-- $$$QX11EmbedWidget-brief -->
<p>The QX11EmbedWidget class provides an XEmbed client widget. <a href="#details">More...</a></p>
<!-- @@@QX11EmbedWidget -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QX11EmbedWidget&gt;</span></pre><p><b>Inherits: </b><a href="qwidget.html">QWidget</a>.</p>
<ul>
<li><a href="qx11embedwidget-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qx11embedwidget.html#Error-enum">Error</a></b> { Unknown, InvalidWindowID }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qx11embedwidget.html#QX11EmbedWidget">QX11EmbedWidget</a></b> ( QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qx11embedwidget.html#dtor.QX11EmbedWidget">~QX11EmbedWidget</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> WId </td><td class="memItemRight bottomAlign"><b><a href="qx11embedwidget.html#containerWinId">containerWinId</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qx11embedwidget.html#embedInto">embedInto</a></b> ( WId <i>id</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Error </td><td class="memItemRight bottomAlign"><b><a href="qx11embedwidget.html#error">error</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">221 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qx11embedwidget.html#containerClosed">containerClosed</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qx11embedwidget.html#embedded">embedded</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qx11embedwidget.html#error-2">error</a></b> ( QX11EmbedWidget::Error <i>error</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</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="qx11embedwidget.html#event">event</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qx11embedwidget.html#resizeEvent">resizeEvent</a></b> ( QResizeEvent * <i>event</i> )</td></tr>
</table>
<ul>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QX11EmbedWidget-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QX11EmbedWidget class provides an XEmbed client widget.</p>
<p>XEmbed is an X11 protocol that supports the embedding of a widget from one application into another application.</p>
<p>An XEmbed <i>client widget</i> is a window that is embedded into a <i>container</i>. A container is the graphical location that embeds (or <i>swallows</i>) an external application.</p>
<p>QX11EmbedWidget is a widget used for writing XEmbed applets or plugins. When it has been embedded and the container receives tab focus, focus is passed on to the widget. When the widget reaches the end of its focus chain, focus is passed back to the container. Window activation, accelerator support, modality and drag and drop (XDND) are also handled.</p>
<p>The widget and container can both initiate the embedding. If the widget is the initiator, the X11 window ID of the container that it wants to embed itself into must be passed to <a href="qx11embedwidget.html#embedInto">embedInto</a>().</p>
<p>If the container initiates the embedding, the window ID of the embedded widget must be known. The container calls embed(), passing the window ID.</p>
<p>This example shows an application that embeds a QX11EmbedWidget subclass into the window whose ID is passed as a command-line argument:</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> app(argc<span class="operator">,</span> argv);

     <span class="keyword">if</span> (app<span class="operator">.</span>arguments()<span class="operator">.</span>count() <span class="operator">!</span><span class="operator">=</span> <span class="number">2</span>) {
         <a href="qtglobal.html#qFatal">qFatal</a>(<span class="string">&quot;Error - expected window id as argument&quot;</span>);
         <span class="keyword">return</span> <span class="number">1</span>;
     }

     <span class="type"><a href="qstring.html">QString</a></span> windowId(app<span class="operator">.</span>arguments()<span class="operator">[</span><span class="number">1</span><span class="operator">]</span>);
     EmbedWidget window;
     window<span class="operator">.</span>embedInto(windowId<span class="operator">.</span>toULong());
     window<span class="operator">.</span>show();

     <span class="keyword">return</span> app<span class="operator">.</span>exec();
 }</pre>
<p>The problem of obtaining the window IDs is often solved by the container invoking the application that provides the widget as a separate process (as a panel invokes a docked applet), passing its window ID to the new process as a command-line argument. The new process can then call <a href="qx11embedwidget.html#embedInto">embedInto</a>() with the container's window ID, as shown in the example code above. Similarly, the new process can report its window ID to the container through IPC, in which case the container can embed the widget.</p>
<p>When the widget has been embedded, it emits the signal <a href="qx11embedwidget.html#embedded">embedded</a>(). If it is closed by the container, the widget emits <a href="qx11embedwidget.html#containerClosed">containerClosed</a>(). If an error occurs when embedding, <a href="qx11embedwidget.html#error">error</a>() is emitted.</p>
<p>There are XEmbed widgets available for KDE and GTK+. The GTK+ equivalent of QX11EmbedWidget is GtkPlug. The corresponding KDE 3 widget is called QXEmbed.</p>
</div>
<p><b>See also </b><a href="qx11embedcontainer.html">QX11EmbedContainer</a> and <a href="http://www.freedesktop.org/Standards/xembed-spec">XEmbed Specification</a>.</p>
<!-- @@@QX11EmbedWidget -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Error$$$Unknown$$$Internal$$$InvalidWindowID -->
<h3 class="fn"><a name="Error-enum"></a>enum QX11EmbedWidget::<span class="name">Error</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>QX11EmbedWidget::Unknown</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">An unrecognized error occurred.</td></tr>
<tr><td class="topAlign"><tt>QX11EmbedWidget::InvalidWindowID</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The X11 window ID of the container was invalid. This error is usually triggered by passing an invalid window ID to <a href="qx11embedwidget.html#embedInto">embedInto</a>().</td></tr>
</table>
<!-- @@@Error -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QX11EmbedWidget[overload1]$$$QX11EmbedWidgetQWidget* -->
<h3 class="fn"><a name="QX11EmbedWidget"></a>QX11EmbedWidget::<span class="name">QX11EmbedWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a <a href="qx11embedwidget.html">QX11EmbedWidget</a> object with the given <i>parent</i>.</p>
<!-- @@@QX11EmbedWidget -->
<!-- $$$~QX11EmbedWidget[overload1]$$$~QX11EmbedWidget -->
<h3 class="fn"><a name="dtor.QX11EmbedWidget"></a>QX11EmbedWidget::<span class="name">~QX11EmbedWidget</span> ()</h3>
<p>Destructs the <a href="qx11embedwidget.html">QX11EmbedWidget</a> object. If the widget is embedded when deleted, it is hidden and then detached from its container, so that the container is free to embed a new widget.</p>
<!-- @@@~QX11EmbedWidget -->
<!-- $$$containerClosed[overload1]$$$containerClosed -->
<h3 class="fn"><a name="containerClosed"></a><span class="type">void</span> QX11EmbedWidget::<span class="name">containerClosed</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted by the client widget when the container closes the widget. This can happen if the container itself closes, or if the widget is rejected.</p>
<p>The container can reject a widget for any reason, but the most common cause of a rejection is when an attempt is made to embed a widget into a container that already has an embedded widget.</p>
<!-- @@@containerClosed -->
<!-- $$$containerWinId[overload1]$$$containerWinId -->
<h3 class="fn"><a name="containerWinId"></a><span class="type"><a href="qwidget.html#WId-typedef">WId</a></span> QX11EmbedWidget::<span class="name">containerWinId</span> () const</h3>
<p>If the widget is embedded, returns the window ID of the container; otherwize returns 0.</p>
<!-- @@@containerWinId -->
<!-- $$$embedInto[overload1]$$$embedIntoWId -->
<h3 class="fn"><a name="embedInto"></a><span class="type">void</span> QX11EmbedWidget::<span class="name">embedInto</span> ( <span class="type"><a href="qwidget.html#WId-typedef">WId</a></span> <i>id</i> )</h3>
<p>When this function is called, the widget embeds itself into the container whose window ID is <i>id</i>.</p>
<p>If <i>id</i> is <i>not</i> the window ID of a container this function will behave unpredictably.</p>
<!-- @@@embedInto -->
<!-- $$$embedded[overload1]$$$embedded -->
<h3 class="fn"><a name="embedded"></a><span class="type">void</span> QX11EmbedWidget::<span class="name">embedded</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted by the widget that has been embedded by an XEmbed container.</p>
<!-- @@@embedded -->
<!-- $$$error[overload1]$$$error -->
<h3 class="fn"><a name="error"></a><span class="type"><a href="qx11embedwidget.html#Error-enum">Error</a></span> QX11EmbedWidget::<span class="name">error</span> () const</h3>
<p>Returns the type of error that occurred last. This is the same error code that is emitted by the error() signal.</p>
<p><b>See also </b><a href="qx11embedwidget.html#Error-enum">Error</a>.</p>
<!-- @@@error -->
<!-- $$$error$$$errorQX11EmbedWidget::Error -->
<h3 class="fn"><a name="error-2"></a><span class="type">void</span> QX11EmbedWidget::<span class="name">error</span> ( <span class="type"><a href="qx11embedwidget.html#Error-enum">QX11EmbedWidget::Error</a></span> <i>error</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted if an error occurred as a result of embedding into or communicating with a container. The specified <i>error</i> describes the problem that occurred.</p>
<p><b>See also </b><a href="qx11embedwidget.html#Error-enum">QX11EmbedWidget::Error</a>.</p>
<!-- @@@error -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn"><a name="event"></a><span class="type">bool</span> QX11EmbedWidget::<span class="name">event</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQResizeEvent* -->
<h3 class="fn"><a name="resizeEvent"></a><span class="type">void</span> QX11EmbedWidget::<span class="name">resizeEvent</span> ( <span class="type"><a href="qresizeevent.html">QResizeEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget::resizeEvent</a>().</p>
<!-- @@@resizeEvent -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

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