qt_creator.rst 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. .. _doc_configuring_an_ide_qtcreator:
  2. Qt Creator
  3. ==========
  4. Qt Creator is a free, open source IDE for all desktop platforms.
  5. Importing the project
  6. ---------------------
  7. - Choose **New Project > Import Project > Import Existing Project**.
  8. .. image:: img/qtcreator-new-project.png
  9. - Set the path to your Godot root directory and enter the project name.
  10. .. image:: img/qtcreator-set-project-path.png
  11. - Here you can choose which folders and files will be visible to the project.
  12. C/C++ files are added automatically. Potentially useful additions:
  13. ``*.py`` for buildsystem files, ``*.java`` for Android platform development,
  14. ``*.mm`` for macOS platform development. Click **Next**.
  15. .. image:: img/qtcreator-apply-import-filter.png
  16. - Click **Finish**.
  17. - Add a line containing ``.`` to ``project_name.includes`` to get working
  18. code completion.
  19. .. image:: img/qtcreator-project-name-includes.png
  20. Build and run
  21. --------------
  22. Build configuration:
  23. - Click on **Projects** and open the **Build** tab.
  24. - Delete the predefined ``make`` build step.
  25. .. image:: img/qtcreator-projects-build.png
  26. - Click **Add Build Step > Custom Process Step**.
  27. .. image:: img/qtcreator-add-custom-process-step.png
  28. - Type ``scons`` in the **Command** field. If it fails with
  29. ``Could not start process "scons"``, it can mean that ``scons`` is not in
  30. your ``PATH`` environment variable. In this case, you'll have to specify the
  31. full path to the SCons binary.
  32. - Fill the **Arguments** field with your compilation options
  33. (e.g.: ``p=linuxbsd target=debug -j 4``).
  34. .. image:: img/qtcreator-set-scons-command.png
  35. Run configuration:
  36. - Open the **Run** tab.
  37. - Point the **Executable** to your compiled Godot binary
  38. (e.g: ``%{buildDir}/bin/godot.linuxbsd.opt.tools.64``).
  39. - If you want to run a specific project, point **Working directory** to the
  40. project folder.
  41. - If you want to run the editor, add ``-e`` to the **Command line arguments**
  42. field.
  43. .. image:: img/qtcreator-run-command.png
  44. Updating sources after pulling latest commits
  45. ---------------------------------------------
  46. As a developer, you usually want to frequently pull the latest commits from the
  47. upstream Git repository or a specific fork. However, this brings a problem with
  48. it: as the development continues, source files (and folders) are added or
  49. removed. These changes need to be reflected in your project files for Qt Creator
  50. too, so you continue to have a nice programming experience. A simple way to
  51. check is to right click at your root folder in the **Projects View** and click
  52. on **Edit files...**.
  53. .. image:: img/qtcreator-edit-files-menu.png
  54. Now a new dialog should appear that is similar in functionality to the one in
  55. the third step of the *Importing the project* section above. Here, you can check
  56. whether you want to add/remove specific files and/or folders. You can choose by
  57. clicking with your mouse or just simply by clicking the **Apply Filter** button.
  58. Click on **OK** and you're ready to continue working.
  59. .. image:: img/qtcreator-edit-files-dialog.png
  60. Code style configuration
  61. ------------------------
  62. Developers must follow the project's :ref:`code style <doc_code_style_guidelines>`
  63. and the IDE should help them follow it. By default, Qt Creator does use spaces
  64. for indentation which doesn't match the Godot code style guidelines. You can
  65. change this behavior by changing the **Code Style** in **Options > C++**.
  66. .. image:: img/qtcreator-options-cpp.png
  67. Click on **Edit** to change the current settings, then click on
  68. **Copy Built-in Code Style** button to set a new code style. Set a name for it
  69. (e.g. Godot) and change the Tab policy to be **Tabs Only**.
  70. .. image:: img/qtcreator-edit-codestyle.png
  71. If you run into any issues, ask for help in one of
  72. `Godot's community channels <https://godotengine.org/community>`__.