Install and set up on Mac OS X

This topic describes how to set up the following:

  • ArcGIS Runtime SDK for Qt for Mac OS X.
  • The Qt SDK for Mac OS X: The SDK available from The Qt Company for developing cross-platform applications. Not an Esri product.
  • The Qt SDK for Android: The SDK available from The Qt Company for developing Android applications. Not an Esri product.
  • The Qt SDK for iOS: The SDK available from The Qt Company for developing iOS applications. Not an Esri product.
  • Qt Creator: The IDE for Qt application development available from The Qt Company. Not an Esri product.

See ArcGIS Runtime SDK for Qt System Requirements for detailed software requirements.

Install Xcode

Install Xcode and the Xcode command line tools from https://developer.apple.com/downloads/index.action. You will need a developer account to log in. Follow the documentation at Apple's Web site.

Download the Qt SDK for OS X

To build an application using the ArcGIS Runtime SDK for Qt, you will need the Qt SDK designed to work with your compiler. You can install Qt SDKs for multiple target platforms on your development machine, side-by-side.

Download and install the Qt SDK for OS X from The Qt Company. Be sure to install Qt Creator along with the Qt SDK.

Install prerequisites for Android development

If you plan to develop applications for the Android platform, you will need to install Android SDK Tools, Android NDK, Apache Ant, and Java SE Development Kit. See Qt for Android for more information on Qt for Android. If you are not planning to develop for Android, proceed to the section of this topic titled Install prerequisites for iOS development.

  1. Create a new staging folder to store all the prerequisites, such as ~/Android. This folder is referred to in these instructions as <staging folder>.
  2. Navigate to Getting Started with Qt for Android.
  3. Click The Android SDK Tools.
  4. Download the Android Tools SDK Bundle (Mac 64-bit), the Android NDK (Mac 64-bit), Apache Ant, and the Java SE Development Kit (dmg for Mac).
  5. Extract the Android SDK to the staging folder.
  6. Launch the Android SDK Manager, and install all of the tools for Android (see ArcGIS Runtime SDK for Qt System Requirements for version information) plus the Build Tools Rev 19.
  7. Extract the Android NDK to the staging folder.
  8. Extract and install Apache Ant in the staging folder.
  9. Install the Java SE Development Kit.
  10. Download the Qt SDK for Android (on Mac) from The Qt Company.
  11. Run the Qt SDK for Android installer, accepting all the defaults.
  12. In Qt Creator, click Qt Creator > Preferences > Android, and fill in the paths. Paths will be similar to the following:
    • JDK Location: <staging folder>/CurrentJDK/Home
    • Android SDK Location: <staging folder>/adt-bundle-mac-x86_64-<date>/sdk
    • Android NDK Location: <staging folder>/android-ndk-<version>
    • Ant Location: <staging folder>/apache-ant-<version>/bin/ant

Note:

For developers choosing to use an Android Virtual Device for testing a deployment from Qt Creator, it is important that they check the Use Host GPU checkbox under Emulation Options on the dialog for creating a new AVD.

Install prerequisites for iOS development

If you plan on developing applications for the iOS platform, you must install Xcode. See Qt for iOS for more information on Qt for iOS. If you are not planning to develop for iOS, proceed to the section of this topic titled Tell Qt Creator where to find Qt SDKs.

Note:

You can download and use Qt SDK 5.5 and 5.5.1 for iOS from the Qt Company for building iOS apps. If you want to use Qt SDK 5.4.1, Esri provides a special build of the Qt SDK to use for building iOS apps. This SDK build requires at minimum openssl-1.0.1e-30.el6_64 (x86_64) on the app development machine. The Qt Company bug number for this issue is QTBUG-36891.

  1. In Xcode, click Xcode > Preferences.
  2. On the Downloads tab, click Component, and download the iOS simulator.
  3. Configure your Xcode for Distribution by following the documentation at Apple's Web site.
  4. Download and extract the Esri-provided Qt SDK for iOS into the desired location. This location is referenced as <install folder> in the steps that follow.
  5. With a text editor, open the file <install folder>/ios/bin/qt.conf, and modify the value assigned to Prefix to point to the base location of <install folder>. This step is needed for fixing paths hardcoded in the qmake executable.
    [Paths]
    Prefix=<install folder>/ios
  6. Run the script <install folder>/ios/qt-patch-ios.sh to patch the hard coded paths in the *.prl files. See the Qt documentation for details about *.prl files.
  7. In Terminal, set the current directory to the SDK install location, and execute the script.
    cd <install folder>/ios
    ./qt-patch-ios.sh

Tell Qt Creator where to find Qt SDKs

It is typical to use one Qt Creator IDE with multiple Qt SDKs, such as one SDK for desktop development and another to build and deploy to a mobile device. Qt Creator needs to know where to find the Qt SDKs you want to use. It looks for Qt SDKs on your development machine but may not detect all the Qt SDKs you want to use. This can happen when you have multiple Qt SDKs on your development machine, or if you later install another Qt SDK.

Follow these steps to tell Qt Creator about additional Qt SDKs:

  1. Click Qt Creator > Preferences > Build & Run > Qt Versions, and click Add.
  2. Browse to the qmake.exe file in the installation location.
  3. Provide a suitable name for this Qt SDK.
  4. Click Apply.

After completing these steps, the Qt SDK you specified will appear under the heading Manual. You can now use these Qt SDKs to configure kits and projects.

Repeat these steps for the Qt SDKs for Android and iOS if you installed them.

Install ArcGIS Runtime SDK for Qt

  1. Make sure you have read/write access to your desired download location.
  2. Click the product's download link.
  3. Run the extraction wizard, which asks you to choose the extraction location.
  4. Run the setup program from the extraction location.
  5. After the setup program finishes, the post-installer starts. The post-installer integrates the ArcGIS Runtime SDK for Qt with your installation of the Qt SDK and Qt Creator by copying files to locations within those install locations. Choose the Qt SDK components you want to configure. Choose only components that are installed on your development machine. For each component you choose, provide a path to the component. For Qt Creator, use the path to the Qt Creator app. For Qt SDKs, use the path to the qmake executable in the SDK's install location. Please note that the post-installer needs read/write access to ~/.config.
  6. A patch for ArcGIS Runtime SDK 10.2.6 for Qt has been released. The patch's description, list of issues addressed, its installation instructions are available for download from the Patches and Service Packs page of the Esri support website.

Configure kits and projects

In Qt Creator, a kit defines how to build an app for a target device. A kit includes references to the compiler, the Qt SDK, and the debugger.

  1. Click Qt Creator > Preferences > Build & Run > Kits.
  2. Examine the existing kits. If no existing kit has the settings you want, click Add to create a new kit.
  3. Give the kit an appropriate name.
  4. Set Device type to Desktop.
  5. Choose the Qt Version.
  6. Click OK or Apply to finish creating the kit.
  7. Repeat steps 2–6 to add Android kits if you installed the Qt SDK for Android.
  8. Repeat steps 2–6 to add iOS kits if you installed the Qt SDK for iOS.
  9. Create a project in Qt Creator for your ArcGIS Runtime SDK for Qt app. You can use a provided project template to create a new project. See Add a map to your app for more information about using a project template.
  10. When you open a Qt Creator project file for the first time, Qt Creator prompts you to configure the project. This means choosing the kits you want to use with the project. Choose the kit you created in the earlier step, and click Configure Project.
  11. You can now build your project in Qt Creator.