Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 12

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" />
<!-- activeqt-dumpcpp.qdoc -->
  <title>Qt 4.8: The dumpcpp Tool (ActiveQt)</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>The dumpcpp Tool (ActiveQt)</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">
<h1 class="title">The dumpcpp Tool (ActiveQt)</h1>
<span class="subtitle"></span>
<!-- $$$activeqt-dumpcpp.html-description -->
<div class="descr"> <a name="details"></a>
<a name="dumpcpp"></a><p>The <tt>dumpcpp</tt> tool generates a C++ namespace for a type library.</p>
<p>To generate a C++ namespace for a type library, call <tt>dumpcpp</tt> with the following command line parameters:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Option</th><th >Result</th></tr></thead>
<tr valign="top" class="odd"><td >input</td><td >Generate documentation for <i>input</i>. <i>input</i> can specify a type library file or a type library ID, or a CLSID or ProgID for an object</td></tr>
<tr valign="top" class="even"><td >-o file</td><td >Writes the class declaration to <i>file</i>.h and meta object infomation to <i>file</i>.cpp</td></tr>
<tr valign="top" class="odd"><td >-n namespace</td><td >Generate a C++ namespace <i>namespace</i></td></tr>
<tr valign="top" class="even"><td >-nometaobject</td><td >Do not generate a .cpp file with the meta object information. The meta object is then generated in runtime.</td></tr>
<tr valign="top" class="odd"><td >-getfile libid</td><td >Print the filename for the typelibrary <i>libid</i> to stdout</td></tr>
<tr valign="top" class="even"><td >-compat</td><td >Generate namespace with dynamicCall-compatible API</td></tr>
<tr valign="top" class="odd"><td >-v</td><td >Print version information</td></tr>
<tr valign="top" class="even"><td >-h</td><td >Print help</td></tr>
</table>
<p><tt>dumpcpp</tt> can be integrated into the <tt>qmake</tt> build system. In your .pro file, list the type libraries you want to use in the TYPELIBS variable:</p>
<pre class="cpp"> TEMPLATE = app
 TARGET   = qutlook
 CONFIG  += qaxcontainer

 TYPELIBS = $$system(dumpcpp -getfile {00062FFF-0000-0000-C000-000000000046})</pre>
<p>The generated namespace will declare all enumerations, as well as one <a href="qaxobject.html">QAxObject</a> subclass for each <tt>coclass</tt> and <tt>interface</tt> declared in the type library. coclasses marked with the <tt>control</tt> attribute will be wrapped by a <a href="qaxwidget.html">QAxWidget</a> subclass.</p>
<p>Those classes that wrap creatable coclasses (i.e&#x2e; coclasses that are not marked as <tt>noncreatable</tt>) have a default constructor; this is typically a single class of type <tt>Application</tt>.</p>
<pre class="cpp"> Outlook<span class="operator">::</span>Application <span class="operator">*</span>outlook <span class="operator">=</span> <span class="keyword">new</span> Outlook<span class="operator">::</span>Application;</pre>
<p>All other classes can only be created by passing an IDispatch interface pointer to the constructor; those classes should however not be created explicitly. Instead, use the appropriate API of already created objects.</p>
<pre class="cpp"> Outlook<span class="operator">::</span>_NameSpace <span class="operator">*</span>session <span class="operator">=</span> outlook<span class="operator">-</span><span class="operator">&gt;</span>Session();</pre>
<p>All coclass wrappers also have one constructors taking an interface wrapper class for each interface implemented.</p>
<pre class="cpp"> Outlook<span class="operator">::</span>NameSpace <span class="operator">*</span>session <span class="operator">=</span> outlook<span class="operator">-</span><span class="operator">&gt;</span>Session();</pre>
<p>You have to create coclasses to be able to connect to signals of the subobject. Note that the constructor deletes the interface object, so the following will cause a segmentation fault:</p>
<pre class="cpp"> Outlook<span class="operator">::</span>_NameSpace <span class="operator">*</span>tmp <span class="operator">=</span> outlook<span class="operator">-</span><span class="operator">&gt;</span>Session();
 Outlook<span class="operator">::</span>NameSpace <span class="operator">*</span>session <span class="operator">=</span> <span class="keyword">new</span> Outlook<span class="operator">::</span>NameSpace(tmp);
 <span class="keyword">delete</span> tmp; <span class="comment">// or any other use of tmp: segfault</span></pre>
<p>If the return type is of a coclass or interface type declared in another type library you have to include the namespace header for that other type library before including the header for the namespace you want to use (both header have to be generated with this tool).</p>
<p>By default, methods and property returning subobjects will use the type as in the type library. The caller of the function is responsible for deleting or reparenting the object returned. If the <tt>-compat</tt> switch is set, properties and method returning a COM object have the return type <tt>IDispatch*</tt>, and the namespace will not declare wrapper classes for interfaces.</p>
<p>In this case, create the correct wrapper class explicitly:</p>
<pre class="cpp"> Outlook<span class="operator">::</span>NameSpace <span class="operator">*</span>session <span class="operator">=</span> <span class="keyword">new</span> Outlook<span class="operator">::</span>NameSpace(outlook<span class="operator">-</span><span class="operator">&gt;</span>Session());</pre>
<p>You can of course use the IDispatch* returned directly, in which case you have to call <tt>Release()</tt> when finished with the interface.</p>
<p>All classes in the namespace are tagged with a macro that allows you to export or import them from a DLL. To do that, declare the macro to expand to <tt>__declspec(dllimport/export)</tt> before including the header file.</p>
<p>To build the tool you must first build the <a href="qaxcontainer.html">QAxContainer</a> library. Then run your make tool in <tt>tools/dumpcpp</tt>.</p>
</div>
<!-- @@@activeqt-dumpcpp.html -->
      </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>