Sophie

Sophie

distrib > Mageia > 6 > i586 > by-pkgid > f93881942bd3805980c2fe63aa853d78 > files > 156

qtdoc5-5.9.4-1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- ios.qdoc -->
  <title>Qt for iOS | Qt 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt 5.9</a></td><td >Qt for iOS</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#getting-started">Getting Started</a></li>
<li class="level2"><a href="#setting-up-the-development-environment">Setting Up the Development Environment</a></li>
<li class="level2"><a href="#building-applications-from-the-command-line">Building Applications From the Command Line</a></li>
<li class="level2"><a href="#building-applications-with-qt-creator">Building Applications with Qt Creator</a></li>
<li class="level1"><a href="#using-objective-c-code-in-qt-applications">Using Objective-C Code in Qt Applications</a></li>
<li class="level1"><a href="#examples-for-ios">Examples for iOS</a></li>
<li class="level1"><a href="#related-topics">Related Topics</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Qt for iOS</h1>
<span class="subtitle"></span>
<!-- $$$ios_support.html-description -->
<div class="descr"> <a name="details"></a>
<p>Qt's iOS port allows you to run Qt applications on iOS devices, such as iPhones, iPads, and iPod Touches.</p>
<a name="getting-started"></a>
<h2 id="getting-started">Getting Started</h2>
<p>Development and deployment is done using Xcode. The supported workflow is to maintain a <code>.pro</code> file based project, which generates an Xcode project. Building and deploying can be done using either Xcode or Qt Creator. We will look at that in more detail in the next section.</p>
<p>The minimum deployment target for Qt applications is specified in <a href="supported-platforms.html">Supported Platforms</a>.</p>
<a name="setting-up-the-development-environment"></a>
<h3 >Setting Up the Development Environment</h3>
<p>You can download the Qt 5 installers from the <a href="http://qt.io/download">Downloads</a> page. For more information, see <a href="gettingstarted.html">Getting Started with Qt</a>.</p>
<p>Before installing Qt, you first need to install Xcode. You will find it in the Mac App Store <a href="http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12">here</a>.</p>
<p><b>Note: </b>As recommended by Apple, you should always use the latest Xcode version when building your applications for the App Store. In practice this means you also need the latest version of macOS to develop apps with Qt, due to Xcode's system requirements.</p><p>For running Qt applications on your Mac or in the simulator that comes with Xcode, this is all you need. However, for running applications on a mobile device and/or publishing your applications in the App Store, you must join the <a href="https://developer.apple.com/programs/">Apple Developer Program</a>, and set up developer certificates and provisioning profiles. The easiest solution is to use a profile that takes any App ID (a <code>*</code>).</p>
<p>Before building any Qt applications, you should test that Xcode is set up correctly, for example, by running one of the standard Xcode application templates on your device.</p>
<a name="building-applications-from-the-command-line"></a>
<h3 >Building Applications From the Command Line</h3>
<p>As mentioned previously, the development workflow consists of maintaining a normal <code>.pro</code> file project and exporting it to Xcode.</p>
<p>Here is how to build a project with Xcode:</p>
<ul>
<li>run qmake (if you have not done so previously)</li>
<li>open the resulting <code>.xcodeproj</code> file in Xcode</li>
<li>build the application in Xcode</li>
</ul>
<p>Note that you must re-import the project if its setup changes, for example, when adding or removing source files.</p>
<a name="building-applications-with-qt-creator"></a>
<h3 >Building Applications with Qt Creator</h3>
<p>You can find information on how to set up and run Apple mobile device applications in Qt Creator's manual:</p>
<ul>
<li><a href="http://doc.qt.io/qtcreator/creator-developing-ios.html">Connecting Apple Mobile Devices</a>.</li>
</ul>
<p>As mentioned previously, you must have Xcode installed.</p>
<a name="using-objective-c-code-in-qt-applications"></a>
<h2 id="using-objective-c-code-in-qt-applications">Using Objective-C Code in Qt Applications</h2>
<p>Clang, the compiler used for applications on Apple Platforms, allows mixing C++ and Objective-C code. To enable this mode, suffix your source files with <code>.mm</code>, and add them to <code>OBJECTIVE_SOURCES</code> instead of <code>SOURCES</code> in the <code>.pro</code> file. This makes it possible to use frameworks from Apple's Developer Library in Qt applications. Most useful is perhaps the possibility for adding In-App Purchasing with the StoreKit framework.</p>
<p>We currently have one example mixing Objective-C and C++ code. You find it <a href="http://wiki.qt.io/Mixing_C_and_ObjectiveC_Code">here</a>.</p>
<a name="examples-for-ios"></a>
<h2 id="examples-for-ios">Examples for iOS</h2>
<p>In Qt Creator, tested examples on iOS can be looked up. Use the <code>ios</code> keyword to search for examples in the Qt Creator Welcome mode. Note that some examples may have limited functionality.</p>
<p>For a list of examples known to work on iOS devices, visit <a href="examples-ios.html">Qt for iOS Examples</a>.</p>
<a name="related-topics"></a>
<h2 id="related-topics">Related Topics</h2>
<p>The following topics provide more details about Qt for iOS:</p>
<ul>
<li><a href="porting-to-ios.html">Porting a Qt Quick Application</a></li>
<li><a href="platform-notes-ios.html">Platform Notes</a></li>
<li><a href="building-from-source-ios.html">Qt for iOS - Building from Source</a></li>
</ul>
</div>
<!-- @@@ios_support.html -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    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.<br>    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. </p>
</div>
</body>
</html>