This topic describes how to set up the following:
- ArcGIS Runtime SDK for Qt for Linux.
- The Qt SDK for Linux: 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.
- Qt Creator: The IDE for Qt application development available from The Qt Company. Not an Esri product.
Install platform-specific required libraries
See ArcGIS Runtime SDK for Qt System Requirements for a list of the platform-specific libraries required for developing applications.
Download the Qt SDK for Linux 64-bit
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.
Red Hat Linux
To support Red Hat Linux 6.x 64-bit, Esri provides a build of the Qt SDK for Linux 64-bit.
- If you do not already have it, download and install Qt Creator 2.7.2 from The Qt Company.
- Download and unzip the Esri-provided Qt SDK for Linux into the desired install location.
- To help Qt Creator detect the Qt install location, create a text file named qt.conf that contains the
path. Place it into the Qt SDK bin folder, the same
folder that contains qmake. The Prefix in the example below refers to the base location of the Qt install directory, which is the folder just above the installation's bin folder.
[Paths] Prefix=<install folder>
Download and install the appropriate Qt SDK for 64-bit Linux 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 in this topic titled Tell Qt Creator where to find Qt SDKs.
- Create a new staging folder to store all the prerequisites, such as ~/Android. This folder is referred to in these instructions as <staging folder>.
- Browse to Getting Started with Qt for Android.
- Click The Android SDK Tools.
- Download the Linux 64-bit versions of Android Tools SDK Bundle, the Android NDK , Apache Ant, and the Java SE Development Kit .
- Install Java by typing the following command: sudo apt-get install openjdk-7-jdk
- Extract the Android SDK to the staging folder.
- 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.
- Extract the Android NDK to the staging folder.
- Extract and install Apache Ant in the staging folder.
- Extract and install the Java SE Development Kit.
- Download the Qt SDK for Android (on Linux) from The Qt Company.
- Run the Qt SDK for Android installer, accepting all the defaults.
- In Qt Creator, click Tools > Options > Android, and fill in the paths. Paths will be similar to the following:
- JDK Location: /<staging folder>/jdk<version>
- Android SDK Location: <staging folder>\adt-bundle-linux-x86_64-<date>\sdk
- Android NDK Location: <staging folder>\android-ndk-<version>
- Ant Location: <staging folder>\apache-ant-<version>\bin\ant.bat
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.
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:
- Click Tools > Options > Build & Run > Qt Versions, and click Add.
- Browse to the qmake file in the installation location.
- Provide a suitable name for this Qt SDK.
- 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 SDK for Android if you installed it.
Install the ArcGIS Runtime SDK for Qt
- Make sure you have read-write-execute (rwx) access to your desired ArcGIS installation location.
- Click the product's download link.
- Save the file to a installation location large enough to hold both the gzip file and the tar file extracted content.
- Unzip the ArcGIS Runtime gzip file to get the tar file. At the prompt, type % gunzip .tar.gz.
- Extract the product tar file to create the installation directory: % tar xvf .tar.
- Run the script ./Setup from the extraction location. Note: Do not double-click on the file in the file browser and select Run in Terminal, or the post-installer will start and then exit as soon as the terminal window closes.
- 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 computer. For each component you choose, provide a path to the component. For Qt Creator, use the path to the Qt Creator app. For Qt SDK installations, 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
- Add the path to the ArcGIS Runtime for Qt library files to the environment variable LD_LIBRARY_PATH. The path is <install location>/arcgis/runtime_sdk/qt10.2.6/sdk/linux/x64/lib. You can do this in your Qt Creator project settings, or by setting the environment variable before starting Qt Creator.
- For Red Hat 6 users only: Browse to the templates location in two folders, ~/.config/QtProject/qtcreator/templates/wizards/ArcGISRuntimeQmlTemplate and ~/.config/QtProject/qtcreator/templates/wizards/ArcGISRuntimeQtTemplate. In both folders, modify the file wizard.xml to delete the class="qmakeproject" attribute from the wizard tag in the XML. This attribute is supported in Qt Creator 3 but not present in Qt Creator 2.7.2.
- 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.
Configuring 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.
- Click Tools > Options > Build & Run > Kits.
- Examine the existing kits. If no existing kit has the settings you want, click Add to create a new kit.
- Give the kit an appropriate name.
- Set Device type to Desktop.
- Choose the appropriate compiler. Be sure to select the x64 version for 64-bit development.
- Choose the appropriate debugger. If there is no appropriate debugger, you may need to install it. Refer to your operating system documentation.
- Choose the Qt Version.
- Click OK or Apply to finish creating the kit.
- Repeat steps 2–8 to add Android kits if you installed the Qt SDK for Android.
- 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.
- When you open a Qt Creator project file for the first time, Qt Creator will prompt 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.
- You can now build your project in Qt Creator.