Setting Up a Qbs Project

The Qt Build Suite (Qbs) and the Qbs plugin are still experimental, and therefore, you must first enable the plugin manually. If you build Qt Creator yourself from our Git repository, you also need to fetch the Qbs submodule to get Qbs support.

To use Qbs to build a project, you must create a .qbs file for the project. For more information, see the Qbs Manual.

Enabling the Qbs Plugin

If you use a Qt Creator binary release, you need to enable the plugin by selecting Help > About Plugins > Build Systems > QbsProjectManager and restarting Qt Creator.

Building Qbs

To build the Qbs plugin yourself from the Qt Creator git repository:

  1. Fetch the Qbs submodule in your Qt Creator git checkout with git submodule update --init.
  2. Use Qbs or qmake and make to build Qt Creator again.
  3. Enable the Qbs plugin as described above.

Building Applications with Qbs

To build your application with Qbs:

  1. Select File > New File or Project > Plain C Project (Qbs Build) or Plain C++ Project (Qbs Build) > Choose, and follow the instructions of the wizard to create a Qbs project.

  2. Edit the .qbs file for you project. Usually, you must add the Depends item for a Qt application. For examples, see the examples directory in the qbs repository.
  3. Select Projects to specify Build Settings for the project.
  4. Select Build Steps > Details to specify build steps:

    1. In the Build variant field, select Debug to include debug symbols in the build for debugging the application and Release to create the final installation file.
    2. In the Parallel jobs field, specify the number of parallel jobs to use for building.
    3. Select the Enable QML debugging check box to debug Qt Quick application projects.

      Note: Debugging requires opening a socket at a well-known port, which 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.

    4. In the Properties field, specify the properties to pass to the project. Use colons (:) to separate keys from values. For more information, see Modules in the Qbs Manual.
    5. In the Flags field:
      • Select Dry run to test building without executing commands or making permanent changes to the build graph.
      • Select Keep going to continue building when errors occur, if possible.
      • Select Check timestamps to retrieve the timestamps from the file system instead of using the ones stored in the build graph. You only need this option if you made changes to the build directory manually, which is not recommended.

    The Equivalent command line field displays the build command that is constructed based on the selected options.

  5. Select Clean Steps > Details to specify flags for the cleaning step.

    • Select Clean all artifacts to remove all build artifacts.
    • Select Dry run to test cleaning without executing commands or making permanent changes to the build graph.
    • Select Keep going to continue cleaning when errors occur, if possible.

    The Equivalent command line field displays the clean command that is constructed based on the selected options.

  6. Select Build > Build Project to build the application.
  7. Click the (Run) button to deploy and run the application.