qt_creator.rst 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. .. _doc_configuring_an_ide_qtcreator:
  2. Qt Creator
  3. ==========
  4. `Qt Creator <https://doc.qt.io/qtcreator/index.html>`_ is a free, open source IDE for all desktop platforms.
  5. Importing the project
  6. ---------------------
  7. - From the Qt Creator's main screen select **New Project > Import Project > Import Existing Project**.
  8. .. figure:: img/qtcreator-new-project.png
  9. :figclass: figure-w480
  10. :align: center
  11. - Under **Location** select the Godot root folder.
  12. .. figure:: img/qtcreator-set-project-path.png
  13. :figclass: figure-w480
  14. :align: center
  15. - Next, you can choose which folders and files will be visible to the project.
  16. While C/C++ files are added automatically, other extensions can be potentially useful:
  17. ``*.glsl`` for shader files, ``*.py`` for buildsystem files,
  18. ``*.java`` for Android platform development, ``*.mm`` for macOS platform development.
  19. .. figure:: img/qtcreator-apply-import-filter.png
  20. :figclass: figure-w480
  21. :align: center
  22. .. note:: You can change this configuration later by right-clicking on your project
  23. and selecting the **Edit Files...** option.
  24. .. figure:: img/qtcreator-edit-files-menu.png
  25. :figclass: figure-w480
  26. :align: center
  27. - Finish the import.
  28. - Open the ``project_name.includes`` file and add a line containing ``.`` to it
  29. to correctly enable the code completion.
  30. .. figure:: img/qtcreator-project-name-includes.png
  31. :figclass: figure-w480
  32. :align: center
  33. - From the left-side menu select **Projects** and open the **Build** tab.
  34. - Delete the predefined ``make`` build step.
  35. .. figure:: img/qtcreator-projects-build.png
  36. :figclass: figure-w480
  37. :align: center
  38. - Click **Add Build Step > Custom Process Step** to add a new build step
  39. with the following settings:
  40. +-----------+------------------------------------------------------------------------------+
  41. | Command | **scons** |
  42. +-----------+------------------------------------------------------------------------------+
  43. | Arguments | See :ref:`doc_introduction_to_the_buildsystem` for a full list of arguments. |
  44. +-----------+------------------------------------------------------------------------------+
  45. .. figure:: img/qtcreator-set-scons-command.png
  46. :figclass: figure-w480
  47. :align: center
  48. .. note:: If the build fails with ``Could not start process "scons"``, it can mean that ``scons``
  49. is not in your ``PATH`` environment variable. In this case, you'll have to specify the
  50. full path to the SCons binary.
  51. Debugging the project
  52. ---------------------
  53. - From the left-side menu select **Projects** and open the **Run** tab.
  54. - Under **Executable** specify the path to your executable located in
  55. the ``<Godot root directory>/bin`` folder. The name depends on your build configuration,
  56. e.g. ``godot.linuxbsd.tools.64`` for 64-bit LinuxBSD platform with ``tools`` enabled.
  57. You can use ``%{buildDir}`` to reference the project root, e.g: ``%{buildDir}/bin/godot.linuxbsd.opt.tools.64``.
  58. - If you want to run a specific project, specify its root folder under **Working directory**.
  59. - If you want to run the editor, add ``-e`` to the **Command line arguments** field.
  60. .. figure:: img/qtcreator-run-command.png
  61. :figclass: figure-w480
  62. :align: center
  63. To learn more about command line arguments, refer to the
  64. :ref:`command line tutorial <doc_command_line_tutorial>`.
  65. Code style configuration
  66. ------------------------
  67. Developers must follow the project's :ref:`code style <doc_code_style_guidelines>`
  68. and the IDE should help them follow it. By default, Qt Creator uses spaces
  69. for indentation which doesn't match the Godot code style guidelines. You can
  70. change this behavior by changing the **Code Style** in **Tools > Options > C++**.
  71. .. figure:: img/qtcreator-options-cpp.png
  72. :figclass: figure-w480
  73. :align: center
  74. Click on **Edit** to change the current settings, then click on
  75. **Copy Built-in Code Style** button to set a new code style. Set a name for it
  76. (e.g. Godot) and change the Tab policy to be **Tabs Only**.
  77. .. figure:: img/qtcreator-edit-codestyle.png
  78. :figclass: figure-w480
  79. :align: center
  80. If you run into any issues, ask for help in one of
  81. `Godot's community channels <https://godotengine.org/community>`__.