Sophie

Sophie

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

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" />
<!-- wince-customization.qdoc -->
  <title>Qt 4.8: Windows CE - Working with Custom SDKs</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>Windows CE - Working with Custom SDKs</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="#creating-a-custom-build-specification">Creating a Custom Build Specification</a></li>
<li class="level1"><a href="#fine-tuning-options">Fine-Tuning Options</a></li>
<li class="level1"><a href="#cross-compilation-environment-for-a-custom-sdk">Cross-compilation Environment for a Custom SDK</a></li>
<li class="level1"><a href="#compiling-qt-for-a-custom-sdk">Compiling Qt for a Custom SDK</a></li>
<li class="level1"><a href="#making-qt-applications-start-on-a-custom-device">Making Qt Applications Start on a Custom Device</a></li>
</ul>
</div>
<h1 class="title">Windows CE - Working with Custom SDKs</h1>
<span class="subtitle"></span>
<!-- $$$windowsce-customization.html-description -->
<div class="descr"> <a name="details"></a>
<p>When working with a custom SDK for Windows CE, Qt provides an easy way to add support for it to your development environment. The following is a tutorial that covers how to create a specification for Qt for Windows CE platforms.</p>
<a name="creating-a-custom-build-specification"></a>
<h2>Creating a Custom Build Specification</h2>
<p>Create a subdirectory in the <tt>mkspecs</tt> folder of the Qt directory. New specifications for Qt for Windows CE following this naming convention:</p>
<pre class="cpp"> wince&lt;version&gt;&lt;SDK-shortcut&gt;-[architecture]-msvc2005</pre>
<p>Using this convention makes it possible for <a href="qmake-manual.html#qmake">qmake</a> to identify that you are building Qt for Windows CE, and will customize the compilation process accordingly.</p>
<p>Create the files <tt>qmake.conf</tt> and <tt>qplatformdefs.h</tt> inside the new specification directory. Take a look at the implementation of the other Windows CE specifications included in the <tt>mkspecs</tt> directory to see what is required to build Qt for Windows CE successfully.</p>
<a name="fine-tuning-options"></a>
<h2>Fine-Tuning Options</h2>
<p>Compared to the desktop versions, Qt for Windows CE needs two additional options:</p>
<ul>
<li><b>CE_SDK</b> specifies the name of the SDK.</li>
<li><b>CE_ARCH</b> specifies information about the target architecture.</li>
</ul>
<p>Following is an example configuration for the Windows Mobile 5 for Pocket PC SDK:</p>
<pre class="cpp"> CE_SDK        = Windows Mobile 5.0 Pocket PC SDK
 CE_ARCH       = ARMV4I</pre>
<p><b>Note:</b> <a href="qmake-manual.html#qmake">qmake</a> uses this information to build a valid Visual Studio project file. You need to ensure that they are identical to the configuration of the custom SDK, otherwise you might not be able to compile or debug your project with Visual Studio.</p>
<p>Additionally, most Windows CE SDKs use extra compiler options. These can be specified by expanding the <tt>DEFINES</tt> value.</p>
<p>For example, with Windows Mobile 5 for Pocket PC, the <tt>DEFINES</tt> variable is expanded in the following way:</p>
<pre class="cpp"> DEFINES      += UNDER_CE WINCE _WINDOWS _UNICODE UNICODE _WIN32_WCE=0x501 $$CE_ARCH _ARMV4I_ armv4i _ARM_ ARM _M_ARM ARM _WIN32 __arm__ Q_OS_WINCE_WM QT_NO_PRINTER QT_NO_PRINTDIALOG</pre>
<p>The mkspec may require additional configuration to be used inside of Visual Studio, depending on the Windows CE SDK. The above example defines <tt>_M_ARM</tt>. This definition is available internally in Visual Studio. Hence, the compiler will warn you about redefinition during the build step. These warnings can be disabled by adding a <tt>default_post.prf</tt> file containing the following lines, within the subdirectory.</p>
<pre class="cpp"> if(equals(TEMPLATE_PREFIX, &quot;vc&quot;) | equals(TEMPLATE, &quot;vc*&quot;)) {
     DEFINES -= _M_ARM
 }</pre>
<a name="cross-compilation-environment-for-a-custom-sdk"></a>
<h2>Cross-compilation Environment for a Custom SDK</h2>
<p>Qt for Windows CE supports a convenience script, <tt>setcepaths.bat</tt>, that prepares the environment in a command prompt for cross-compilation. However, on custom SDKs, the <tt>checksdk</tt> tool is provided to identify the environment, so Qt compiles successfully.</p>
<p><tt>checksdk</tt> is generated during the <tt>configure</tt> step and allows for the following options:</p>
<ul>
<li><tt>list</tt>: Returns a list of available Windows CE SDKs. (This list may contain one or more SDKs not supported on Qt for Windows CE, e.g&#x2e;, Pocket PC 2003.)</li>
<li><tt>sdk</tt>: The parameter to specify an SDK. Returns a setup of environment variables that must be set to cross-compile Qt.</li>
<li><tt>script</tt>: Stores your setup in a <tt>.bat</tt> file. This simplifies the process of switching environments when you load a command prompt in future.</li>
</ul>
<a name="compiling-qt-for-a-custom-sdk"></a>
<h2>Compiling Qt for a Custom SDK</h2>
<p>Windows CE is highly customizable, hence it is possible that some SDKs have feature-stripped setups. Depending on the SDK's configuration, Qt may not compile in its standard configuration, as Qt for Windows CE is designed to be compatible with the Standard SDK setup.</p>
<p>However, it is possible to exclude features of Qt and create a version that compiles for the desired SDK.</p>
<p>Further information on stripping features can be found in the <a href="fine-tuning-features.html">QFeatures</a> documentation.</p>
<a name="making-qt-applications-start-on-a-custom-device"></a>
<h2>Making Qt Applications Start on a Custom Device</h2>
<p>Sometimes, a Windows CE device has been created with a configuration different from the corresponding SDK's configuration. In this case, symbols that were available at linking stage will be missing from the run-time libraries.</p>
<p>Unfortunately, the operating system will not provide an error message that mentions which symbols are absent. Instead, a message box with the following message will appear:</p>
<p><tt>app.exe is not a valid CE application!</tt></p>
<p>To identify the missing symbols, you need to create a temporary application that attempts to dynamically load the Qt for Windows CE libraries using <tt>LoadLibrary</tt>. The following code can be used for this:</p>
<pre class="cpp"> <span class="keyword">wchar_t</span><span class="operator">*</span> libraries<span class="operator">[</span><span class="operator">]</span> <span class="operator">=</span> {
     L<span class="string">&quot;QtCore4.dll&quot;</span><span class="operator">,</span>
     L<span class="string">&quot;QtGui4.dll&quot;</span><span class="operator">,</span>
     <span class="number">0</span>
 };

 <span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; libraries<span class="operator">[</span>i<span class="operator">]</span> <span class="operator">!</span><span class="operator">=</span> <span class="number">0</span>; <span class="operator">+</span><span class="operator">+</span>i) {
     HINSTANCE instance <span class="operator">=</span> LoadLibraryW(libraries<span class="operator">[</span>i<span class="operator">]</span>);
     OutputDebugStringW(libraries<span class="operator">[</span>i<span class="operator">]</span>);
     <span class="keyword">if</span> (instance <span class="operator">!</span><span class="operator">=</span> NULL) {
         OutputDebugStringW(L<span class="string">&quot; : Successfully instantiated\n&quot;</span>);
         FreeLibrary(instance);
     } <span class="keyword">else</span> {
         OutputDebugStringW(L<span class="string">&quot; : Could not be loaded\n&quot;</span>);
     }
 }</pre>
<p>Once you have compiled and deployed the application as well as the Qt libraries, start a remote debugger. The debugger will then print the ordinal number of the unresolved symbol.</p>
<p>Search for parts of Qt that rely on these functions and disable them using the <a href="fine-tuning-features.html">QFeatures</a> functionality.</p>
<p>In our experience, when Qt applications do not start on Windows CE, it is usually the result of missing symbols for the following classes or features:</p>
<ul>
<li><a href="dnd.html">Drag and Drop</a></li>
<li><a href="qclipboard.html">QClipboard</a></li>
<li><a href="qcursor.html">QCursor</a></li>
</ul>
<p>Please refer to the Microsoft documentation <a href="http://msdn.microsoft.com/en-us/library/e7tsx612.aspx">here</a> for information on what ordinals are and how you can create them. Information on accessing the corresponding symbol name to a given ordinal value can also be found in the Microsoft documentation.</p>
</div>
<!-- @@@windowsce-customization.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>