Setting Up a Qbs Project
To use Qbs to build a project, you must create a .qbs file for the project. You can use Qt Creator to create a C or C++ project that is built with Qbs. For more information about Qbs, see the Qbs Manual.
Building Qbs
If you build Qt Creator yourself from the Qt Creator Git repository, you also need to fetch the Qbs submodule to get Qbs support:
- Fetch the Qbs submodule in your Qt Creator git checkout with
git submodule update --init
. - Run qmake on Qt Creator and build Qt Creator again.
Building Applications with Qbs
To build your application with Qbs:
- 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.
- Edit the .qbs file for you project. Usually, you must add the
Depends
item for a Qt application. For examples, see theexamples
directory in the qbs repository. - Select Projects to specify Build Settings for the project.
- Select Build Steps > Details to specify build steps:
- 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.
- In the Parallel jobs field, specify the number of parallel jobs to use for building.
- 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.
- 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.
- 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.
The Equivalent command line field displays the build command that is constructed based on the selected options.
- 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.
- Select Build > Build Project to build the application.
- Click the (Run) button to deploy and run the application.
© 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.