Building and Running a Qt Application

Lecture



Qt Creator provides support for building and running Qt applications for desktops and mobile devices. After installing Nokia Qt SDK, build and launch settings for Maemo and Symbian goals will be configured automatically.

You can add a target if the required set of tools is installed on the computer and the corresponding Qt profile is configured. Click and select a target from the list of available targets. To delete a target, select it and click.

You can select targets and click the Run button to build and launch applications for these targets. You can click the Collect All button to build all open projects in turn.

Project Setup

To view and change the settings of currently open projects, switch to the Projects mode by pressing Ctrl + 5 .

Build multiple targets

Different build configurations allow you to quickly switch between different build settings. By default, Qt Creator creates Debug and Release build settings.

Build for desktop

  1. Select Desktop as your target.
  2. Click Run .

Qt emulator build

To test Qt applications designed for mobile devices in a similar environment, you can use the Qt emulator. You can change the device information about its settings and environment.

  1. Select Qt Emulator as target.
  2. Click Run .

For more information on using the Qt emulator, see the Qt Emulator Guide.

Build for Maemo

  1. Build and run the application on a Qt emulator.
  2. Build and run the application on the Maemo emulator.
  3. You can also build and run the application on the device:
    1. Configure the MADDE development environment and specify the connection to the device. For more information, see Setting up the development environment for Maemo.
    2. Connect your device to the computer.
    3. Click Run .

To build an application, Qt Creator uses the compiler specified in the MADDE toolkit.

Qt Creator generates the installation package, installs it on the device, and launches it. The application interface is displayed on the Nokia N900. Console output is displayed in Qt Creator as an application console .

Debugging also works transparently.

Creating installation packages

When building an application for a Maemo target, Qt Creator automatically generates a debian installation package in the project directory. You can pass this installation package to users for installation on Maemo devices.

In the Create build configuration package step, you can add other files to the installation package. Add files to the Package Content field. In the Local file path field, specify the location of the file on your computer. In the Remote file path field, specify the directory to install the file on the device.

Building and Running a Qt Application

Build for Symbian

  1. Build and run the application on a Qt emulator.
  2. If no problems were found, build and run the application on the device.
  3. To test the functionality that uses the Symbian API, you can build and run the application in a Symbian emulator.

Build Configuration Objective The Symbian device uses the GCCE toolkit by default. If you want to build for a device using RVCT, select it in the Toolbox field in the General section.

Build and run on device

  1. Install the required software on the device. For more information, see Setting Up a Development Environment for Symbian.
  2. Connect your device to your computer using USB cable. Selecting a target will display a green label when the device is connected.

    Building and Running a Qt Application

    The target selection popup will show details about the current device on which your application will be running.

  3. Run the TRK App on your device.
  4. Click Run .

You can connect multiple devices to your computer at the same time. In the details of the configuration of the launch of a Symbian device target, select the desired device to launch the application.

Creating installation packages

When building an application for a Symbian Device target, Qt Creator automatically generates a Symbian installation system (SIS) file in the project directory. You can transfer this file to users for installation on Symbian devices.

Only installation files signed with a certificate and private key are allowed to be installed on Symbian devices. By default, Qt Creator itself signs the installation file. Self-signing allows you to install the application on a mobile device, but imposes restrictions on what you can do with the installation file, including:

  • Self-signed applications cannot access more important features of a mobile device.
  • When installing a self-signed application, security warnings will be displayed on the device.
  • Self-signed applications cannot be sold through the Ovi Store.

To remove these restrictions, you need to go through the Symbian Signed process. The Symbian Signed organization manages the public key infrastructure to provide public authorization information in application signing certificates. Their security partner can verify your certificate and issue you a Publisher ID. Then, when you sign the application, other people can be sure that the information in your certificate is correct and that the application really came from you.

There is a way that does not require you to get Publisher ID. For more information on how the Symbian Signed process works, see the Complete Guide to Symbian Signed.

When you have your own certificate and private key, you can specify them in the Create SIS package step of your build configuration.

Building and Running a Qt Application

Features and Digital Signature

Features allow the Symbian platform to control application access to the functionality provided by the platform API. Access to features is determined by the device settings and how the application was signed.

Symbian Signed offers the following signing options depending on the application's access to capabilities:

  • Express signed for applications that only user and system capabilities are available.
  • Certified signed for applications that also gain access to the limited capabilities or capabilities of the device manufacturer.

    Note: You will need to request access rights to the manufacturer's capabilities from the device manufacturer.

For more information on how to use the appropriate signing option, see Symbian Signed For Distributing Your Application.

If you select a signing option that does not give the application access to certain features, the installation of the application on a mobile device will fail. To solve this problem, identify opportunities and link libraries with a project only if they are really necessary for you.

For more information about existing features and how you can check which features you need, see Capabilities (Symbian Signed) and Required Capabilities for Qt Applications.

For more information on how to identify opportunities for a project, see Features.

Application UID

A UID is a globally unique identifier that is used to uniquely identify, for example, an object or a file type. When developing for Symbian, objects are identified by folding identifiers that are created from three UIDs, namely UID1, UID2, and UID3. UID1 and UID2 indicate the category of an object, and UID3 identifies a particular object, such as an application.

When you create a Qt Mobile application , Qt Creator adds the appropriate UID3 development and debugging application to the .pro file automatically. However, to distribute your application and receive the status of a signed Symbian application, you must use the UID from the Symbian Foundation, which manages the allocation of the UID. You can order a UID either one at a time, or immediately a whole block on the Symbian Signed site.

Replace the test UID with the obtained UID in the .pro file before building the final installation package. For more information, see Unique Identifiers.

Build and Run for Symbian Emulator

Select the target Symbian Emulator as the active one, then build and run your project.

Problem solving

If you cannot build an application, check the following:

  • To build the application, you chose a Symbian device as a target.
  • The settings used for building a Qt profile project are correct. The path to the Symbian SDK should point to the Symbian SDK installation directory. Select Tools > Options ... > Debugger > Symbian TRK and check that it points to the debugger toolbox.

If you are unable to run the application on the device, check the following:

  • The device is connected via USB in PC Suite mode.
  • App TRK is running on the device using a USB connection and has the status of connected .
  • Your device is detected and selected in the launch configuration details.

If you are unable to run the application in the emulator, check the following:

  • You have chosen Symbian Emulator as the target for the application.
  • If you cannot select the Symbian Emulator as the target, verify that the Carbide.c ++ installation is correct and that the path to the Carbide.c ++ installation directory is specified in the Carbide Directory field in the build settings.
  • If the emulator process cannot be started, try closing Qt Creator and launch applications directly from your file manager. After following these steps, Qt Creator should run your application in the emulator.

Note: Qt Creator does not create a release configuration for a Symbian emulator target because the Symbian emulator only supports debug builds.

If none of the above helped you solve your problem, look at the qt-creator@trolltech.com mailing list archive or write us a review as described in the Qt Creator Wiki.

Build with remote compiler

Purpose The Remote Compiler is an interface to the Forum Nokia compilation service. It provides a simple standard environment for building Qt applications and creating installation packages for Symbian and Maemo devices if you do not have the necessary toolkits and SDKs installed or they are not supported on your computer platform. You can choose from a set of supported services, such as S60 3rd Edition or S60 5th Edition devices.

Note: The remote compiler is an experimental component that you must install separately from the package included with the Nokia Qt SDK.

  1. In the Nokia Qt SDK installation directory, run SDKMaintenanceTool.exe to install experimental APIs .
  2. In Qt Creator, select Tools> Options ...> Projects> Remote Compiler to upload to Forum Nokia.

    Building and Running a Qt Application

  3. Select Projects .
  4. Click Building and Running a Qt Application and select Remote Compiler to add the remote compiler as a target.
  5. Click Add to add mobile device platforms as an assembly configuration.
  6. Click Select Target and select the build configuration.
  7. Select Build> Collect All .

Installation packages will be generated in the build directory on your computer.

For more information about the remote compiler, select Help> Content> Remote Compiler . This document will be added during the installation of the experimental APIs.


Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Cross platform programming

Terms: Cross platform programming