Qt Creator Manual

Specifying Run Settings

Qt Creator automatically creates run configurations for your project. To view and modify the settings, select Projects > Build & Run > Run.

The settings to specify depend on the type of the project and on the kit that you build and run the project with.

Click Add to add run settings for a project and Remove to remove the current settings.

Specifying Run Settings for qmake Projects

The run configurations for qmake projects derive their executable from the parsed .pro files. For more information on how the commands are constructed, see Starting External Processes.

Specifying Run Settings for Desktop Device Types

You can specify command line arguments to be passed to the executable and the working directory to use. The working directory defaults to the directory of the build result.

For console applications, check the Run in Terminal check box. If you need to run with special environment variables set up, you also do it in the run configuration settings.

The Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug) option (available on Mac OS, only) enables you to debug (for example, step into) linked frameworks, such as the Qt framework itself. You do not need this option for debugging your application code. If you select this option, a crash might occur when debugging applications on Mac OS X Snow Leopard. For more information, see Application Crashes when Debugging on Mac OS X Snow Leopard.

You can also create custom executable run configurations where you can set the executable to be run. For more information, see Specifying a Custom Executable to Run.

Specifying Analyzer Settings

Qt Creator integrates Valgrind code analysis tools for detecting memory leaks and profiling function execution. You can configure the tools according to your needs.

You can specify analyzer settings either globally for all projects or separately for each project.

To specify analyzer settings for the current project:

  1. In the Analyzer Settings section, select Custom.
  2. Specify analyzer settings for the project.

    "Analyzer Settings"

For more information about the settings, see:

Click Restore Global to revert to the global settings.

To specify global analyzer settings, select Tools > Options > Analyzer.

Specifying Debugger Settings

"Debugger Settings"

To select the languages to debug, select the Enable C++ and Enable QML check boxes. The Debug port is the port to communicate with the debugger. You can use any free port in the registered or dynamic port range.

Note: Opening a socket at a well-known port presents a security risk. Anyone on the Internet could connect to the application that you are debugging and execute any JavaScript functions. Therefore, you must make sure that the port is properly protected by a firewall.

If you debug more than one application at a time, you might receive an error message stating that the port is already in use. Specify a free port number in Debug port and try again.

For more information about debugging, see Debugging.

Specifying Run Settings for Linux-Based Devices

To run an application on a Linux-based device (embedded Linux, MeeGo Harmattan, or Maemo), create and select a device configuration in the kit that is used for building and running the project and set its device type correspondingly. You can also pass command line arguments to your application.

"Run settings for Linux-based devices"

To run and debug applications on Linux-based devices, you must create connections from the development PC to the devices. Click Manage device configurations to create connections. For more information, see Configuring Connections to Maemo Devices, Configuring Connections to Harmattan Devices, and Connecting Embedded Linux Devices.

When you run the application, Qt Creator copies the files to the connected device.

For MeeGo Harmattan and Maemo device types, Qt Creator also generates an installation package in the build directory by default. You can deliver the installation package to users for installation on devices that are of the same type and run the same firmware as the connected device. For more information, see Deploying Applications to Linux-Based Devices.

Specifying Run Settings for QNX Devices

To run and debug an application on a QNX or BlackBerry device, you must create connections from the development PC to the device. Click Manage device configurations to create a connection. For more information, see Connecting QNX Devices.

"Run settings for QNX devices"

When you run the application on the BlackBerry device, Qt Creator first creates a BAR package using the settings in the Application Descriptor File. The default is to create the BAR package in the build directory. The BAR package is then deployed onto the selected device. For more information, see Deploying Applications to QNX Devices.

Specifying run settings for QNX Neutrino devices is very similar to Specifying Run Settings for Linux-Based Devices.

Specifying Run Settings for Android Devices

In Package configurations, you can specify information for the Android manifest file. The Android system uses the information from the file to start application components.

Specifying Package Data

In the Manifest tab, you can select the API level to use for the Android target SDK and the name and version number for the application package.

"Manifest tab"

For more information about Android API levels, see What is API Level?.

Note: The android-4 API level does not support multitouch. If your application needs multitouch, select a higher API level.

In the Package name field, enter a package name for the application. The application is launched by an automatically generated Java launcher that is packaged with the application into an Android package (.apk). For more information, see Android Application Fundamentals.

Specifying Application Data

In the Application tab, you can select an icon for the application and give the application a name.

"Application tab"

Setting Permissions

In the Permissions tab, you can specify the permissions that your application needs. Users are asked to grant the permissions when they install the application. Android OS then grants the application access to the appropriate data and features.

"Permissions tab"

Select from existing Android permissions or add new ones to deploy the application to a particular Android OS.

Selecting Qt Libraries

In the Libraries tab, specify which Qt libraries the application uses. To automatically determine this, select Read Infomation from Application (Must Be Compiled). Alternatively, you can manually select the Qt libraries and the external libraries you think your application needs. Make sure to arrange the libraries so that depended libraries appear before the ones that depend on them.

"Libraries tab"

These entries are used by the Ministro tool to determine which Qt libraries to download.

In addition, the Java Loader uses this list to determine which Qt Libraries and other prebundled libraries to load with your application.

Signing Android Packages

In the Sign Package tab, you can sign the Android package by using a private key from the keystore. To create new keys, select Create.

"Sign Package tab"

Specifying a Custom Executable to Run

If you use CMake or the generic project type in Qt Creator, or want to run a custom desktop executable, create a Custom Executable run configuration for your project. For example, when working on a library, you can run a test application that links against the library.

Specify the executable to run, command line arguments, working directory, and environment variables to use.

"Run settings for custom executables"

Specifying Run Settings for Qt Quick UI Projects

You can specify run settings for kits with Desktop device type:

  • In the Arguments field, you can specify command line arguments to be passed to the executable.
  • In the Main QML file, select the file that Qt QML Viewer will be started with.

"Run settings for Qt Quick UI projects"