Skip to content

Latest commit

 

History

History
72 lines (45 loc) · 2.71 KB

qtcreator.md

File metadata and controls

72 lines (45 loc) · 2.71 KB

Configure Qtcreator

Always run qtcreator from terminal to source the ROS environmental variable

Qtcreator installed using sudo apt install (Qtcreator 4)

- Bugfix: QtCreator 4 with Ubuntu 20.04
- QtCreator 4.11 running on Ubuntu 20.04 has a known bug that affects semantic highlighting.
- To fix it go to Help->About plugins and uncheck "ClangCodeModel"

set tag and indent size

Please set "Tab size" and "Indent size" equal to 2 in Tools->Options->Text Editor->Behavior and "Backspace indentation" to None. This helps portability of the indentation. In Tools->Options->C++ import "good_man.xml"

open a package the first time

There are two methods to correctly import a package, in both cases you have to compile the package once from terminal before importing the package.

option 1 ::warning:: not tested for ROS2

  • Click on Tools->options

  • Select Build & Run

  • In Default build directory, set /home/user/projects/[WORKSPACE]/build/%{CurrentProject:Name} where [WORKSPACE] is the workspace name of the package you want to open.

  • open the CMakeLists.txt file of the package

option 2 (it works also for colcon/ROS2)

  • open the CMakeLists.txt file of the package

  • in Configure project window, unselect "Desktop"

  • in Configure project window scroll down to find "Import build from build" alt text alt text

  • click on details alt text

  • click on browse and select the build directory or the package /home/user/projects/[WORKSPACE]/build/[CurrentProjecName] alt text

  • click on import

Qtcreator installed using the online installer (Qtcreator 6)

First, open Qtcreator and change the default build directory:

  • Click on Tools->options
  • Select Build & Run
  • In Default build directory, set /home/user/projects/[WORKSPACE]/build/%{CurrentProject:Name} where [WORKSPACE] is the workspace name of the package you want to open.

When you want to import a package make sure you have already compiled it. Then, open Qtcreator:

  • File -> open file or project and select the CMakeLists.txt file of the package
  • Select Import Existing Build and select the package in the build folder of the workspace /home/user/projects/[WORKSPACE]/build/[CurrentProjecName]

alt text

-In Edit build configuration change to Debug or Release depending on the variable CMAKE_BUILD_TYPE set in the CMakeLists.txt file. Note: the two fields must coincide

alt text

  • Now you can go to edit tab to work with your package